# HG changeset patch # User Madhusudan.C.S # Date 1249845047 -19800 # Node ID a6a5e45f68c8bc2ee59213789bd84cfe1a7b01d1 # Parent 7257b66a6766187ba5de412f4d88856f97ae453f Added support for templatetags. diff -r 7257b66a6766 -r a6a5e45f68c8 app/projrev/views/helpers/templatetags/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/projrev/views/helpers/templatetags/__init__.py Mon Aug 10 00:40:47 2009 +0530 @@ -0,0 +1,7 @@ +"""Module for all the template tags. +""" + + +__authors__ = [ + '"Madhusudan.C.S" ', +] diff -r 7257b66a6766 -r a6a5e45f68c8 app/projrev/views/helpers/templatetags/comments_helpers.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/projrev/views/helpers/templatetags/comments_helpers.py Mon Aug 10 00:40:47 2009 +0530 @@ -0,0 +1,19 @@ +"""A Django template tag library containing forms helpers. +""" + +__authors__ = [ + '"Madhusudan.C.S" ', +] + + +from django import template + +register = template.Library() + + +@register.inclusion_tag('projrev/templatetags/_as_comment.html') +def as_comment(user): + """Prints a user as a hyperlinked link_id. + """ + + return {'user': user} diff -r 7257b66a6766 -r a6a5e45f68c8 app/settings.py --- a/app/settings.py Mon Aug 10 00:06:31 2009 +0530 +++ b/app/settings.py Mon Aug 10 00:40:47 2009 +0530 @@ -94,4 +94,5 @@ 'django.contrib.sites', 'django.contrib.admin', 'app.projrev', + 'app.projrev.views.helpers', ) diff -r 7257b66a6766 -r a6a5e45f68c8 app/templates/projrev/templatetags/_as_comment.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/templates/projrev/templatetags/_as_comment.html Mon Aug 10 00:40:47 2009 +0530 @@ -0,0 +1,31 @@ +
+
+ On {{ comment.created_on|date:"jS F Y H:i" }}, + by + {% if comment.created_by %} + {{ comment.created_by.name }}: + {% else %} + {{ site_name }} Automatic Updater: + {% endif %} + + ΒΆ + +
+
+

+ {% if comment.content %} + {{ comment.content|safe }}

+ {% else %} + (No Comment was entered for this change.) + {% endif %} +
+ {% if comment.changes %} +
+
+ Changes: + {{ comment.changes|join:"; " }} +
+
+ {% endif %} +
+
\ No newline at end of file