From 0680c58853a41ef56a57b685484d0391cce59db6 2024-01-16 14:07:33 From: Bradley M. Kuhn Date: 2024-01-16 14:07:33 Subject: [PATCH] Display donation bar, noting it's results, for 1 week after end The fundgoal section is now always included, but an if statement now wraps the entire (partial) file, which will only generate any content if it's not more than one week after the fundraiser has ended. Add an else that indicates these are results if it is past the end of the fundraiser. --- diff --git a/conservancy/fundgoal/templates/fundgoal/fundraiser_goal_banner_partial.html b/conservancy/fundgoal/templates/fundgoal/fundraiser_goal_banner_partial.html index 64defd0c0ff9fb0a69c62376c2362f47065e641b..4814abf6f9bcce205ca81d7376eac85be8152ea1 100644 --- a/conservancy/fundgoal/templates/fundgoal/fundraiser_goal_banner_partial.html +++ b/conservancy/fundgoal/templates/fundgoal/fundraiser_goal_banner_partial.html @@ -26,16 +26,16 @@ {% endcomment %} {% with this_match_goal=sitefundgoal.fundraiser_goal_amount this_match_so_far=sitefundgoal.fundraiser_so_far_amount %} {% with this_match_remaining=this_match_goal|subtract:this_match_so_far sitefundgoal_timeleft=sitefundgoal.fundraiser_endtime|subtract:datetime_now this_match_exceeded=this_match_so_far|subtract:this_match_goal %} + {% if sitefundgoal_timeleft.total_seconds >= -604800 %}
+ {% if datetime_now < sitefundgoal.fundraiser_endtime %} {% if this_match_remaining <= 0 %} Thanks to so many donors, we earned our full match! Help us go further to stand up for software freedom — sign up now! {% else %} - {% if sitefundgoal_timeleft.total_seconds <= 0 %} - The - {% elif sitefundgoal_timeleft.days == 0 %} + {% if sitefundgoal_timeleft.days == 0 %} For the next {% widthratio sitefundgoal_timeleft.total_seconds 3600 1 %} hours only, the {% elif sitefundgoal_timeleft.days == 1 %} Through tomorrow only, the @@ -47,6 +47,9 @@ next ${{ this_match_remaining|floatformat:0|intcomma }} of support we receive will be matched! {% endif %} + {% else %} + Thank you so much to all our donors who participated in our donation match challenge! Here are the results: + {% endif %}
{% if 1 %} @@ -73,5 +76,6 @@
+{% endif %} {% endwith %} {% endwith %} diff --git a/conservancy/templates/base_conservancy.html b/conservancy/templates/base_conservancy.html index 886f2d3f1d8f2dfc385b3baee56a7dfdfdc9ddd8..e3a3a88ea97f14c7c174081326955fc891d36e67 100644 --- a/conservancy/templates/base_conservancy.html +++ b/conservancy/templates/base_conservancy.html @@ -80,10 +80,7 @@ - -{% if datetime_now < sitefundgoal.fundraiser_endtime %} {% include "fundgoal/fundraiser_goal_banner_partial.html" %} -{% endif %}
{% block outercontent %}
{% block content %}{% endblock %}
{% endblock %}