fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Basically usable funding workflow.
[wolnelektury.git]
/
apps
/
funding
/
templatetags
/
funding_tags.py
diff --git
a/apps/funding/templatetags/funding_tags.py
b/apps/funding/templatetags/funding_tags.py
index
c533672
..
5331f8c
100755
(executable)
--- a/
apps/funding/templatetags/funding_tags.py
+++ b/
apps/funding/templatetags/funding_tags.py
@@
-8,10
+8,22
@@
register = template.Library()
def funding(offer=None, link=False, add_class=""):
if offer is None:
offer = Offer.current()
def funding(offer=None, link=False, add_class=""):
if offer is None:
offer = Offer.current()
+ if offer is None:
+ return {}
return {
'offer': offer,
return {
'offer': offer,
+ 'is_current': offer.is_current(),
'percentage': 100 * offer.sum() / offer.target,
'link': link,
'add_class': add_class,
}
'percentage': 100 * offer.sum() / offer.target,
'link': link,
'add_class': add_class,
}
+
+
+@register.inclusion_tag("funding/tags/offer_detail_head.html")
+def offer_detail_head(offer):
+ return {
+ 'offer': offer,
+ 'state': offer.state(),
+ }
+