]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/templatetags/node_tags.py
ALteration of the schema to a single content model. As a bonus there is a complete...
[osqa.git] / forum / templatetags / node_tags.py
similarity index 87%
rename from forum/templatetags/question_page_tags.py
rename to forum/templatetags/node_tags.py
index 88ac0154a7743ef1dc655c423009c023bec50759..aa82c3953b5fa02e3c7c34e1654a44117b03b4d1 100644 (file)
@@ -7,11 +7,10 @@ from django import template
 \r
 register = template.Library()\r
 \r
-@register.inclusion_tag('question/vote_buttons.html')\r
+@register.inclusion_tag('node/vote_buttons.html')\r
 def vote_buttons(post, user):\r
     context = {\r
         'post': post,\r
-        'post_type': (post.__class__ is Question) and 'question' or 'answer',\r
         'user_vote': 'none'\r
     }\r
 \r
@@ -24,7 +23,7 @@ def vote_buttons(post, user):
 \r
     return context\r
 \r
-@register.inclusion_tag('question/accept_button.html')    \r
+@register.inclusion_tag('node/accept_button.html')\r
 def accept_button(answer, user):\r
     return {\r
         'can_accept': user.is_authenticated() and user.can_accept_answer(answer),\r
@@ -32,7 +31,7 @@ def accept_button(answer, user):
         'user': user\r
     }\r
 \r
-@register.inclusion_tag('question/favorite_mark.html')\r
+@register.inclusion_tag('node/favorite_mark.html')\r
 def favorite_mark(question, user):\r
     try:\r
         FavoriteQuestion.objects.get(question=question, user=user)\r
@@ -47,7 +46,7 @@ def favorite_mark(question, user):
 def post_control(text, url, command=False, title=""):\r
     return {'text': text, 'url': url, 'command': command, 'title': title}\r
 \r
-@register.inclusion_tag('question/post_controls.html')\r
+@register.inclusion_tag('node/post_controls.html')\r
 def post_controls(post, user):\r
     controls = []\r
 \r
@@ -79,7 +78,7 @@ def post_controls(post, user):
 \r
     return {'controls': controls}\r
 \r
-@register.inclusion_tag('question/comments.html')\r
+@register.inclusion_tag('node/comments.html')\r
 def comments(post, user):\r
     all_comments = post.comments.filter(deleted=False).order_by('added_at')\r
 \r
@@ -115,9 +114,8 @@ def comments(post, user):
     return {\r
         'comments': comments,\r
         'post': post,\r
-        'post_type': (post.__class__ is Question) and 'question' or 'answer',\r
         'can_comment': user.can_comment(post),\r
         'max_length': 300,\r
         'showing': showing,\r
         'total': len(all_comments),\r
-    }
\ No newline at end of file
+    }\r