X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/a9eef437702d5df7a2f97010e6798c689371808c..103b5c05008c7571ac33b55d978ca8a297e9f927:/forum/skins/default/templates/question.html?ds=sidebyside diff --git a/forum/skins/default/templates/question.html b/forum/skins/default/templates/question.html index 23c2411..7a265c6 100644 --- a/forum/skins/default/templates/question.html +++ b/forum/skins/default/templates/question.html @@ -1,23 +1,22 @@ {% extends "base.html" %} +{% load node_tags %} {% load extra_tags %} {% load extra_filters %} {% load smart_if %} {% load humanize %} {% load i18n %} +{% load cache %} {% block title %}{% spaceless %}{{ question.get_question_title }}{% endspaceless %}{% endblock %} {% block forejs %} {% if not question.closed %} - {% endif %} - - + {% endblock %} {% block content %} @@ -67,58 +54,8 @@
- {% if question_vote %} - {% trans -
- {{ question.score }} -
- {% trans - - {% else %} - {% trans -
- {{ question.score }} -
- {% trans - {% endif %} - {% if favorited %} - {% trans -
- {{ question.favourite_count }} -
- {% else %} - {% trans -
- {% ifnotequal question.favourite_count 0 %}{{ question.favourite_count }}{% endifnotequal %} -
- {% endif %} - + {% vote_buttons question request.user %} + {% favorite_mark question request.user %}
@@ -133,80 +70,13 @@ title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }} {% endfor %} - {% joinitems using '|' %} - {% if request.user|can_edit_post:question %} - {% trans 'edit' %} - {% endif %} - {% separator %} - {% if question.closed %} - {% if request.user|can_reopen_question:question %} - {% trans "reopen" %} - {% endif %} - {% else %} - {% if request.user|can_close_question:question %} - {% trans "close" %} - {% endif %} - {% endif %} - {% separator %} - {% if request.user|can_flag_offensive %} - - {% trans "flag offensive" %} - {% if request.user|can_view_offensive_flags and question.offensive_flag_count %} - ({{ question.offensive_flag_count }}) - {% endif %} - - {% endif %} - {% separator %} - {% if request.user|can_delete_post:question %} - {% trans "delete" %} - {% endif %} - {% endjoinitems %} + {% post_controls question request.user %}
- {% post_contributor_info question "original_author" %} - {% post_contributor_info question "last_updater" %} -
-
- {% for comment in question.get_comments|slice:":5" %} -

- {{comment.comment}} - - {{comment.user}} - {% spaceless %} - ({% diff_date comment.added_at %}) - {% if request.user|can_delete_comment:comment %} - - {% endif %} - {% endspaceless %} -

- {% endfor %} -
-
- - {% if request.user|can_add_comments:question or question.comment_count > 5 %} - - {% if request.user|can_add_comments:question %} - {% trans "add comment" %} - {% endif %} - {% if question.comment_count > 5 %} - {% if request.user|can_add_comments:question %}/ - {% blocktrans count question.get_comments|slice:"5:"|length as counter %} - see one more - {% plural %} - see {{counter}} more - {% endblocktrans %} - {% else %} - {% blocktrans count question.get_comments|slice:"5:"|length as counter %} - see one more comment - {% plural %} - see {{counter}} more comments - {% endblocktrans %} - {% endif %} - {% endif %} - {% endif %} + {% post_contributor_info question "original_author" %} + {% post_contributor_info question "last_updater" %}
+ {% comments question request.user %} @@ -231,11 +101,11 @@ {% endblocktrans %}
- {% trans "oldest answers" %} - {% trans "newest answers" %} - {% trans "popular answers" %}
@@ -248,31 +118,8 @@
- {% trans -
- {{ answer.score }} -
- {% trans - - {% ifequal request.user question.author %} - {% trans - {% else %} - {% if answer.accepted %} - {% trans - {% endif %} - {% endifequal %} + {% vote_buttons answer request.user %} + {% accept_button answer request.user %}
@@ -281,83 +128,14 @@ {{ answer.html|safe }}
- {% joinitems using '|' %} - - - {% trans "permanent link" %} - - - {% separator %} - {% if request.user|can_edit_post:answer %} - {% trans 'edit' %} - {% endif %} - {% separator %} - {% if request.user|can_flag_offensive %} - - {% trans "flag offensive" %} - {% if request.user|can_view_offensive_flags and answer.offensive_flag_count %} - ({{ answer.offensive_flag_count }}) - {% endif %} - - {% endif %} - {% separator %} - {% if request.user|can_delete_post:answer %} - {% spaceless %} - - - {% if answer.deleted %}{% trans "undelete" %}{% else %}{% trans "delete" %}{% endif %} - - {% endspaceless %} - {% endif %} - {% endjoinitems %} + {% post_controls answer request.user %}
- {% post_contributor_info answer "original_author" %} - {% post_contributor_info answer "last_updater" %} -
-
- {% for comment in answer.get_comments|slice:":5" %} -

- {{comment.comment}} - - {{comment.user}} - {% spaceless %} - ({% diff_date comment.added_at %}) - {% if request.user|can_delete_comment:comment %} - - {% endif %} - {% endspaceless %} -

- {% endfor %} -
-
- - {% if request.user|can_add_comments:answer or answer.comment_count > 5 %} - - {% if request.user|can_add_comments:answer %} - {% trans "add comment" %} - {% endif %} - {% if answer.comment_count > 5 %} - {% if request.user|can_add_comments:answer %}/ - {% blocktrans count answer.get_comments|slice:"5:"|length as counter %} - see one more - {% plural %} - see {{counter}} more - {% endblocktrans %} - {% else %} - {% blocktrans count answer.get_comments|slice:"5:"|length as counter %} - see one more comment - {% plural %} - see {{counter}} more comments - {% endblocktrans %} - {% endif %} - {% endif %} - {% endif %} + {% post_contributor_info answer "original_author" %} + {% post_contributor_info answer "last_updater" %}
+ {% comments answer request.user %} - @@ -368,32 +146,6 @@ {% endif %}
- {% if request.user.is_authenticated %} -

- {{ answer.email_notify }} - - {% blocktrans with request.user.get_profile_url as profile_url %} - You can always adjust frequency of email updates from your {{profile_url}} - {% endblocktrans %} -

- {% else %} -

- - -

- {% endif %}
@@ -468,6 +220,10 @@ {% endblock %} {% block sidebar %} +
+ {% include "subscription_status.html" %} +
+{% cache 60 questions_tags settings.APP_URL question.id %}

{% trans "Question tags" %}: @@ -489,15 +245,17 @@ {% trans "last updated" %}: {% diff_date question.last_activity_at %}

- +{% endcache %}

{% trans "Related questions" %}