1 from django import template
2 from ..models import Offer
4 register = template.Library()
7 @register.inclusion_tag("funding/tags/funding.html", takes_context=True)
8 def funding(context, offer=None, link=False, add_class=""):
9 if offer is None and context.get('funding_no_show_current') is None:
10 offer = Offer.current()
14 offer_sum = offer.sum()
18 'is_current': offer.is_current(),
19 'is_win': offer_sum >= offer.target,
20 'missing': offer.target - offer_sum,
21 'percentage': 100 * offer_sum / offer.target,
23 'add_class': add_class,
27 @register.inclusion_tag("funding/tags/offer_status.html")
28 def offer_status(offer):
33 @register.inclusion_tag("funding/tags/offer_status_more.html")
34 def offer_status_more(offer):