fnp
/
edumed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
"zgłoś się na warsztaty" in results
[edumed.git]
/
contact
/
templatetags
/
contact_tags.py
diff --git
a/contact/templatetags/contact_tags.py
b/contact/templatetags/contact_tags.py
index
e84064a
..
d8b18cb
100755
(executable)
--- a/
contact/templatetags/contact_tags.py
+++ b/
contact/templatetags/contact_tags.py
@@
-1,8
+1,21
@@
+# -*- coding: utf-8 -*-
from django.template import Library
from django.template import Library
+
+from contact.forms import contact_forms
from contact.models import Contact
register = Library()
from contact.models import Contact
register = Library()
+
@register.filter
def pretty_print(value):
return Contact.pretty_print(value)
@register.filter
def pretty_print(value):
return Contact.pretty_print(value)
+
+
+@register.filter
+def is_enabled(form_tag):
+ form_class = contact_forms.get(form_tag)
+ if form_class:
+ return not getattr(form_class, 'disabled', False)
+ else:
+ return False