base_conservancy: Ready fundraiser bar for 2019.
This commit is contained in:
		
							parent
							
								
									bdac443c16
								
							
						
					
					
						commit
						ecff2f38c5
					
				
					 2 changed files with 13 additions and 7 deletions
				
			
		|  | @ -4,11 +4,12 @@ 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' | SITE_FUNDGOAL = 'cy2019-end-year-match' | ||||||
| # FIXME: Move this information into the model. | # FIXME: Move this information into the model. | ||||||
| FUNDGOAL_ENDTIMES = { | FUNDGOAL_ENDTIMES = { | ||||||
|     # End of 2019-01-15 AOE is 2019-01-16 noon UTC. |     # Noon UTC = the end of the previous day anywhere on Earth (AOE) | ||||||
|     'cy2018-end-year-match': DateTime(2019, 1, 16, 12, tzinfo=UTC), |     'cy2018-end-year-match': DateTime(2019, 1, 16, 12, tzinfo=UTC), | ||||||
|  |     'cy2019-end-year-match': DateTime(2020, 1, 16, 12, tzinfo=UTC), | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| def fundgoal_lookup(fundraiser_sought): | def fundgoal_lookup(fundraiser_sought): | ||||||
|  |  | ||||||
|  | @ -54,7 +54,8 @@ | ||||||
|   * fundraiser_goal_amount: The amount being matched |   * fundraiser_goal_amount: The amount being matched | ||||||
|   * fundraiser_so_far_amount: The amount contributed so far |   * fundraiser_so_far_amount: The amount contributed so far | ||||||
|   * fundraiser_donation_count: The number of people who have contributed so far |   * fundraiser_donation_count: The number of people who have contributed so far | ||||||
|   * fundraiser_donation_count_disclose_threshold: Not used |   * fundraiser_donation_count_disclose_threshold: The number of new Supporters that can be double-matched this fundraiser. | ||||||
|  |       (No, this name makes no sense. We're repurposing an existing model field for this new reason.) | ||||||
| * sitefundgoal_endtime: DateTime when sitefundgoal ends. | * sitefundgoal_endtime: DateTime when sitefundgoal ends. | ||||||
| 
 | 
 | ||||||
| ## Local convenience variables | ## Local convenience variables | ||||||
|  | @ -66,8 +67,7 @@ | ||||||
| 
 | 
 | ||||||
| {% endcomment %} | {% endcomment %} | ||||||
| 
 | 
 | ||||||
| {% comment %} | {% if sitefundgoal and sitefundgoal.fundraiser_so_far_amount and datetime_now < sitefundgoal_endtime %} | ||||||
| {% if sitefundgoal %} |  | ||||||
| {% with this_match_goal=sitefundgoal.fundraiser_goal_amount this_match_so_far=sitefundgoal.fundraiser_so_far_amount %} | {% 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_endtime|subtract:datetime_now %} | {% with this_match_remaining=this_match_goal|subtract:this_match_so_far sitefundgoal_timeleft=sitefundgoal_endtime|subtract:datetime_now %} | ||||||
|     <div class="fundraiser-top-text"> |     <div class="fundraiser-top-text"> | ||||||
|  | @ -87,7 +87,13 @@ | ||||||
|           {% else %} |           {% else %} | ||||||
|             The |             The | ||||||
|           {% endif %} |           {% 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> |         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 }}! | ||||||
|  | 
 | ||||||
|  |         {% if sitefundgoal.fundraiser_donation_count_disclose_threshold > 0 %} | ||||||
|  |           The next {{ sitefundgoal.fundraiser_donation_count_disclose_threshold|intcomma }} new Supporters will even have their donations tripled! | ||||||
|  |         {% endif %} | ||||||
|  | 
 | ||||||
|  |         <a href="/supporter/">Support Conservancy today!</a> | ||||||
|         {% endif %} |         {% endif %} | ||||||
|       </p> |       </p> | ||||||
| 
 | 
 | ||||||
|  | @ -111,7 +117,6 @@ | ||||||
| {% endwith %} | {% endwith %} | ||||||
| {% endwith %} | {% endwith %} | ||||||
| {% endif %} | {% endif %} | ||||||
| {% endcomment %} |  | ||||||
| 
 | 
 | ||||||
|       {% block outercontent %}<div id="mainContent"> {% block content %}{% endblock %}</div>{% endblock %} |       {% block outercontent %}<div id="mainContent"> {% block content %}{% endblock %}</div>{% endblock %} | ||||||
|     <div id="conservancyfooter"> |     <div id="conservancyfooter"> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Brett Smith
						Brett Smith