\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
\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
'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
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
\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
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