]> git.openstreetmap.org Git - osqa.git/commitdiff
make {% comments %} template tag decoratable and add ability to attach additional...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 6 Apr 2012 14:04:20 +0000 (14:04 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 6 Apr 2012 14:04:20 +0000 (14:04 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1244 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/templates/node/comments.html
forum/templatetags/node_tags.py

index b34b58d8d8ac6b113aecf236d8889f61ece00528..a84ef89d5583d46b518aa6a61ee647e75434f683 100644 (file)
                     <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" %}"\r
                         class="comment-convert-to-question" rel="nofollow"> </a>\r
                 {% endif %}\r
                     <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" %}"\r
                         class="comment-convert-to-question" rel="nofollow"> </a>\r
                 {% endif %}\r
-                    \r
+\r
+                {% if comment.additional_controls %}\r
+                    {{ comment.additional_controls }}\r
+                {% endif %}\r
 \r
                 <span class="comment-age">({% diff_date comment.added_at %})</span>\r
                 <a class="comment-user userinfo" href="{{comment.user.get_profile_url}}">{{comment.user.decorated_name}}</a>\r
 \r
                 <span class="comment-age">({% diff_date comment.added_at %})</span>\r
                 <a class="comment-user userinfo" href="{{comment.user.get_profile_url}}">{{comment.user.decorated_name}}</a>\r
index aee496a8e4f2982f63c6d39679cdb36a542237e1..2bc3c4bd417ddee0686158f65fee142728ba6743 100644 (file)
@@ -192,8 +192,7 @@ def post_controls(post, user):
 \r
     return {'controls': controls, 'menu': menu, 'post': post, 'user': user}\r
 \r
 \r
     return {'controls': controls, 'menu': menu, 'post': post, 'user': user}\r
 \r
-@register.inclusion_tag('node/comments.html')\r
-def comments(post, user):\r
+def _comments(post, user):\r
     all_comments = post.comments.filter_state(deleted=False)\\r
                                 .order_by('-added_at' if settings.SHOW_LATEST_COMMENTS_FIRST else 'added_at')\r
 \r
     all_comments = post.comments.filter_state(deleted=False)\\r
                                 .order_by('-added_at' if settings.SHOW_LATEST_COMMENTS_FIRST else 'added_at')\r
 \r
@@ -250,6 +249,9 @@ def comments(post, user):
         'user': user,\r
     }\r
 \r
         'user': user,\r
     }\r
 \r
+@register.inclusion_tag('node/comments.html')\r
+def comments(post, user):\r
+    return _comments(post, user)\r
 \r
 @register.inclusion_tag("node/contributors_info.html")\r
 def contributors_info(node, verb=None):\r
 \r
 @register.inclusion_tag("node/contributors_info.html")\r
 def contributors_info(node, verb=None):\r