Permalink
Browse files

make {% comments %} template tag decoratable and add ability to attac…

…h additional post controls to them

git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1244 0cfe37f9-358a-4d5e-be75-b63607b5c754
  • Loading branch information...
jordan
jordan committed Apr 6, 2012
1 parent 595db4f commit eb2bae7ddea2bbc8016d7b630b24d9f4d1381426
Showing with 8 additions and 3 deletions.
  1. +4 −1 forum/skins/default/templates/node/comments.html
  2. +4 −2 forum/templatetags/node_tags.py
@@ -29,7 +29,10 @@
<a rel="nofollow" id="comment-{{ comment.id }}-convert-to-question" href="{% url convert_to_question id=comment.id %}?node_type=comment" title="{% trans "Convert comment to question" %}"
class="comment-convert-to-question" rel="nofollow"> </a>
{% endif %}
-
+
+ {% if comment.additional_controls %}
+ {{ comment.additional_controls }}
+ {% endif %}
<span class="comment-age">({% diff_date comment.added_at %})</span>
<a class="comment-user userinfo" href="{{comment.user.get_profile_url}}">{{comment.user.decorated_name}}</a>
@@ -192,8 +192,7 @@ def post_controls(post, user):
return {'controls': controls, 'menu': menu, 'post': post, 'user': user}
-@register.inclusion_tag('node/comments.html')
-def comments(post, user):
+def _comments(post, user):
all_comments = post.comments.filter_state(deleted=False)\
.order_by('-added_at' if settings.SHOW_LATEST_COMMENTS_FIRST else 'added_at')
@@ -250,6 +249,9 @@ def comments(post, user):
'user': user,
}
+@register.inclusion_tag('node/comments.html')
+def comments(post, user):
+ return _comments(post, user)
@register.inclusion_tag("node/contributors_info.html")
def contributors_info(node, verb=None):

0 comments on commit eb2bae7

Please sign in to comment.