Merge branch 'master' of ssh://k.sfconservancy.org/website
This commit is contained in:
commit
b030aa44b3
3 changed files with 24 additions and 2 deletions
|
@ -1,6 +1,16 @@
|
||||||
|
from datetime import datetime as DateTime
|
||||||
|
from pytz import utc as UTC
|
||||||
|
|
||||||
import conservancy.settings
|
import conservancy.settings
|
||||||
from conservancy.apps.fundgoal.models import FundraisingGoal as FundraisingGoal
|
from conservancy.apps.fundgoal.models import FundraisingGoal as FundraisingGoal
|
||||||
|
|
||||||
|
SITE_FUNDGOAL = 'cy2018-end-year-match'
|
||||||
|
# FIXME: Move this information into the model.
|
||||||
|
FUNDGOAL_ENDTIMES = {
|
||||||
|
# End of 2019-01-15 AOE is 2019-01-16 noon UTC.
|
||||||
|
'cy2018-end-year-match': DateTime(2019, 1, 16, 12, tzinfo=UTC),
|
||||||
|
}
|
||||||
|
|
||||||
def fundgoal_lookup(fundraiser_sought):
|
def fundgoal_lookup(fundraiser_sought):
|
||||||
try:
|
try:
|
||||||
return FundraisingGoal.objects.get(fundraiser_code_name=fundraiser_sought)
|
return FundraisingGoal.objects.get(fundraiser_code_name=fundraiser_sought)
|
||||||
|
@ -9,7 +19,10 @@ def fundgoal_lookup(fundraiser_sought):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def sitefundraiser(request):
|
def sitefundraiser(request):
|
||||||
return {'sitefundgoal': fundgoal_lookup('cy2018-end-year-match') }
|
return {
|
||||||
|
'sitefundgoal': fundgoal_lookup(SITE_FUNDGOAL),
|
||||||
|
'sitefundgoal_timeleft': FUNDGOAL_ENDTIMES[SITE_FUNDGOAL] - DateTime.now(UTC),
|
||||||
|
}
|
||||||
|
|
||||||
if conservancy.settings.FORCE_CANONICAL_HOSTNAME:
|
if conservancy.settings.FORCE_CANONICAL_HOSTNAME:
|
||||||
_HOST_URL_VAR = {'host_url': 'https://' + conservancy.settings.FORCE_CANONICAL_HOSTNAME}
|
_HOST_URL_VAR = {'host_url': 'https://' + conservancy.settings.FORCE_CANONICAL_HOSTNAME}
|
||||||
|
|
BIN
www/conservancy/static/img/2018_Sageanddaughter.jpg
Normal file
BIN
www/conservancy/static/img/2018_Sageanddaughter.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 KiB |
|
@ -71,7 +71,16 @@ this_match_remaining: this_match_goal - this_match_so_far
|
||||||
Thanks to {{ sitegoal.fundraiser_donation_count|intcomma }} Supporters we earned our full match! Help us go further to stand up for software
|
Thanks to {{ sitegoal.fundraiser_donation_count|intcomma }} Supporters we earned our full match! Help us go further to stand up for software
|
||||||
freedom — <a href="/supporter">sign up now</a>!
|
freedom — <a href="/supporter">sign up now</a>!
|
||||||
{% else %}
|
{% else %}
|
||||||
The next ${{ this_match_remaining|floatformat:0|intcomma }} of support we receive will be matched thanks to Private Internet Access and a group of generous donors, including {{ sitefundgoal.random_providers }}! <a href="/supporter/">Support Conservancy today!</a>
|
{% if sitefundgoal_timeleft.total_seconds <= 0 %}
|
||||||
|
The
|
||||||
|
{% elif sitefundgoal_timeleft.days == 0 %}
|
||||||
|
Through today only, the
|
||||||
|
{% elif sitefundgoal_timeleft.days == 1 %}
|
||||||
|
Through tomorrow only, the
|
||||||
|
{% else %}
|
||||||
|
For only {{ sitefundgoal_timeleft.days }} more days, the
|
||||||
|
{% endif %}
|
||||||
|
next ${{ this_match_remaining|floatformat:0|intcomma }} of support we receive will be matched thanks to Private Internet Access and a group of generous donors, including {{ sitefundgoal.random_providers }}! <a href="/supporter/">Support Conservancy today!</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue