Permalink
Browse files

Added templatetag for outputting div-based "table" rows

  • Loading branch information...
1 parent 3dc821d commit 0b623ad77ff1331ca30eb603f9362d17b2a2d72a @anttihirvonen committed Sep 13, 2012
@@ -0,0 +1 @@
+<div class="span6 th">{{ th }}</div><div class="span6 td">{{ td }}</div><div class="clear"></div>
@@ -1,3 +1,4 @@
+from django.utils.safestring import mark_safe
from django import template
register = template.Library()
@@ -16,3 +17,8 @@ def getfieldname(model, field):
Helper to get model field value dynamically.
"""
return model._meta.get_field(field).verbose_name
+
+
+@register.inclusion_tag('members/div_datarow.html')
+def print_row(th, td, extra_td=""):
+ return {'th': th, 'td': mark_safe(u"%s%s" % (td, extra_td))}

0 comments on commit 0b623ad

Please sign in to comment.