X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/a9eef437702d5df7a2f97010e6798c689371808c..e8fe07136af2115ec92747acc68321062a6dd262:/forum/skins/default/templates/question.html diff --git a/forum/skins/default/templates/question.html b/forum/skins/default/templates/question.html index 23c2411..47e654a 100644 --- a/forum/skins/default/templates/question.html +++ b/forum/skins/default/templates/question.html @@ -1,46 +1,32 @@ {% extends "base.html" %} +{% load node_tags %} {% load extra_tags %} {% load extra_filters %} {% load smart_if %} {% load humanize %} {% load i18n %} -{% block title %}{% spaceless %}{{ question.get_question_title }}{% endspaceless %}{% endblock %} +{% load cache %} +{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %} {% block forejs %} {% if not question.closed %} - {% endif %} - - + {% endblock %} {% block content %}
- {{ question.get_question_title }} + {{ question.headline }}
@@ -67,58 +63,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,90 +79,26 @@ 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 %} + {% contributors_info question %}
+ {% comments question request.user %} - {% if question.closed %} + {% if question.marked %}
-

{% blocktrans with question.get_close_reason_display as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %} - {{ question.closed_by.username }} - {% blocktrans with question.closed_at as closed_at %}close date {{closed_at}}{% endblocktrans %}

+

+ {% blocktrans with question.closed.extra as close_reason %} + The question has been closed for the following reason "{{ close_reason }}" by + {% endblocktrans %} + {{ question.closed.by.username }} + {% diff_date question.closed.at %} +

{% endif %} {% if answers %} @@ -231,11 +113,11 @@ {% endblocktrans %}
- {% trans "oldest answers" %} - {% trans "newest answers" %} - {% trans "popular answers" %}
@@ -248,31 +130,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 +140,13 @@ {{ 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 %} + {% contributors_info answer %}
+ {% comments answer request.user %} - @@ -368,32 +157,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 +231,10 @@ {% endblock %} {% block sidebar %} +
+ {% include "subscription_status.html" %} +
+{% cache 60 questions_tags settings.APP_URL question.id %}

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

- +{% endcache %}

{% trans "Related questions" %}