diff options
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('<span class="sep">|</span>') %} <span class="linksopt">{{ pipe() }} - <a class="permant-link" - href="{{ answer.get_absolute_url() }}" - title="{% trans %}answer permanent link{% endtrans %}"> - {% trans %}permanent link{% endtrans %} - </a> -</span> + <a class="permant-link" + href="{{ answer.get_absolute_url(question_post=question) }}" + title="{% trans %}answer permanent link{% endtrans %}"> + {% trans %}permanent link{% endtrans %} + </a> + </span> + {% if request.user|can_edit_post(answer) %}{{ pipe() }} -<span class="action-link"><a class="question-edit" href="{% url edit_answer answer.id %}">{% trans %}edit{% endtrans %}</a></span> + <span class="action-link"><a class="question-edit" href="{% url edit_answer answer.id %}">{% trans %}edit{% endtrans %}</a></span> {% endif %} - -{% if request.user|can_remove_all_flags_offensive(answer)%}{{ pipe() }} -<span id="answer-offensive-remove-all-flag-{{ answer.id }}" class="offensive-flag" - title="{% trans %}remove all flags{% endtrans %}"> - <a class="question-flag">{% trans %}remove all flags{% endtrans %}</a> -</span> -{%endif%} - {% if request.user|can_flag_offensive(answer) %}{{ pipe() }} -<span id="answer-offensive-flag-{{ answer.id }}" class="offensive-flag" - title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"> - <a class="question-flag">{% trans %}flag offensive{% endtrans %} - {% if request.user|can_see_offensive_flags(answer) %} - <span class="darkred">{% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %}</span> - {% endif %} - </a> -</span> - -{% elif request.user|can_remove_flag_offensive(answer)%}{{ pipe() }} -<span id="answer-offensive-remove-flag-{{ answer.id }}" class="offensive-flag" - title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"> - <a class="question-flag">{% trans %}remove flag{% endtrans %} - {% if request.user|can_see_offensive_flags(answer) %} - <span class="darkred">{% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %}</span> - {% endif %}</a> -</span> + <span id="answer-offensive-flag-{{ answer.id }}" class="offensive-flag" + title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"> + <a class="question-flag">{% trans %}flag offensive{% endtrans %}</a> + {% if request.user|can_see_offensive_flags(answer) %} + <span class="darkred">{% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %}</span> + {% endif %} + </span> + {% elif request.user|can_remove_flag_offensive(answer)%}{{ pipe() }} + <span id="answer-offensive-flag-remove-{{ answer.id }}" class="offensive-flag" + title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"> + <a class="question-flag">{% trans %}remove flag{% endtrans %}</a> + {% if request.user|can_see_offensive_flags(answer) %} + <span class="darkred">{% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %}</span> + {% endif %} + </span> {% endif %} - {% if request.user|can_delete_post(answer) %}{{ pipe() }} {% spaceless %} - <span class="action-link"> - <a class="question-delete" id="answer-delete-link-{{answer.id}}"> - {% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a> - </span> + <span class="action-link"> + <a class="question-delete" id="answer-delete-link-{{answer.id}}"> + {% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a> + </span> {% endspaceless %} {% endif %} {% if settings.ALLOW_SWAPPING_QUESTION_WITH_ANSWER and request.user.is_authenticated() and request.user.is_administrator_or_moderator() %}{{ pipe() }} <span class="action-link"> - <a id="swap-question-with-answer-{{answer.id}}">{% trans %}swap with question{% endtrans %}</a> - </span> + <a id="swap-question-with-answer-{{answer.id}}">{% trans %}swap with question{% endtrans %}</a> + </span> {% 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())) %} -<img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" - {% if answer.accepted() %} - src="{{'/images/vote-accepted-on.png'|media}}" - {% else %} - src="{{'/images/vote-accepted.png'|media}}" - {% endif %} - 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 %} - {% if answer.accepted() %} - <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" +{{ macros.post_vote_buttons(post = answer, visitor_vote = user_answer_votes[answer.id]) }} +<img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" {% if answer.accepted() %} - src="{{'/images/vote-accepted-on.png'|media}}" + src="{{'/images/vote-accepted-on.png'|media}}" {% else %} - src="{{'/images/vote-accepted.png'|media}}" + src="{{'/images/vote-accepted.png'|media}}" {% endif %} - 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 %} -{% 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 @@ <div class="question-status"> -<h3>{% trans close_reason=question.thread.get_close_reason_display() %}The question has been closed for the following reason <b>"{{ close_reason }}"</b> <i>by{% endtrans %} -<a href="{{ question.thread.closed_by.get_profile_url() }}">{{ question.thread.closed_by.username }}</a> </i><br> -{% trans closed_at=question.thread.closed_at %}close date {{closed_at}}{% endtrans %}</h3> + <h3>{% trans close_reason=thread.get_close_reason_display() %}The question has been closed for the following reason <b>"{{ close_reason }}"</b> <i>by{% endtrans %} + <a href="{{ thread.closed_by.get_profile_url() }}">{{ thread.closed_by.username }}</a> </i><br> + {% trans closed_at=thread.closed_at %}close date {{closed_at}}{% endtrans %}</h3> </div> 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 %}"; </script> {% endif %} -{% if question.thread.closed %} +{% if thread.closed %} {% if request.user|can_reopen_question(question) %}{{ pipe() }} - <a class="question-close" href="{% url reopen question.id %}">{% trans %}reopen{% endtrans %}</a> + <a class="question-close" href="{% url reopen question.id %}">{% trans %}reopen{% endtrans %}</a> {% endif %} {% else %} {% if request.user|can_close_question(question) %}{{ pipe() }} - <a class="question-close" href="{% url close question.id %}">{% trans %}close{% endtrans %}</a> + <a class="question-close" href="{% url close question.id %}">{% trans %}close{% endtrans %}</a> {% endif %} {% endif %} - -{% if request.user|can_remove_all_flags_offensive(question)%}{{ pipe() }} -<span id="question-offensive-remove-all-flag-{{ question.id }}" class="offensive-flag" - title="{% trans %}remove all flags{% endtrans %}"> - <a class="question-flag">{% trans %}remove all flags{% endtrans %}</a> -</span> -{%endif%} - {% if request.user|can_flag_offensive(question) %}{{ pipe() }} -<span id="question-offensive-flag-{{ question.id }}" class="offensive-flag" - title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"> - <a class="question-flag">{% trans %}flag offensive{% endtrans %} - {% if request.user|can_see_offensive_flags(question) %} - <span class="darkred">{% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %}</span> - {% endif %}</a> -</span> - -{% elif request.user|can_remove_flag_offensive(question)%}{{ pipe() }} -<span id="question-offensive-remove-flag-{{ question.id }}" class="offensive-flag" - title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"> - <a class="question-flag">{% trans %}remove flag{% endtrans %} - {% if request.user|can_see_offensive_flags(question) %} - <span class="darkred">{% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %}</span> - {% endif %}</a> -</span> - + <span id="question-offensive-flag-{{ question.id }}" class="offensive-flag" + title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"> + <a class="question-flag">{% trans %}flag offensive{% endtrans %}</a> + {% if request.user|can_see_offensive_flags(question) %} + <span class="darkred">{% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %}</span> + {% endif %} + </span> + {% elif request.user|can_remove_flag_offensive(question)%}{{ pipe() }} + <span id="question-offensive-flag-remove-{{ question.id }}" class="offensive-flag" + title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"> + <a class="question-flag">{% trans %}remove flag{% endtrans %}</a> + {% if request.user|can_see_offensive_flags(question) %} + <span class="darkred">{% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %}</span> + {% endif %} + </span> {% endif %} - {% if request.user|can_delete_post(question) %}{{ pipe() }} <a id="question-delete-link-{{question.id}}" class="question-delete">{% if question.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a> {% 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 ==== #} - <div class="vote-buttons"> - {# ==== 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 %}<g:plusone size="small" count="false"></g:plusone>{% endif %} - {# ==== END: question/share_buttons.html ==== #} - </div> - <div class="question-content"> - - <h1><a href="{{ question.get_absolute_url() }}">{{ thread.get_title(question) }}</a></h1> - {# ==== 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" #} - - <div id="question-table" {% if question.deleted %}class="deleted"{%endif%}> - <div class="question-body"> - <div class="post-update-info-container"> - {%- 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" #} - </div> - {{ question.html }} - </div> - <div id="question-controls" class="post-controls"> - {# ==== START: include "question/question_controls.html" #} - {% set pipe=joiner('<span class="sep">|</span>') %} - {% if request.user|can_edit_post(question) %}{{ pipe() }} - <a class="question-edit" href="{% url edit_question question.id %}">{% trans %}edit{% endtrans %}</a> - {% endif %} - {% if request.user|can_retag_question(question) %}{{ pipe() }} - <a id="retag" class="question-retag"href="{% url retag_question question.id %}">{% trans %}retag{% endtrans %}</a> - <script type="text/javascript"> - var retagUrl = "{% url retag_question question.id %}"; - </script> - {% endif %} - {% if thread.closed %} - {% if request.user|can_reopen_question(question) %}{{ pipe() }} - <a class="question-close" href="{% url reopen question.id %}">{% trans %}reopen{% endtrans %}</a> - {% endif %} - {% else %} - {% if request.user|can_close_question(question) %}{{ pipe() }} - <a class="question-close" href="{% url close question.id %}">{% trans %}close{% endtrans %}</a> - {% endif %} - {% endif %} - {% if request.user|can_flag_offensive(question) %}{{ pipe() }} - <span id="question-offensive-flag-{{ question.id }}" class="offensive-flag" - title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"> - <a class="question-flag">{% trans %}flag offensive{% endtrans %}</a> - {% if request.user|can_see_offensive_flags(question) %} - <span class="darkred">{% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %}</span> - {% endif %} - </span> - {% elif request.user|can_remove_flag_offensive(question)%}{{ pipe() }} - <span id="question-offensive-flag-remove-{{ question.id }}" class="offensive-flag" - title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"> - <a class="question-flag">{% trans %}remove flag{% endtrans %}</a> - {% if request.user|can_see_offensive_flags(question) %} - <span class="darkred">{% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %}</span> - {% endif %} - </span> - {% endif %} - {% if request.user|can_delete_post(question) %}{{ pipe() }} - <a id="question-delete-link-{{question.id}}" class="question-delete">{% if question.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a> - {% endif %} - {# ==== END: include "question/question_controls.html" #} - </div> - {# ==== 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 ==== #} - </div> - - </div> - <div class="clean"></div> - {# ==== END: question/question_card.html ==== #} - {% if thread.closed %} - {# ==== START: question/closed_question_info.html ==== #} - <div class="question-status"> - <h3>{% trans close_reason=thread.get_close_reason_display() %}The question has been closed for the following reason <b>"{{ close_reason }}"</b> <i>by{% endtrans %} - <a href="{{ thread.closed_by.get_profile_url() }}">{{ thread.closed_by.username }}</a> </i><br> - {% trans closed_at=thread.closed_at %}close date {{closed_at}}{% endtrans %}</h3> - </div> - {# ==== END: question/closed_question_info.html ==== #} - {% endif %} - - {% if answers %} - {# ==== START: question/answer_tab_bar.html ==== #} - <div class="tabBar tabBar-answer"> - <h2 id="questionCount"> - {% trans counter=answers|length %} - {{counter}} Answer - {% pluralize %} - {{counter}} Answers - {% endtrans %} - </h2> - <div class="tabsA"> - <span class="label"> - Sort by » - </span> - <a id="oldest" href="{{ question.get_absolute_url() }}?sort=oldest#sort-top" - title="{% trans %}oldest answers will be shown first{% endtrans %}" - ><span>{% trans %}oldest answers{% endtrans %}</span></a> - <a id="latest" href="{{ question.get_absolute_url() }}?sort=latest#sort-top" - title="{% trans %}newest answers will be shown first{% endtrans %}" - ><span>{% trans %}newest answers{% endtrans %}</span></a> - <a id="votes" href="{{ question.get_absolute_url() }}?sort=votes#sort-top" - title="{% trans %}most voted answers will be shown first{% endtrans %}" - ><span>{% trans %}popular answers{% endtrans %}</span></a> - </div> - </div> - <div class="clean"></div> - {# ==== END: question/answer_tab_bar.html ==== #} - - {{ macros.paginator(paginator_context) }} - <div class="clean"></div> - - {% for answer in answers %} - {# ==== START: question/answer_card.html ==== #} - <a name="{{ answer.id }}"></a> - {% if answer.old_answer_id %} - {# Make old URL anchors/hashes work #} - <a class="old_answer_id_anchor" name="{{ answer.old_answer_id }}"></a> - {% endif %} - <div - id="answer-container-{{ answer.id }}" - class="{{ macros.answer_classes(answer, question) }}"> - <div class="vote-buttons"> - {# ==== START: question/answer_vote_buttons.html ==== #} - {{ macros.post_vote_buttons(post = answer, visitor_vote = user_answer_votes[answer.id]) }} - <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" - {% if answer.accepted() %} - src="{{'/images/vote-accepted-on.png'|media}}" - {% else %} - src="{{'/images/vote-accepted.png'|media}}" - {% 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 %} - /> - {# ==== END: question/answer_vote_buttons.html ==== #} - </div> - <div class="answer-table"> - - <div class="item-right"> - <div class="answer-body"> - <div class="post-update-info-container"> - {{ 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 ==== #} - </div> - {{ answer.html }} - </div> - <div class="answer-controls post-controls"> - {# ==== START: question/answer_controls.html ==== #} - {% set pipe=joiner('<span class="sep">|</span>') %} - <span class="linksopt">{{ pipe() }} - <a class="permant-link" - href="{{ answer.get_absolute_url(question_post=question) }}" - title="{% trans %}answer permanent link{% endtrans %}"> - {% trans %}permanent link{% endtrans %} - </a> - </span> - - {% if request.user|can_edit_post(answer) %}{{ pipe() }} - <span class="action-link"><a class="question-edit" href="{% url edit_answer answer.id %}">{% trans %}edit{% endtrans %}</a></span> - {% endif %} - {% if request.user|can_flag_offensive(answer) %}{{ pipe() }} - <span id="answer-offensive-flag-{{ answer.id }}" class="offensive-flag" - title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"> - <a class="question-flag">{% trans %}flag offensive{% endtrans %}</a> - {% if request.user|can_see_offensive_flags(answer) %} - <span class="darkred">{% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %}</span> - {% endif %} - </span> - {% elif request.user|can_remove_flag_offensive(answer)%}{{ pipe() }} - <span id="answer-offensive-flag-remove-{{ answer.id }}" class="offensive-flag" - title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"> - <a class="question-flag">{% trans %}remove flag{% endtrans %}</a> - {% if request.user|can_see_offensive_flags(answer) %} - <span class="darkred">{% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %}</span> - {% endif %} - </span> - {% endif %} - {% if request.user|can_delete_post(answer) %}{{ pipe() }} - {% spaceless %} - <span class="action-link"> - <a class="question-delete" id="answer-delete-link-{{answer.id}}"> - {% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a> - </span> - {% endspaceless %} - {% endif %} - {% if settings.ALLOW_SWAPPING_QUESTION_WITH_ANSWER and request.user.is_authenticated() and request.user.is_administrator_or_moderator() %}{{ pipe() }} - <span class="action-link"> - <a id="swap-question-with-answer-{{answer.id}}">{% trans %}swap with question{% endtrans %}</a> - </span> - {% endif %} - - {# ==== END: question/answer_controls.html ==== #} - </div> - {# ==== 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 ==== #} - </div> - </div> - <div class="clean"></div> - </div> - <div class="clean"></div> - {# ==== END: question/answer_card.html ==== #} - {% endfor %} - {{ macros.paginator(paginator_context) }} - <div class="clean"></div> - {% else %} - {# ==== START: question/sharing_prompt_phrase.html ==== #} - {% set question_url=settings.APP_URL+question.get_absolute_url()|urlencode %} - <h2 class="share-question">{% trans %}Know someone who can answer? Share a <a href="{{ question_url }}">link</a> 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 %} - <a href="mailto:?subject={{ settings.APP_SHORT_NAME|urlencode }}&body={{ question_url }}">{% trans %}email{% endtrans %}</a>. - </h2> - {# ==== END: question/sharing_prompt_phrase.html ==== #} - {% endif %} - - {# ==== START: question/new_answer_form.html ==== #} - <form - id="fmanswer" - {% if user == question.author %}style="display:none"{% endif %} - action="{% url answer question.id %}" - method="post" - >{% csrf_token %} - {# ==== START: question/subscribe_by_email_prompt.html ==== #} - {% if request.user.is_authenticated() %} - <p> - {{ answer.email_notify }} - <label for="question-subscribe-updates"> - {% set email_feed_frequency = request.user.get_followed_question_alert_frequency() %} - {% if email_feed_frequency =='n' %} - {% trans %}Notify me once a day when there are any new answers{% endtrans %} - {% elif email_feed_frequency =='d' %} - {% trans %}Notify me once a day when there are any new answers{% endtrans %} - {% elif email_feed_frequency =='w' %} - {% trans %}Notify me weekly when there are any new answers{% endtrans %} - {% elif email_feed_frequency =='i' %} - {% trans %}Notify me immediately when there are any new answers{% endtrans %} - {% endif %} - </label> - {% trans profile_url=request.user.get_profile_url() %}You can always adjust frequency of email updates from your {{profile_url}}{% endtrans %} - </p> - {% else %} - <p> - {{ answer.email_notify }} - <label>{% trans %}once you sign in you will be able to subscribe for any updates here{% endtrans %}</label> - </p> - {% endif %} - {# ==== END: question/subscribe_by_email_prompt.html ==== #} - <div style="clear:both"></div> - {% if request.user.is_anonymous() and settings.ALLOW_POSTING_BEFORE_LOGGING_IN == False %} - {% if not thread.closed %} - <a - class="submit" - href="{{settings.LOGIN_URL}}?next={% url question question.id %}" - >{% trans %}Login/Signup to Answer{% endtrans %}</a> - {% endif %} - {% else %} - {% if not thread.closed %} - <div> - {% spaceless %} - <h2> - {% if answers %} - {% trans %}Your answer{% endtrans %} - {% else %} - {% trans %}Be the first one to answer this question!{% endtrans %} - {% endif %} - </h2> - {% endspaceless %} - </div> - {% if request.user.is_anonymous() %} - <div class="message">{% trans %}you can answer anonymously and then login{% endtrans %}</div> - {% else %} - <p class="message"> - {% 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 %} - </p> - {% endif %} - {{ macros.edit_post(answer) }} - <input type="submit" - {% if user.is_anonymous() %} - value="{% trans %}Login/Signup to Post Your Answer{% endtrans %}" - {% else %} - {% if user == question.author %} - value="{% trans %}Answer Your Own Question{% endtrans %}" - {% else %} - value="{% trans %}Answer the question{% endtrans %}" - {% endif %} - {% endif %} - class="submit after-editor" style="float:left"/> - {% if settings.WIKI_ON %} - {{ macros.checkbox_in_div(answer.wiki) }} - {% endif %} - {% endif %} - {% endif %} - </form> - {# ==== END: question/new_answer_form.html ==== #} - {% if request.user == question.author %}{# this is outside the form on purpose #} - <input type="button" class="submit after-editor" id="fmanswer_button" value="{% trans %}Answer Your Own Question{% endtrans %}"/> - {%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 @@ <a name="{{ answer.id }}"></a> -<div - id="answer-container-{{ answer.id }}" - class="{{ macros.answer_classes(answer, question) }}"> +{% if answer.old_answer_id %} + {# Make old URL anchors/hashes work #} + <a class="old_answer_id_anchor" name="{{ answer.old_answer_id }}"></a> +{% endif %} +<div + id="answer-container-{{ answer.id }}" + class="{{ macros.answer_classes(answer, question) }}"> <div class="vote-buttons"> + {# ==== START: question/answer_vote_buttons.html ==== #} {% include "question/answer_vote_buttons.html" %} + {# ==== END: question/answer_vote_buttons.html ==== #} </div> <div class="answer-table"> <div class="item-right"> <div class="answer-body"> <div class="post-update-info-container"> + {# ==== START: question/answer_author_info.html ==== #} {% include "question/answer_author_info.html" %} + {# ==== END: question/answer_author_info.html ==== #} </div> {{ answer.html }} </div> <div class="answer-controls post-controls"> - {% include "question/answer_controls.html" %} + {# ==== START: question/answer_controls.html ==== #} + {% include "question/answer_controls.html" %} + {# ==== END: question/answer_controls.html ==== #} </div> + {# ==== START: question/answer_comments.html ==== #} {% include "question/answer_comments.html" %} + {# ==== END: question/answer_comments.html ==== #} </div> </div> <div class="clean"></div> 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 @@ <div class="tabBar tabBar-answer"> <h2 id="questionCount"> {% trans counter=answers|length %} - {{counter}} Answer - {% pluralize %} - {{counter}} Answers + {{counter}} Answer + {% pluralize %} + {{counter}} Answers {% endtrans %} </h2> <div class="tabsA"> - <span class="label"> - Sort by » - </span> - <a id="oldest" href="{{ question.get_absolute_url() }}?sort=oldest#sort-top" - title="{% trans %}oldest answers will be shown first{% endtrans %}" - ><span>{% trans %}oldest answers{% endtrans %}</span></a> - <a id="latest" href="{{ question.get_absolute_url() }}?sort=latest#sort-top" - title="{% trans %}newest answers will be shown first{% endtrans %}" - ><span>{% trans %}newest answers{% endtrans %}</span></a> - <a id="votes" href="{{ question.get_absolute_url() }}?sort=votes#sort-top" - title="{% trans %}most voted answers will be shown first{% endtrans %}" - ><span>{% trans %}popular answers{% endtrans %}</span></a> + <span class="label"> + Sort by » + </span> + <a id="oldest" href="{{ question.get_absolute_url() }}?sort=oldest#sort-top" + title="{% trans %}oldest answers will be shown first{% endtrans %}" + ><span>{% trans %}oldest answers{% endtrans %}</span></a> + <a id="latest" href="{{ question.get_absolute_url() }}?sort=latest#sort-top" + title="{% trans %}newest answers will be shown first{% endtrans %}" + ><span>{% trans %}newest answers{% endtrans %}</span></a> + <a id="votes" href="{{ question.get_absolute_url() }}?sort=votes#sort-top" + title="{% trans %}most voted answers will be shown first{% endtrans %}" + ><span>{% trans %}popular answers{% endtrans %}</span></a> </div> </div> -<div class="clean"></div> 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 %} + <div class="clean"></div> + + {# ==== START: question/answer_tab_bar.html ==== #} {% include "question/answer_tab_bar.html" %} + {# ==== END: question/answer_tab_bar.html ==== #} + + <div class="clean"></div> {{ macros.paginator(paginator_context) }} <div class="clean"></div> + {% for answer in answers %} + {# ==== START: question/answer_card.html ==== #} {% include "question/answer_card.html" %} + {# ==== END: question/answer_card.html ==== #} {% endfor %} {{ macros.paginator(paginator_context) }} <div class="clean"></div> {% 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 #} - <input type="button" class="submit after-editor" id="fmanswer_button" value="{% trans %}Answer Your Own Question{% endtrans %}"/> - {%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 #} + <input type="button" class="submit after-editor" id="fmanswer_button" value="{% trans %}Answer Your Own Question{% endtrans %}"/> +{%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 @@ -<form - id="fmanswer" - {% if user == question.author %}style="display:none"{% endif %} - action="{% url answer question.id %}" - method="post" ->{% csrf_token %} +<form + id="fmanswer" + {% if user == question.author %}style="display:none"{% endif %} + action="{% url answer question.id %}" + method="post" + >{% csrf_token %} + {# ==== START: question/subscribe_by_email_prompt.html ==== #} {% include "question/subscribe_by_email_prompt.html" %} + {# ==== END: question/subscribe_by_email_prompt.html ==== #} <div style="clear:both"></div> {% if request.user.is_anonymous() and settings.ALLOW_POSTING_BEFORE_LOGGING_IN == False %} - {% if not question.thread.closed %} - <a - class="submit" - href="{{settings.LOGIN_URL}}?next={% url question question.id %}" - >{% trans %}Login/Signup to Answer{% endtrans %}</a> + {% if not thread.closed %} + <a + class="submit" + href="{{settings.LOGIN_URL}}?next={% url question question.id %}" + >{% trans %}Login/Signup to Answer{% endtrans %}</a> {% endif %} {% else %} - {% if not question.thread.closed %} + {% if not thread.closed %} <div> {% spaceless %} - <h2> - {% if answers %} - {% trans %}Your answer{% endtrans %} - {% else %} - {% trans %}Be the first one to answer this question!{% endtrans %} - {% endif %} - </h2> + <h2> + {% if answers %} + {% trans %}Your answer{% endtrans %} + {% else %} + {% trans %}Be the first one to answer this question!{% endtrans %} + {% endif %} + </h2> {% endspaceless %} </div> {% if request.user.is_anonymous() %} @@ -38,17 +40,17 @@ </p> {% endif %} {{ macros.edit_post(answer) }} - <input type="submit" - {% if user.is_anonymous() %} - value="{% trans %}Login/Signup to Post Your Answer{% endtrans %}" - {% else %} - {% if user == question.author %} - value="{% trans %}Answer Your Own Question{% endtrans %}" + <input type="submit" + {% if user.is_anonymous() %} + value="{% trans %}Login/Signup to Post Your Answer{% endtrans %}" {% else %} - value="{% trans %}Answer the question{% endtrans %}" + {% if user == question.author %} + value="{% trans %}Answer Your Own Question{% endtrans %}" + {% else %} + value="{% trans %}Answer the question{% endtrans %}" + {% endif %} {% endif %} - {% endif %} - class="submit after-editor" style="float:left"/> + 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 @@ + <div class="vote-buttons"> - {% 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 ==== #} </div> <div class="question-content"> - <h1><a href="{{ question.get_absolute_url() }}">{{ question.get_question_title() }}</a></h1> + <h1><a href="{{ question.get_absolute_url() }}">{{ thread.get_title(question) }}</a></h1> + {# ==== START: question/question_tags.html" #} {% include "question/question_tags.html" %} + {# ==== END: question/question_tags.html" #} + <div id="question-table" {% if question.deleted %}class="deleted"{%endif%}> <div class="question-body"> <div class="post-update-info-container"> + {# ==== START: "question/question_author_info.html" #} {% include "question/question_author_info.html" %} + {# ==== END: "question/question_author_info.html" #} </div> - {{question.html}} + {{ question.html }} </div> <div id="question-controls" class="post-controls"> + {# ==== START: include "question/question_controls.html" #} {% include "question/question_controls.html" %} + {# ==== END: include "question/question_controls.html" #} </div> + {# ==== START: question/question_comments.html ==== #} {% include "question/question_comments.html" %} + {# ==== END: question/question_comments.html ==== #} </div> + </div> <div class="clean"></div> 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() %} <p> - {{ answer.email_notify }} + {{ answer.email_notify }} <label for="question-subscribe-updates"> {% set email_feed_frequency = request.user.get_followed_question_alert_frequency() %} {% if email_feed_frequency =='n' %} {% trans %}Notify me once a day when there are any new answers{% endtrans %} - {% elif email_feed_frequency =='d' %} + {% elif email_feed_frequency =='d' %} {% trans %}Notify me once a day when there are any new answers{% endtrans %} - {% elif email_feed_frequency =='w' %} + {% elif email_feed_frequency =='w' %} {% trans %}Notify me weekly when there are any new answers{% endtrans %} - {% elif email_feed_frequency =='i' %} + {% elif email_feed_frequency =='i' %} {% trans %}Notify me immediately when there are any new answers{% endtrans %} {% endif %} </label> @@ -17,7 +17,7 @@ </p> {% else %} <p> - {{ answer.email_notify }} + {{ answer.email_notify }} <label>{% trans %}once you sign in you will be able to subscribe for any updates here{% endtrans %}</label> </p> {% endif %} |