X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/a9eef437702d5df7a2f97010e6798c689371808c..4da66439c7e1cd073b2f97466208730cf5db9dff:/forum/skins/default/templates/question.html?ds=inline diff --git a/forum/skins/default/templates/question.html b/forum/skins/default/templates/question.html index 23c2411..4583518 100644 --- a/forum/skins/default/templates/question.html +++ b/forum/skins/default/templates/question.html @@ -1,46 +1,46 @@ {% extends "base.html" %} +{% load node_tags %} {% load extra_tags %} {% load extra_filters %} +{% load general_sidebar_tags %} {% load smart_if %} {% load humanize %} {% load i18n %} -{% block title %}{% spaceless %}{{ question.get_question_title }}{% endspaceless %}{% endblock %} +{% load cache %} +{% block metadescription %}{{ question.meta_description }}{% endblock %} +{% block metakeywords %}{{question.tagname_meta_generator}}{% endblock %} +{% block meta %} + + +{% endblock %} +{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %} {% block forejs %} - - - - {% if not question.closed %} - + {% if not question.nis.closed %} + + + {% if embed_youtube_videos %} + + + + {% endif %} {% endif %} - - + {% endblock %} {% block content %}
- {{ question.get_question_title }} +

{{ question.headline }}

- +
- {% 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 %}
@@ -126,97 +111,32 @@
{{ question.html|safe }}
-
-
- {% for tag in question.tagname_list %} - - {% 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_contributor_info question "original_author" %} - {% post_contributor_info question "last_updater" %} +
+ {% for tag in question.tagname_list %} + + {% endfor %}
-
- {% 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 %} +
+ {% post_controls question request.user %} + {% wiki_symbol request.user question %}
-
- - {% 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.nis.closed %}
-

{% 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.nstate.closed.extra as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %} + {{ question.nstate.closed.by.username }} + {% diff_date question.nstate.closed.at %} +

{% endif %} {% if answers %} @@ -224,55 +144,21 @@
- {% blocktrans count answers|length as counter %} - One Answer: - {% plural %} - {{counter}} Answers: - {% endblocktrans %} -
-
- {% trans "oldest answers" %} - {% trans "newest answers" %} - {% trans "popular answers" %} + {% blocktrans count answers.paginator.count as counter %}One Answer:{% plural %}{{counter}} Answers:{% endblocktrans %}
+ {{ answers.paginator.sort_tabs }}
- {% cnprog_paginator context %} + {{ answers.paginator.page_numbers }} - {% for answer in answers %} + {% for answer in answers.paginator.page %} -
+
- {% 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,119 +167,25 @@ {{ 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 %} + {% wiki_symbol request.user answer %}
- {% 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 %} -
{% endfor %}
- {% cnprog_paginator context %} + {{ answers.paginator.page_numbers }}
{% 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 %} + {% csrf_token %}
@@ -409,17 +201,23 @@
{% endspaceless %}
+ {% comment %} {% if not request.user.is_authenticated %} -
{% trans "you can answer anonymously and then login" %}
+
{% trans "You can answer anonymously and then login." %}
{% else %}

{% ifequal request.user question.author %} - {% trans "answer your own question only to give an answer" %} + {% trans "Answer your own question only to give an answer." %} {% else %} - {% trans "please only give an answer, no discussions" %} + {% trans "Please only give an answer, no discussions." %} {% endifequal %} + {% if not request.user.email_valid_and_can_answer %} + {% blocktrans %}Remember, your answer will not be published until you validate your email.{% endblocktrans %} + {% trans "Send me a validation link." %} + {% endif %}

{% endif %} + {% endcomment %}
@@ -433,6 +231,7 @@ {% trans "toggle preview" %} + {% if settings.WIKI_ON %} {{ answer.wiki }} @@ -446,11 +245,20 @@
-
{{ answer.text.errors }} +
+ + {% if answer.recaptcha %} +
+ {{ answer.recaptcha.errors }} + {{ answer.recaptcha }} +
+
+ {% endif %} +

- + class="submit" style="float:left" onclick="submitClicked(event, this.form)"/> {% endif %} @@ -468,14 +276,24 @@ {% endblock %} {% block sidebar %} +
+ {% include "subscription_status.html" %} +
+ +{% markdown_help %} + +{% sidebar_upper %} + +{% cache 60 questions_tags settings.APP_URL question.id %}

{% trans "Question tags" %}:

- {% for tag in tags %} - ×{{ tag.used_count|intcomma }}
{% endfor %}

@@ -489,15 +307,18 @@ {% trans "last updated" %}: {% diff_date question.last_activity_at %}

- +{% endcache %} +{% sidebar_lower %}

{% trans "Related questions" %}