Changeset - d305f5103f4e
[Not reviewed]
0 1 1
Bradley Kuhn (bkuhn) - 8 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
...
 
@@ -2,2 +2,4 @@
 
{% load subtract %}
 
{% load min %}
 

	
 
<!DOCTYPE html>
...
 
@@ -57,4 +59,3 @@
 
{% 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 %}
0 comments (0 inline, 0 general)