From a8e9da48209df9834c6a717acffb918e4c14403c Mon Sep 17 00:00:00 2001 From: Tomasz Zielinski Date: Mon, 9 Jan 2012 22:17:22 +0100 Subject: Re-exploded question.html template into parts, before merging wikipost to master --- .../common/templates/question/answer_comments.html | 2 +- .../common/templates/question/answer_controls.html | 69 ++-- .../templates/question/answer_vote_buttons.html | 36 +-- .../templates/question/closed_question_info.html | 6 +- .../templates/question/question_comments.html | 14 +- .../templates/question/question_controls.html | 47 ++- .../common/templates/question/question_tags.html | 7 +- .../templates/question/question_vote_buttons.html | 5 +- askbot/skins/default/templates/macros.html | 5 + askbot/skins/default/templates/question.html | 355 +-------------------- .../default/templates/question/answer_card.html | 20 +- .../default/templates/question/answer_tab_bar.html | 31 +- .../skins/default/templates/question/content.html | 30 +- .../templates/question/new_answer_form.html | 58 ++-- .../default/templates/question/question_card.html | 23 +- .../question/subscribe_by_email_prompt.html | 10 +- 16 files changed, 192 insertions(+), 526 deletions(-) diff --git a/askbot/skins/common/templates/question/answer_comments.html b/askbot/skins/common/templates/question/answer_comments.html index 1a1e97fb..e6b5e1c5 100644 --- a/askbot/skins/common/templates/question/answer_comments.html +++ b/askbot/skins/common/templates/question/answer_comments.html @@ -1,5 +1,5 @@ {{ - macros.post_comments_widget( + macros.post_comments_widget( post = answer, show_post = show_post, show_comment = show_comment, diff --git a/askbot/skins/common/templates/question/answer_controls.html b/askbot/skins/common/templates/question/answer_controls.html index 562aa9d1..bfc36cea 100644 --- a/askbot/skins/common/templates/question/answer_controls.html +++ b/askbot/skins/common/templates/question/answer_controls.html @@ -1,52 +1,43 @@ {% set pipe=joiner('|') %} {{ pipe() }} - - {% trans %}permanent link{% endtrans %} - - + + {% trans %}permanent link{% endtrans %} + + + {% if request.user|can_edit_post(answer) %}{{ pipe() }} -{% trans %}edit{% endtrans %} + {% trans %}edit{% endtrans %} {% endif %} - -{% if request.user|can_remove_all_flags_offensive(answer)%}{{ pipe() }} - - {% trans %}remove all flags{% endtrans %} - -{%endif%} - {% if request.user|can_flag_offensive(answer) %}{{ pipe() }} - - {% trans %}flag offensive{% endtrans %} - {% if request.user|can_see_offensive_flags(answer) %} - {% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %} - {% endif %} - - - -{% elif request.user|can_remove_flag_offensive(answer)%}{{ pipe() }} - - {% trans %}remove flag{% endtrans %} - {% if request.user|can_see_offensive_flags(answer) %} - {% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %} - {% endif %} - + + {% trans %}flag offensive{% endtrans %} + {% if request.user|can_see_offensive_flags(answer) %} + {% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %} + {% endif %} + + {% elif request.user|can_remove_flag_offensive(answer)%}{{ pipe() }} + + {% trans %}remove flag{% endtrans %} + {% if request.user|can_see_offensive_flags(answer) %} + {% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %} + {% endif %} + {% endif %} - {% if request.user|can_delete_post(answer) %}{{ pipe() }} {% spaceless %} - - - {% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %} - + + + {% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %} + {% endspaceless %} {% endif %} {% if settings.ALLOW_SWAPPING_QUESTION_WITH_ANSWER and request.user.is_authenticated() and request.user.is_administrator_or_moderator() %}{{ pipe() }} - {% trans %}swap with question{% endtrans %} - + {% trans %}swap with question{% endtrans %} + {% endif %} + diff --git a/askbot/skins/common/templates/question/answer_vote_buttons.html b/askbot/skins/common/templates/question/answer_vote_buttons.html index c0e86104..6f7e29b5 100644 --- a/askbot/skins/common/templates/question/answer_vote_buttons.html +++ b/askbot/skins/common/templates/question/answer_vote_buttons.html @@ -1,27 +1,15 @@ -{{ macros.post_vote_buttons( - post = answer, - visitor_vote = user_answer_votes[answer.id] - ) -}} -{% if request.user == question.author or (request.user.is_authenticated() and (request.user.is_moderator() or request.user.is_administrator())) %} -{% trans %}mark this answer as correct (click again to undo){% endtrans %} -{% else %} - {% if answer.accepted() %} - {% trans question_author=question.author.username %}{{question_author}} has selected this answer as correct{% endtrans %} - {% endif %} -{% endif %} + {% if request.user == question.author or (request.user.is_authenticated() and (request.user.is_moderator() or request.user.is_administrator())) %} + alt="{% trans %}mark this answer as correct (click again to undo){% endtrans %}" + title="{% trans %}mark this answer as correct (click again to undo){% endtrans %}" + {% else %} + alt="{% trans question_author=question.author.username %}{{question_author}} has selected this answer as correct{% endtrans %}" + title="{% trans questsion_author=question.author.username%}{{question_author}} has selected this answer as correct{% endtrans %}" + {% endif %} + /> diff --git a/askbot/skins/common/templates/question/closed_question_info.html b/askbot/skins/common/templates/question/closed_question_info.html index 1f5eeae0..87d9379c 100644 --- a/askbot/skins/common/templates/question/closed_question_info.html +++ b/askbot/skins/common/templates/question/closed_question_info.html @@ -1,5 +1,5 @@
-

{% trans close_reason=question.thread.get_close_reason_display() %}The question has been closed for the following reason "{{ close_reason }}" by{% endtrans %} -{{ question.thread.closed_by.username }}
-{% trans closed_at=question.thread.closed_at %}close date {{closed_at}}{% endtrans %}

+

{% trans close_reason=thread.get_close_reason_display() %}The question has been closed for the following reason "{{ close_reason }}" by{% endtrans %} + {{ thread.closed_by.username }}
+ {% trans closed_at=thread.closed_at %}close date {{closed_at}}{% endtrans %}

diff --git a/askbot/skins/common/templates/question/question_comments.html b/askbot/skins/common/templates/question/question_comments.html index 36d175a5..e9d3f724 100644 --- a/askbot/skins/common/templates/question/question_comments.html +++ b/askbot/skins/common/templates/question/question_comments.html @@ -1,10 +1,10 @@ {{ macros.post_comments_widget( - post = question, - show_post = show_post, - show_comment = show_comment, - show_comment_position = show_comment_position, - user = request.user, - max_comments = settings.MAX_COMMENTS_TO_SHOW - ) + post = question, + show_post = show_post, + show_comment = show_comment, + show_comment_position = show_comment_position, + user = request.user, + max_comments = settings.MAX_COMMENTS_TO_SHOW + ) }} diff --git a/askbot/skins/common/templates/question/question_controls.html b/askbot/skins/common/templates/question/question_controls.html index 2b362262..5658d559 100644 --- a/askbot/skins/common/templates/question/question_controls.html +++ b/askbot/skins/common/templates/question/question_controls.html @@ -8,43 +8,32 @@ var retagUrl = "{% url retag_question question.id %}"; {% endif %} -{% if question.thread.closed %} +{% if thread.closed %} {% if request.user|can_reopen_question(question) %}{{ pipe() }} - {% trans %}reopen{% endtrans %} + {% trans %}reopen{% endtrans %} {% endif %} {% else %} {% if request.user|can_close_question(question) %}{{ pipe() }} - {% trans %}close{% endtrans %} + {% trans %}close{% endtrans %} {% endif %} {% endif %} - -{% if request.user|can_remove_all_flags_offensive(question)%}{{ pipe() }} - - {% trans %}remove all flags{% endtrans %} - -{%endif%} - {% if request.user|can_flag_offensive(question) %}{{ pipe() }} - - {% trans %}flag offensive{% endtrans %} - {% if request.user|can_see_offensive_flags(question) %} - {% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %} - {% endif %} - - -{% elif request.user|can_remove_flag_offensive(question)%}{{ pipe() }} - - {% trans %}remove flag{% endtrans %} - {% if request.user|can_see_offensive_flags(question) %} - {% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %} - {% endif %} - - + + {% trans %}flag offensive{% endtrans %} + {% if request.user|can_see_offensive_flags(question) %} + {% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %} + {% endif %} + + {% elif request.user|can_remove_flag_offensive(question)%}{{ pipe() }} + + {% trans %}remove flag{% endtrans %} + {% if request.user|can_see_offensive_flags(question) %} + {% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %} + {% endif %} + {% endif %} - {% if request.user|can_delete_post(question) %}{{ pipe() }} {% if question.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %} {% endif %} diff --git a/askbot/skins/common/templates/question/question_tags.html b/askbot/skins/common/templates/question/question_tags.html index d104fe05..4b01be81 100644 --- a/askbot/skins/common/templates/question/question_tags.html +++ b/askbot/skins/common/templates/question/question_tags.html @@ -1,7 +1,8 @@ -{{ macros.tag_list_widget( - tags = question.get_tag_names(), +{{ + macros.tag_list_widget( + tags = thread.get_tag_names(), id = 'question-tags', css_class = 'post-tags tags', - tag_css_class = 'post-tag', + tag_css_class = 'post-tag' ) }} diff --git a/askbot/skins/common/templates/question/question_vote_buttons.html b/askbot/skins/common/templates/question/question_vote_buttons.html index ce6b18ff..8466beb9 100644 --- a/askbot/skins/common/templates/question/question_vote_buttons.html +++ b/askbot/skins/common/templates/question/question_vote_buttons.html @@ -1,4 +1 @@ -{{ macros.post_vote_buttons( - post = question, - visitor_vote = user_question_vote) -}} +{{ macros.post_vote_buttons(post = question, visitor_vote = user_question_vote) }} diff --git a/askbot/skins/default/templates/macros.html b/askbot/skins/default/templates/macros.html index d80c070a..2ffa5d25 100644 --- a/askbot/skins/default/templates/macros.html +++ b/askbot/skins/default/templates/macros.html @@ -61,6 +61,11 @@ {% endif %} {%- endmacro -%} +{%- macro post_last_updater_and_creator_info(post, min_rep_to_edit_wiki) -%} + {{ post_contributor_info(post, "original_author", post.wiki, min_rep_to_edit_wiki) }} + {{ post_contributor_info(post, "last_updater", post.wiki, min_rep_to_edit_wiki) }} +{%- endmacro -%} + {%- macro post_contributor_info(post, contributor_type, is_wiki, wiki_min_rep) -%} {# there is a whole bunch of trickery here, probably indicative of poor design of the data or methods on data objects #} diff --git a/askbot/skins/default/templates/question.html b/askbot/skins/default/templates/question.html index fab7be10..0c4ce4cc 100644 --- a/askbot/skins/default/templates/question.html +++ b/askbot/skins/default/templates/question.html @@ -11,361 +11,8 @@ {% endblock %} {% block content %} {# ==== BEGIN: question/content.html ==== #} - {% import "macros.html" as macros %} - {# ==== BEGIN: question/question_card.html ==== #} -
- {# ==== BEGIN: question/question_vote_buttons.html ==== #} - {{ macros.post_vote_buttons(post = question, visitor_vote = user_question_vote) }} - {# ==== END: question/question_vote_buttons.html ==== #} - {# ==== BEGIN: question/share_buttons.html ==== #} - {% if settings.ENABLE_SHARING_TWITTER %}{{ macros.share(site = 'twitter', icon = True) }}{% endif %} - {% if settings.ENABLE_SHARING_FACEBOOK %}{{ macros.share(site = 'facebook', icon = True) }}{% endif %} - {% if settings.ENABLE_SHARING_LINKEDIN %}{{ macros.share(site = 'linkedin', icon = True) }}{% endif %} - {% if settings.ENABLE_SHARING_IDENTICA %}{{ macros.share(site = 'identica', icon = True) }}{% endif %} - {% if settings.ENABLE_SHARING_GOOGLE %}{% endif %} - {# ==== END: question/share_buttons.html ==== #} -
-
- -

{{ thread.get_title(question) }}

- {# ==== START: question/question_tags.html" #} - {{ macros.tag_list_widget( - tags = thread.get_tag_names(), - id = 'question-tags', - css_class = 'post-tags tags', - tag_css_class = 'post-tag' - ) - }} - {# ==== END: question/question_tags.html" #} - -
-
-
- {%- macro post_last_updater_and_creator_info(post, min_rep_to_edit_wiki) -%} {# INFO: Unrolled macro from macros.html #} - {{ macros.post_contributor_info(post, "original_author", post.wiki, min_rep_to_edit_wiki) }} - {{ macros.post_contributor_info(post, "last_updater", post.wiki, min_rep_to_edit_wiki) }} - {%- endmacro -%} - {{ post_last_updater_and_creator_info(question, settings.MIN_REP_TO_EDIT_WIKI) }} - {# ==== START: "question/question_author_info.html" - {{ macros.post_last_updater_and_creator_info(question, settings.MIN_REP_TO_EDIT_WIKI) }} - ==== END: "question/question_author_info.html" #} -
- {{ question.html }} -
-
- {# ==== START: include "question/question_controls.html" #} - {% set pipe=joiner('|') %} - {% if request.user|can_edit_post(question) %}{{ pipe() }} - {% trans %}edit{% endtrans %} - {% endif %} - {% if request.user|can_retag_question(question) %}{{ pipe() }} - {% trans %}retag{% endtrans %} - - {% endif %} - {% if thread.closed %} - {% if request.user|can_reopen_question(question) %}{{ pipe() }} - {% trans %}reopen{% endtrans %} - {% endif %} - {% else %} - {% if request.user|can_close_question(question) %}{{ pipe() }} - {% trans %}close{% endtrans %} - {% endif %} - {% endif %} - {% if request.user|can_flag_offensive(question) %}{{ pipe() }} - - {% trans %}flag offensive{% endtrans %} - {% if request.user|can_see_offensive_flags(question) %} - {% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %} - {% endif %} - - {% elif request.user|can_remove_flag_offensive(question)%}{{ pipe() }} - - {% trans %}remove flag{% endtrans %} - {% if request.user|can_see_offensive_flags(question) %} - {% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %} - {% endif %} - - {% endif %} - {% if request.user|can_delete_post(question) %}{{ pipe() }} - {% if question.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %} - {% endif %} - {# ==== END: include "question/question_controls.html" #} -
- {# ==== START: question/question_comments.html ==== #} - {{ - macros.post_comments_widget( - post = question, - show_post = show_post, - show_comment = show_comment, - show_comment_position = show_comment_position, - user = request.user, - max_comments = settings.MAX_COMMENTS_TO_SHOW - ) - }} - {# ==== END: question/question_comments.html ==== #} -
- -
-
- {# ==== END: question/question_card.html ==== #} - {% if thread.closed %} - {# ==== START: question/closed_question_info.html ==== #} -
-

{% trans close_reason=thread.get_close_reason_display() %}The question has been closed for the following reason "{{ close_reason }}" by{% endtrans %} - {{ thread.closed_by.username }}
- {% trans closed_at=thread.closed_at %}close date {{closed_at}}{% endtrans %}

-
- {# ==== END: question/closed_question_info.html ==== #} - {% endif %} - - {% if answers %} - {# ==== START: question/answer_tab_bar.html ==== #} -
-

- {% trans counter=answers|length %} - {{counter}} Answer - {% pluralize %} - {{counter}} Answers - {% endtrans %} -

- -
-
- {# ==== END: question/answer_tab_bar.html ==== #} - - {{ macros.paginator(paginator_context) }} -
- - {% for answer in answers %} - {# ==== START: question/answer_card.html ==== #} - - {% if answer.old_answer_id %} - {# Make old URL anchors/hashes work #} - - {% endif %} -
-
- {# ==== START: question/answer_vote_buttons.html ==== #} - {{ macros.post_vote_buttons(post = answer, visitor_vote = user_answer_votes[answer.id]) }} - {% trans %}mark this answer as correct (click again to undo){% endtrans %} - {# ==== END: question/answer_vote_buttons.html ==== #} -
-
- -
-
-
- {{ post_last_updater_and_creator_info(answer, settings.MIN_REP_TO_EDIT_WIKI) }} - {# ==== START: question/answer_author_info.html ==== - {{ macros.post_last_updater_and_creator_info(answer, settings.MIN_REP_TO_EDIT_WIKI) }} - ==== END: question/answer_author_info.html ==== #} -
- {{ answer.html }} -
-
- {# ==== START: question/answer_controls.html ==== #} - {% set pipe=joiner('|') %} - {{ pipe() }} - - {% trans %}permanent link{% endtrans %} - - - - {% if request.user|can_edit_post(answer) %}{{ pipe() }} - {% trans %}edit{% endtrans %} - {% endif %} - {% if request.user|can_flag_offensive(answer) %}{{ pipe() }} - - {% trans %}flag offensive{% endtrans %} - {% if request.user|can_see_offensive_flags(answer) %} - {% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %} - {% endif %} - - {% elif request.user|can_remove_flag_offensive(answer)%}{{ pipe() }} - - {% trans %}remove flag{% endtrans %} - {% if request.user|can_see_offensive_flags(answer) %} - {% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %} - {% endif %} - - {% endif %} - {% if request.user|can_delete_post(answer) %}{{ pipe() }} - {% spaceless %} - - - {% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %} - - {% endspaceless %} - {% endif %} - {% if settings.ALLOW_SWAPPING_QUESTION_WITH_ANSWER and request.user.is_authenticated() and request.user.is_administrator_or_moderator() %}{{ pipe() }} - - {% trans %}swap with question{% endtrans %} - - {% endif %} - - {# ==== END: question/answer_controls.html ==== #} -
- {# ==== START: question/answer_comments.html ==== #} - {{ - macros.post_comments_widget( - post = answer, - show_post = show_post, - show_comment = show_comment, - show_comment_position = show_comment_position, - user = request.user, - max_comments = settings.MAX_COMMENTS_TO_SHOW - ) - }} - {# ==== END: question/answer_comments.html ==== #} -
-
-
-
-
- {# ==== END: question/answer_card.html ==== #} - {% endfor %} - {{ macros.paginator(paginator_context) }} -
- {% else %} - {# ==== START: question/sharing_prompt_phrase.html ==== #} - {% set question_url=settings.APP_URL+question.get_absolute_url()|urlencode %} -

{% trans %}Know someone who can answer? Share a link to this question via{% endtrans %} - {% if settings.ENABLE_SHARING_TWITTER %}{{ macros.share(site = 'twitter', site_label = 'Twitter') }},{% endif %} - {% if settings.ENABLE_SHARING_FACEBOOK %}{{ macros.share(site = 'facebook', site_label = 'Facebook') }},{% endif %} - {% if settings.ENABLE_SHARING_LINKEDIN %}{{ macros.share(site = 'linkedin', site_label = 'LinkedIn') }},{% endif %} - {% if settings.ENABLE_SHARING_IDENTICA %}{{ macros.share(site = 'identica', site_label = 'Identi.ca') }},{% endif %} - {%- if settings.ENABLE_SHARING_TWITTER or settings.ENABLE_SHARING_FACEBOOK or settings.ENABLE_SHARING_LINKEDIN or settings.ENABLE_SHARING_IDENTICA -%} - {% trans %} or{% endtrans %} - {% endif %} - {% trans %}email{% endtrans %}. -

- {# ==== END: question/sharing_prompt_phrase.html ==== #} - {% endif %} - - {# ==== START: question/new_answer_form.html ==== #} -
{% csrf_token %} - {# ==== START: question/subscribe_by_email_prompt.html ==== #} - {% if request.user.is_authenticated() %} -

- {{ answer.email_notify }} - - {% trans profile_url=request.user.get_profile_url() %}You can always adjust frequency of email updates from your {{profile_url}}{% endtrans %} -

- {% else %} -

- {{ answer.email_notify }} - -

- {% endif %} - {# ==== END: question/subscribe_by_email_prompt.html ==== #} -
- {% if request.user.is_anonymous() and settings.ALLOW_POSTING_BEFORE_LOGGING_IN == False %} - {% if not thread.closed %} - {% trans %}Login/Signup to Answer{% endtrans %} - {% endif %} - {% else %} - {% if not thread.closed %} -
- {% spaceless %} -

- {% if answers %} - {% trans %}Your answer{% endtrans %} - {% else %} - {% trans %}Be the first one to answer this question!{% endtrans %} - {% endif %} -

- {% endspaceless %} -
- {% if request.user.is_anonymous() %} -
{% trans %}you can answer anonymously and then login{% endtrans %}
- {% else %} -

- {% if request.user==question.author %} - {% trans %}answer your own question only to give an answer{% endtrans %} - {% else %} - {% trans %}please only give an answer, no discussions{% endtrans %} - {% endif %} -

- {% endif %} - {{ macros.edit_post(answer) }} - - {% if settings.WIKI_ON %} - {{ macros.checkbox_in_div(answer.wiki) }} - {% endif %} - {% endif %} - {% endif %} -
- {# ==== END: question/new_answer_form.html ==== #} - {% if request.user == question.author %}{# this is outside the form on purpose #} - - {%endif%} + {% include "question/content.html" %} {# ==== END: question/content.html ==== #} - {% endblock %} {% block sidebar %} {%include "question/sidebar.html" %} diff --git a/askbot/skins/default/templates/question/answer_card.html b/askbot/skins/default/templates/question/answer_card.html index 1d7380c5..60317559 100644 --- a/askbot/skins/default/templates/question/answer_card.html +++ b/askbot/skins/default/templates/question/answer_card.html @@ -1,23 +1,35 @@ -
+{% if answer.old_answer_id %} + {# Make old URL anchors/hashes work #} + +{% endif %} +
+ {# ==== START: question/answer_vote_buttons.html ==== #} {% include "question/answer_vote_buttons.html" %} + {# ==== END: question/answer_vote_buttons.html ==== #}
+ {# ==== START: question/answer_author_info.html ==== #} {% include "question/answer_author_info.html" %} + {# ==== END: question/answer_author_info.html ==== #}
{{ answer.html }}
- {% include "question/answer_controls.html" %} + {# ==== START: question/answer_controls.html ==== #} + {% include "question/answer_controls.html" %} + {# ==== END: question/answer_controls.html ==== #}
+ {# ==== START: question/answer_comments.html ==== #} {% include "question/answer_comments.html" %} + {# ==== END: question/answer_comments.html ==== #}
diff --git a/askbot/skins/default/templates/question/answer_tab_bar.html b/askbot/skins/default/templates/question/answer_tab_bar.html index 3e39f795..94220089 100644 --- a/askbot/skins/default/templates/question/answer_tab_bar.html +++ b/askbot/skins/default/templates/question/answer_tab_bar.html @@ -1,24 +1,23 @@

{% trans counter=answers|length %} - {{counter}} Answer - {% pluralize %} - {{counter}} Answers + {{counter}} Answer + {% pluralize %} + {{counter}} Answers {% endtrans %}

-
diff --git a/askbot/skins/default/templates/question/content.html b/askbot/skins/default/templates/question/content.html index 727f1ac1..bb0c9496 100644 --- a/askbot/skins/default/templates/question/content.html +++ b/askbot/skins/default/templates/question/content.html @@ -1,21 +1,41 @@ {% import "macros.html" as macros %} + +{# ==== BEGIN: question/question_card.html ==== #} {% include "question/question_card.html" %} -{% if question.thread.closed %} +{# ==== END: question/question_card.html ==== #} +{% if thread.closed %} + {# ==== START: question/closed_question_info.html ==== #} {% include "question/closed_question_info.html" %} + {# ==== END: question/closed_question_info.html ==== #} {% endif %} + {% if answers %} +
+ + {# ==== START: question/answer_tab_bar.html ==== #} {% include "question/answer_tab_bar.html" %} + {# ==== END: question/answer_tab_bar.html ==== #} + +
{{ macros.paginator(paginator_context) }}
+ {% for answer in answers %} + {# ==== START: question/answer_card.html ==== #} {% include "question/answer_card.html" %} + {# ==== END: question/answer_card.html ==== #} {% endfor %} {{ macros.paginator(paginator_context) }}
{% else %} + {# ==== START: question/sharing_prompt_phrase.html ==== #} {% include "question/sharing_prompt_phrase.html" %} + {# ==== END: question/sharing_prompt_phrase.html ==== #} {% endif %} - {% include "question/new_answer_form.html" %} - {% if request.user == question.author %}{# this is outside the form on purpose #} - - {%endif%} + +{# ==== START: question/new_answer_form.html ==== #} +{% include "question/new_answer_form.html" %} +{# ==== END: question/new_answer_form.html ==== #} +{% if request.user == question.author %}{# this is outside the form on purpose #} + +{%endif%} diff --git a/askbot/skins/default/templates/question/new_answer_form.html b/askbot/skins/default/templates/question/new_answer_form.html index d78334e9..a2c43f5a 100644 --- a/askbot/skins/default/templates/question/new_answer_form.html +++ b/askbot/skins/default/templates/question/new_answer_form.html @@ -1,29 +1,31 @@ -
{% csrf_token %} +{% csrf_token %} + {# ==== START: question/subscribe_by_email_prompt.html ==== #} {% include "question/subscribe_by_email_prompt.html" %} + {# ==== END: question/subscribe_by_email_prompt.html ==== #}
{% if request.user.is_anonymous() and settings.ALLOW_POSTING_BEFORE_LOGGING_IN == False %} - {% if not question.thread.closed %} - {% trans %}Login/Signup to Answer{% endtrans %} + {% if not thread.closed %} + {% trans %}Login/Signup to Answer{% endtrans %} {% endif %} {% else %} - {% if not question.thread.closed %} + {% if not thread.closed %}
{% spaceless %} -

- {% if answers %} - {% trans %}Your answer{% endtrans %} - {% else %} - {% trans %}Be the first one to answer this question!{% endtrans %} - {% endif %} -

+

+ {% if answers %} + {% trans %}Your answer{% endtrans %} + {% else %} + {% trans %}Be the first one to answer this question!{% endtrans %} + {% endif %} +

{% endspaceless %}
{% if request.user.is_anonymous() %} @@ -38,17 +40,17 @@

{% endif %} {{ macros.edit_post(answer) }} - + class="submit after-editor" style="float:left"/> {% if settings.WIKI_ON %} {{ macros.checkbox_in_div(answer.wiki) }} {% endif %} diff --git a/askbot/skins/default/templates/question/question_card.html b/askbot/skins/default/templates/question/question_card.html index 87f92209..d71ff69b 100644 --- a/askbot/skins/default/templates/question/question_card.html +++ b/askbot/skins/default/templates/question/question_card.html @@ -1,22 +1,37 @@ +
- {% include "question/question_vote_buttons.html"%} - {% include "question/share_buttons.html"%} + {# ==== BEGIN: question/question_vote_buttons.html ==== #} + {% include "question/question_vote_buttons.html" %} + {# ==== END: question/question_vote_buttons.html ==== #} + {# ==== BEGIN: question/share_buttons.html ==== #} + {% include "question/share_buttons.html" %} + {# ==== END: question/share_buttons.html ==== #}
-

{{ question.get_question_title() }}

+

{{ thread.get_title(question) }}

+ {# ==== START: question/question_tags.html" #} {% include "question/question_tags.html" %} + {# ==== END: question/question_tags.html" #} +
+ {# ==== START: "question/question_author_info.html" #} {% include "question/question_author_info.html" %} + {# ==== END: "question/question_author_info.html" #}
- {{question.html}} + {{ question.html }}
+ {# ==== START: include "question/question_controls.html" #} {% include "question/question_controls.html" %} + {# ==== END: include "question/question_controls.html" #}
+ {# ==== START: question/question_comments.html ==== #} {% include "question/question_comments.html" %} + {# ==== END: question/question_comments.html ==== #}
+
diff --git a/askbot/skins/default/templates/question/subscribe_by_email_prompt.html b/askbot/skins/default/templates/question/subscribe_by_email_prompt.html index 8b0b6853..f6520fc3 100644 --- a/askbot/skins/default/templates/question/subscribe_by_email_prompt.html +++ b/askbot/skins/default/templates/question/subscribe_by_email_prompt.html @@ -1,15 +1,15 @@ {% if request.user.is_authenticated() %}

- {{ answer.email_notify }} + {{ answer.email_notify }} @@ -17,7 +17,7 @@

{% else %}

- {{ answer.email_notify }} + {{ answer.email_notify }}

{% endif %} -- cgit v1.2.3-1-g7c22