# HG changeset patch # User Madhusudan.C.S # Date 1295490338 -19800 # Node ID eb19821863066ad0cf04ee33fae182e201398f22 # Parent 773e886d9b80f802bc4222b603c4b2f3bd9d53f2 Add templatetags for listing textbooks. This templatetag must be refactored to be utilized for tasks also. diff -r 773e886d9b80 -r eb1982186306 pytask/templates/templatetags/_as_browse_textbooks.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pytask/templates/templatetags/_as_browse_textbooks.html Thu Jan 20 07:55:38 2011 +0530 @@ -0,0 +1,12 @@ +

{{ title }}

+

List of textbooks open for contribution

+ +
diff -r 773e886d9b80 -r eb1982186306 pytask/templatetags/browse_helpers.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pytask/templatetags/browse_helpers.py Thu Jan 20 07:55:38 2011 +0530 @@ -0,0 +1,35 @@ +"""Module containing the templatetags for rendering data especially for +browsing. +""" + + +__authors__ = [ + '"Madhusudan.C.S" ', + ] + + +from django import template + + +register = template.Library() + + +@register.inclusion_tag('templatetags/_as_browse_textbooks.html') +def as_list_textbooks(textbooks, title): + """Returns a dictionary required to display the list of tasks. + """ + + return { + 'tasks': textbooks, + 'title': title, + } + + +@register.inclusion_tag('templatetags/_as_div_field.html') +def as_div_field(field): + """Returns the field for each div form field. + """ + + return { + 'field': field, + }