0 2 0
Brett Smith (brett) - 12 months ago 2019-11-24 21:01:57
brett@sfconservancy.org
base_conservancy: Ready fundraiser bar for 2019.
2 files changed with 13 insertions and 7 deletions:
↑ Collapse Diff ↑
...
 
@@ -4,11 +4,12 @@ from pytz import utc as UTC
4 4
 
import conservancy.settings
5 5
 
from conservancy.apps.fundgoal.models import FundraisingGoal as FundraisingGoal
6 6
 

	
7
 
SITE_FUNDGOAL = 'cy2018-end-year-match'
7
 
SITE_FUNDGOAL = 'cy2019-end-year-match'
8 8
 
# FIXME: Move this information into the model.
9 9
 
FUNDGOAL_ENDTIMES = {
10
 
    # End of 2019-01-15 AOE is 2019-01-16 noon UTC.
10
 
    # Noon UTC = the end of the previous day anywhere on Earth (AOE)
11 11
 
    'cy2018-end-year-match': DateTime(2019, 1, 16, 12, tzinfo=UTC),
12
 
    'cy2019-end-year-match': DateTime(2020, 1, 16, 12, tzinfo=UTC),
12 13
 
}
13 14
 

	
14 15
 
def fundgoal_lookup(fundraiser_sought):
...
 
@@ -54,7 +54,8 @@
54 54
 
  * fundraiser_goal_amount: The amount being matched
55 55
 
  * fundraiser_so_far_amount: The amount contributed so far
56 56
 
  * fundraiser_donation_count: The number of people who have contributed so far
57
 
  * fundraiser_donation_count_disclose_threshold: Not used
57
 
  * fundraiser_donation_count_disclose_threshold: The number of new Supporters that can be double-matched this fundraiser.
58
 
      (No, this name makes no sense. We're repurposing an existing model field for this new reason.)
58 59
 
* sitefundgoal_endtime: DateTime when sitefundgoal ends.
59 60
 

	
60 61
 
## Local convenience variables
...
 
@@ -66,8 +67,7 @@
66 67
 

	
67 68
 
{% endcomment %}
68 69
 

	
69
 
{% comment %}
70
 
{% if sitefundgoal %}
70
 
{% if sitefundgoal and sitefundgoal.fundraiser_so_far_amount and datetime_now < sitefundgoal_endtime %}
71 71
 
{% with this_match_goal=sitefundgoal.fundraiser_goal_amount this_match_so_far=sitefundgoal.fundraiser_so_far_amount %}
72 72
 
{% with this_match_remaining=this_match_goal|subtract:this_match_so_far sitefundgoal_timeleft=sitefundgoal_endtime|subtract:datetime_now %}
73 73
 
    <div class="fundraiser-top-text">
...
 
@@ -87,7 +87,13 @@
87 87
 
          {% else %}
88 88
 
            The
89 89
 
          {% endif %}
90
 
        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>
90
 
        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 }}!
91
 

	
92
 
        {% if sitefundgoal.fundraiser_donation_count_disclose_threshold > 0 %}
93
 
          The next {{ sitefundgoal.fundraiser_donation_count_disclose_threshold|intcomma }} new Supporters will even have their donations tripled!
94
 
        {% endif %}
95
 

	
96
 
        <a href="/supporter/">Support Conservancy today!</a>
91 97
 
        {% endif %}
92 98
 
      </p>
93 99
 

	
...
 
@@ -111,7 +117,6 @@
111 117
 
{% endwith %}
112 118
 
{% endwith %}
113 119
 
{% endif %}
114
 
{% endcomment %}
115 120
 

	
116 121
 
      {% block outercontent %}<div id="mainContent"> {% block content %}{% endblock %}</div>{% endblock %}
117 122
 
    <div id="conservancyfooter">
0 comments (0 inline, 0 general)