Implement min filter.

This commit is contained in:
Bradley M. Kuhn 2015-11-30 20:32:57 -08:00
parent 20d3accd3c
commit d305f5103f
2 changed files with 11 additions and 2 deletions

View file

@ -0,0 +1,8 @@
from django import template
register = template.Library()
@register.filter
def min(value, arg):
if value > arg:
return arg
return value

View file

@ -1,5 +1,7 @@
{% 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>