Compare commits

...
Sign in to create a new pull request.

21 commits

Author SHA1 Message Date
a2421ddcbd Final linkage 2026-01-14 14:12:24 -08:00
173139b04e Final fixes I hope 2026-01-14 14:08:27 -08:00
1a9461152b fix various copoy 2026-01-14 14:05:53 -08:00
cf6d469f8f make copy both situations match 2026-01-14 14:04:27 -08:00
1a2e7214af fix copy text 2026-01-14 14:00:34 -08:00
0f11cace7c fix url, fix number 2026-01-14 13:56:55 -08:00
321dde57cb Add date pono and karen decided 2026-01-14 13:44:24 -08:00
12f618af3b Close <em> tag 2026-01-14 13:40:05 -08:00
42887bfb0b There was still a missing {% endif %} 😩 2026-01-14 13:33:22 -08:00
ce2bbbba7b Rework if-then-else mess; format div's 2026-01-14 13:30:08 -08:00
76ef5019af fix endifs and change formatting
formatting removes additional raised on original bar
also increase size of larger portion of match
2026-01-14 11:49:59 -08:00
8719403b81 Still not right, boy an django template mode for Emacs would help
{# LEFT OFF HERE #} shows where I left off.
2026-01-14 11:24:18 -08:00
4b0172080f logic 2026-01-14 10:48:25 -08:00
f33fc80520 Minor changes to logic 2026-01-14 10:42:37 -08:00
2b26d1efb2 endif wrong? 2026-01-14 10:34:03 -08:00
c3aff1e73a Not sure my endif count is right, so this my 500 2026-01-14 10:32:31 -08:00
8d75fdf851 Create a real FUND_GOAL_1 2026-01-14 10:11:39 -08:00
06dfa1a619 Now, make a duplicate of sitefundgoal0 text for sitefundgoal1. 2026-01-14 10:09:21 -08:00
746fa42f6c Next step, make a sitefundgoal1 object. 2026-01-14 10:07:43 -08:00
a17c08f00c Step 2, switch to using 'sitefundgoal0' 2026-01-14 10:04:42 -08:00
e5ea74887a First step to a two-bar solution; make another SITE_FUNDGOAL …
… but don't use it yet.
2026-01-14 09:37:00 -08:00
4 changed files with 111 additions and 47 deletions

View file

@ -4,10 +4,14 @@ from .fundgoal.models import FundraisingGoal
def sitefundraiser(request): def sitefundraiser(request):
try: try:
fundgoal = FundraisingGoal.objects.get(fundraiser_code_name=settings.SITE_FUNDGOAL) fundgoal0 = FundraisingGoal.objects.get(fundraiser_code_name=settings.SITE_FUNDGOAL_0)
except FundraisingGoal.DoesNotExist: except FundraisingGoal.DoesNotExist:
fundgoal = None fundgoal0 = None
return {'sitefundgoal': fundgoal} try:
fundgoal1 = FundraisingGoal.objects.get(fundraiser_code_name=settings.SITE_FUNDGOAL_1)
except FundraisingGoal.DoesNotExist:
fundgoal1 = None
return {'sitefundgoal0': fundgoal0, 'sitefundgoal1': fundgoal1 }
def host_url(request): def host_url(request):

View file

@ -1,51 +1,106 @@
{% load humanize %} {% load humanize %}
{% if sitefundgoal.days_remaining >= -22 %}{# i.e. 7 days over completion #} {% if sitefundgoal1.days_remaining >= -22 or sitefundgoal0.days_remaining >= -22 %} {# IF LEVEL 0 (only show this at all for 7 days after fundraiser and stretch are over) #}
<div class="fundraiser-top-text ph3 pt2 pb3 mb2 mb3-ns"> <div class="fundraiser-top-text ph3 pt2 pb3 mb2 mb3-ns">
<div class="mw8 center ph2 ph4-ns"> <div class="mw8 center ph2 ph4-ns">
<div class="mt2 mb3 tc"> <div class="mt2 mb3 tc">
{% if sitefundgoal.days_remaining >= 0 %} {% if sitefundgoal0.match_remaining <= 0 %} {# IF LEVEL 0.1 #}
{% if sitefundgoal.match_remaining <= 0 %} {% if sitefundgoal1.days_remaining >= 0 %} {# IF LEVEL 0.1.0 #}
Thanks to so many donors, we earned our full match! {% if sitefundgoal1.match_remaining <= 0 %} {# IF LEVEL 0.1.0.0 #}
Help us go further to stand up for software freedom &mdash; <a href="/sustainer">sign up now</a>! Thanks to all our donors who participated in our historic donation match challenge!
{% else %} Thanks to all of you, we raised our goal of <b>$503,878</b> to support software freedom:
{% if sitefundgoal.days_remaining == 0 %} {% else %} {# ELSE LEVEL 0.1.0.0 when sitefundgoal1.match_remaining > 0 #}
For the next {{ sitefundgoal.hours_remaining }} hour{{ sitefundgoal.hours_remaining|pluralize }} <strong>only</strong>, the Thanks to so many donors, we met <em>our largest match donation ever of <strong>$211,939</strong></em>.
{% elif sitefundgoal.days_remaining == 1 %} Two generous anonymous <a href="/news/2026/jan/14/match-challenge-extended-by-40012/">donors have provided</a> <em>another ${{ sitefundgoal1.fundraiser_goal_amount|floatformat:0|intcomma }}</em> of <em>additional</em> matching funds.
Help us reach our goal of <b>$503,878</b> this season to keep SFC going. Through tomorrow only, the <a href="/sustainer/">Give now to help us</a> reach <a href="/news/2026/jan/14/match-challenge-extended-by-40012/">this stretch goal</a>!<br/>
{% elif sitefundgoal.days_remaining < 14 %} {% if sitefundgoal1.days_remaining == 0 %} {# IF LEVEL 0.1.0.0.0 sitefundgoal1.days_remaining alternatives #}
Help us reach our goal of <b>$503,878</b> this season to keep SFC going. For only {{ sitefundgoal.days_remaining }} more days, the For <strong>only</strong> the next {{ sitefundgoal1.hours_remaining }} hour{{ sitefundgoal1.hours_remaining|pluralize }}, the
{% else %} {% elif sitefundgoal1.days_remaining == 1 %} {# ELIF LEVEL 0.1.0.0.0 sitefundgoal1.days_remaining alternatives #}
Help us reach our goal of <b>$503,878</b> this season to keep SFC going. Until January 15, the Through tomorrow only, the
{% endif %} {% elif sitefundgoal1.days_remaining < 14 %} {# ELIF LEVEL 0.1.0.0.0 sitefundgoal1.days_remaining alternatives #}
next <b>${{ sitefundgoal.match_remaining|floatformat:0|intcomma }}</b> of <a href="/sustainer/">support we receive</a> will be matched! For only {{ sitefundgoal1.days_remaining }} more days, the
{% endif %} {% else %} {# ELIF LEVEL 0.1.0.0.0 sitefundgoal1.days_remaining alternatives #}
{% else %} Until February 5, the
Thanks to all our donors who participated in our {% endif %} {# ELSE LEVEL 0.1.0.0.0 sitefundgoal1.days_remaining alternatives #}
historic donation match challenge! Thanks to you, <a href="https://sfconservancy.org/blog/2025/jan/16/end-of-year-2024-fundraiser-a-massive-success/">we next <b>${{ sitefundgoal1.match_remaining|floatformat:0|intcomma }}</b> of <a href="/sustainer/">financial support we receive</a> will be matched!
raised more than $480k to support software freedom</a>: {% endif %} {# ENDIF LEVEL 0.1.0.0 (testing whether or not sitefundgoal1.match_remaining has anything left in it) #}
{% endif %} {% else %} {# ELSE LEVEL 0.1.0 when (sitefundgoal1.days_remaining < 0) #}
</div> {# The problem with automating this is that it does not actually test here if we made the match or not; we are usually watching it so carefully that it should not matter? We also have made ever match we did since 2015, so no one has probably thought hard about this problem. -- bkuhn #}
Thanks to all our donors who participated in our historic donation match challenge!
Thanks to all of you, we raised our goal of <b>$503,878</b>.
Help us go further to stand up for software freedom &mdash; <a href="/sustainer">sign up now</a>!
{% endif %} {# ENDIF LEVEL 0.1.0 (whether or not there are any sitefundgoal1.days_remaining) #}
<a href="/sustainer/" style="text-decoration: none !important"> <a href="/sustainer/" style="text-decoration: none !important">
<div id="siteprogressbar" class="flex items-stretch w-100"> <div id="siteprogressbar" class="flex items-stretch w-100">
{% if sitefundgoal.match_remaining <= 0 %} {% if sitefundgoal1.match_remaining <= 0 %} {# IF LEVEL 0.1.1 #}
<div class="progress matched ph1 pv1 b flex items-center" style="flex-basis: {{ sitefundgoal.fundraiser_so_far_amount }}px"> <div class="progress matched ph1 pv1 b flex items-center" style="flex-basis: {{ sitefundgoal1.fundraiser_so_far_amount }}px">
<span id="site-fundraiser-match-count" class="soFarText tc w-100 ph1">${{ sitefundgoal.fundraiser_goal_amount|floatformat:0|intcomma }} fully matched!</span> <span id="site-fundraiser-match-count" class="soFarText tc w-100 ph1 done">${{ sitefundgoal1.fundraiser_goal_amount|floatformat:0|intcomma }} fully matched!</span>
</div> </div>
<div class="progress exceeded pv1 b flex items-center" style="flex-basis: {{ sitefundgoal.match_exceeded_by }}px"> {% else %} {# ELSE LEVEL 0.1.1 when sitefundgoal1.match_remaining > 0 #}
<span id="site-fundraiser-match-count" class="soFarText tc w-100 exceeded ph1">${{sitefundgoal.match_exceeded_by|floatformat:0|intcomma }} additional<br> raised!<br></span> <div class="progress ph1 pv1 b flex items-center" style="flex-basis: {{ sitefundgoal1.fundraiser_so_far_amount }}px">
</div> <span id="site-fundraiser-match-count" class="soFarText tc w-100">${{ sitefundgoal1.fundraiser_so_far_amount|floatformat:0|intcomma }} matched!</span>
{% else %} </div>
<div class="progress ph1 pv1 b flex items-center" style="flex-basis: {{ sitefundgoal.fundraiser_so_far_amount }}px"> <div class="final-goal pv1 b flex items-center" style="flex-basis: {{ sitefundgoal1.match_remaining }}px">
<span id="site-fundraiser-match-count" class="soFarText tc w-100">${{ sitefundgoal.fundraiser_so_far_amount|floatformat:0|intcomma }} matched!</span> <span id="site-fundraiser-final-goal" class="goalText tc w-100 ph1">${{ sitefundgoal1.match_remaining|floatformat:0|intcomma }} to go!</span>
</div> </div>
<div class="final-goal pv1 b flex items-center" style="flex-basis: {{ sitefundgoal.match_remaining }}px"> {% endif %} {# ENDIF LEVEL 0.1.1 testing whether or not sitefundgoal1.match_remaining has anything in it #}
<span id="site-fundraiser-final-goal" class="goalText tc w-100 ph1">${{ sitefundgoal.match_remaining|floatformat:0|intcomma }} to go!</span>
</div>
{% endif %}
</div> </div>
</a> </a>
<a href="/sustainer/" style="text-decoration: none !important">
<div id="siteprogressbar" class="flex items-stretch w-100">
{% if sitefundgoal0.match_remaining <= 0 %} {# IF LEVEL 0.1.2, pointless test of sitefundgoal0.match_remaining (if we get here, else block should never be used!) #}
<div class="progress matched ph1 pv1 b flex items-center" style="flex-basis: {{ sitefundgoal0.fundraiser_so_far_amount }}px">
<span id="site-fundraiser-match-count" class="soFarText tc w-100 ph1 done">${{ sitefundgoal0.fundraiser_goal_amount|floatformat:0|intcomma }} fully matched!</span>
</div>
{% else %} {# ELSE LEVEL 0.1.2, sitefundgoal0.match_remaining > 0 , but NOTE! We are here inside IF LEVEL 0.1, so this *should* never appear, included just for consistency #}
<div class="progress ph1 pv1 b flex items-center" style="flex-basis: {{ sitefundgoal0.fundraiser_so_far_amount }}px">
<span id="site-fundraiser-match-count" class="soFarText tc w-100">${{ sitefundgoal0.fundraiser_so_far_amount|floatformat:0|intcomma }} matched!</span>
</div>
<div class="final-goal pv1 b flex items-center" style="flex-basis: {{ sitefundgoal0.match_remaining }}px">
<span id="site-fundraiser-final-goal" class="goalText tc w-100 ph1">${{ sitefundgoal0.match_remaining|floatformat:0|intcomma }} to go!</span>
</div>
{% endif %} {# ENDIF LEVEL 0.1.2, this ends the pointless block here for consistency, see comment above. #}
</div>
</a>
{% else %} {# ELSE LEVEL 0.1 when (sitefundgoal0.match_remaining > 0) #}
{% if sitefundgoal0.days_remaining >= 0 %} {# IF LEVEL 0.1.3 #}
{% if sitefundgoal0.match_remaining <= 0 %} {# IF LEVEL 0.1.3.0 #}
Thanks to so many donors, we earned our full match!
{% else %} {# ELSE LEVEL 0.1.3.0 when sitefundgoal0.match_remaining > 0 #}
{% if sitefundgoal0.days_remaining == 0 %} {# IF LEVEL 0.1.3.0.0 testing options for sitefundgoal0.days_remaining #}
For <strong>only</strong> the next {{ sitefundgoal0.hours_remaining }} hour{{ sitefundgoal0.hours_remaining|pluralize }}, the
{% elif sitefundgoal0.days_remaining == 1 %} {# ELSIF LEVEL 0.1.3.0.0 testing options for sitefundgoal0.days_remaining #}
Help us reach our goal of <b>$503,878</b> this season to keep SFC going. Through tomorrow only, the
{% elif sitefundgoal0.days_remaining < 14 %} {# ELSIF LEVEL 0.1.3.0.0 testing options for sitefundgoal0.days_remaining #}
Help us reach our goal of <b>$503,878</b> this season to keep SFC going. For only {{ sitefundgoal0.days_remaining }} more days, the
{% else %} {# ELSE LEVEL 0.1.3.0.0 testing options for sitefundgoal0.days_remaining #}
Help us reach our goal of <b>$503,878</b> this season to keep SFC going. Until January 15, the
{% endif %} {# ENDIF LEVEL 0.1.3.0.0 testing options for sitefundgoal0.days_remaining #}
next <b>${{ sitefundgoal0.match_remaining|floatformat:0|intcomma }}</b> of <a href="/sustainer/">support we receive</a> will be matched!
{% endif %} {# ENDIF LEVEL 0.1.3.0 testing if sitefundgoal0.match_remaining has anything left #}
{% else %} {# ENDIF LEVEL 0.1.3, when sitefundgoal0.days_remaining < 0 #}
{# The problem with automating this is that it does not actually test here if we made the match or not; we are usually watching it so carefully that it should not matter? We also have made ever match we did since 2015, so no one has probably thought hard about this problem. -- bkuhn #}
Thanks to all our donors who participated in our historic donation match challenge!
Help us go further to stand up for software freedom &mdash; <a href="/sustainer">sign up now</a>!
{% endif %} {# ENDIF LEVEL 0.1.3, testing if there are any sitefundgoal0.days_remaining left #}
<a href="/sustainer/" style="text-decoration: none !important">
<div id="siteprogressbar" class="flex items-stretch w-100">
{% if sitefundgoal0.match_remaining <= 0 %} {# IF LEVEL 0.1.3.1 #}
<div class="progress matched ph1 pv1 b flex items-center" style="flex-basis: {{ sitefundgoal0.fundraiser_so_far_amount }}px">
<span id="site-fundraiser-match-count" class="soFarText tc w-100 ph1 done">${{ sitefundgoal0.fundraiser_goal_amount|floatformat:0|intcomma }} fully matched!</span>
</div>
{% else %} {# ELSE LEVEL 0.1.3.1 sitefundgoal0.match_remaining > 0 #}
<div class="progress ph1 pv1 b flex items-center" style="flex-basis: {{ sitefundgoal0.fundraiser_so_far_amount }}px">
<span id="site-fundraiser-match-count" class="soFarText tc w-100">${{ sitefundgoal0.fundraiser_so_far_amount|floatformat:0|intcomma }} matched!</span>
</div>
<div class="final-goal pv1 b flex items-center" style="flex-basis: {{ sitefundgoal0.match_remaining }}px">
<span id="site-fundraiser-final-goal" class="goalText tc w-100 ph1">${{ sitefundgoal0.match_remaining|floatformat:0|intcomma }} to go!</span>
</div>
{% endif %} {# ENDIF LEVEL 0.1.3.1 sitefundgoal0.match_remaining #}
</div>
</a>
{% endif %} {# ENDIF LEVEL 0.1, two choices for based on sitefundgoal0.match_remaining #}
</div> </div>
</div> </div>
{% endif %} </div>
{% endif %} {# ENDIF LEVEL 0 (the fundraiser has been over for > 7 days) #}

View file

@ -162,4 +162,6 @@ USETHESOURCE = {
'LIST_RECIPIENT': 'ccs-review@lists.sfconservancy.org', 'LIST_RECIPIENT': 'ccs-review@lists.sfconservancy.org',
} }
SITE_FUNDGOAL = 'cy2025-end-year-match' SITE_FUNDGOAL_0 = 'cy2025-end-year-match'
SITE_FUNDGOAL_1 = 'fy2025-26-extend-match'

View file

@ -1168,6 +1168,9 @@ body > header {
#siteprogressbar .soFarText { #siteprogressbar .soFarText {
color: white; color: white;
} }
#siteprogressbar .done {
font-size: 130%;
}
#siteprogressbar .exceeded { #siteprogressbar .exceeded {
color: var(--khaki-green); color: var(--khaki-green);
} }