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