Changeset - d305f5103f4e
[Not reviewed]
0 1 1
Bradley Kuhn (bkuhn) - 6 years ago 2015-12-01 04:33:14
bkuhn@ebb.org
Implement min filter.
2 files changed with 11 insertions and 2 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/news/templatetags/min.py
Show inline comments
 
new file 100644
 
from django import template
 
register = template.Library()
 

	
 
@register.filter
 
def min(value, arg):
 
    if value > arg:
 
        return arg
 
    return value
www/conservancy/templates/base_conservancy.html
Show inline comments
 
{% load humanize %}
 
{% load subtract %}
 
{% load min %}
 

	
 
<!DOCTYPE html>
 

	
 
<html lang="en">
...
 
@@ -55,8 +57,7 @@
 
<a href="/supporter"><div id="siteprogressbar">
 
    <span id="site-fundraiser-so-far">{{ sitefundgoal.fundraiser_so_far_amount|intcomma }}</span> have joined so far
 
{% if sitefundgoal.fundraiser_donation_count_disclose_threshold > 0 %}
 
{% if sitefundgoal.fundraiser_donation_count_disclose_threshold < 83 %}
 
    and match pledges reduced our 2,500 maximum need by <span id="site-fundraiser-match-count">{{ sitefundgoal.fundraiser_donation_count_disclose_threshold|intcomma }}</span>
 
    and match pledges reduced our 2,500 maximum need by <span id="site-fundraiser-match-count">{{ sitefundgoal.fundraiser_donation_count_disclose_threshold|min:83|intcomma }}</span>
 
{% endif %}
 
{% endif %}
 
!</div></a>
0 comments (0 inline, 0 general)