From d50a7904db62ba161eea6249e2277fb4bb99c4d2 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 21 Feb 2013 19:00:48 -0300 Subject: added space for display ad after the first answer --- askbot/conf/sidebar_question.py | 15 +++++++++++++++ askbot/templates/question.html | 2 +- askbot/templates/question/content.html | 13 ++++--------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/askbot/conf/sidebar_question.py b/askbot/conf/sidebar_question.py index feebf896..ffe2f783 100644 --- a/askbot/conf/sidebar_question.py +++ b/askbot/conf/sidebar_question.py @@ -26,6 +26,21 @@ settings.register( ) ) +settings.register( + values.LongStringValue( + SIDEBAR_QUESTION, + 'QUESTION_PAGE_ANSWER_BANNER', + description = _('Answers banner'), + default = '', + help_text = _( + 'This banner will show above the second answer. ' + 'When using this option, please ' + 'use the HTML validation service to make sure that ' + 'your input is valid and works well in all browsers.' + ) + ) +) + settings.register( values.LongStringValue( SIDEBAR_QUESTION, diff --git a/askbot/templates/question.html b/askbot/templates/question.html index 5a317707..e2e6f394 100644 --- a/askbot/templates/question.html +++ b/askbot/templates/question.html @@ -209,7 +209,7 @@ {% endblock %} {% block content %}
- {{ settings.QUESTION_PAGE_TOP_BANNER }} + {{ settings.QUESTION_PAGE_TOP_BANNER|safe }}
{% if is_cacheable %} {% cache long_time "thread-content-html" thread.id %} diff --git a/askbot/templates/question/content.html b/askbot/templates/question/content.html index 66b3014b..7efc1d54 100644 --- a/askbot/templates/question/content.html +++ b/askbot/templates/question/content.html @@ -1,34 +1,29 @@ {% import "macros.html" as macros %} -{# ==== BEGIN: question/question_card.html ==== #} {% include "question/question_card.html" %} -{# ==== END: question/question_card.html ==== #} {% if answers %}
- {# ==== START: question/answer_tab_bar.html ==== #} {% include "question/answer_tab_bar.html" %} - {# ==== END: question/answer_tab_bar.html ==== #}
{{ macros.paginator(paginator_context, anchor='#sort-top') }}
{% for answer in answers %} - {# ==== START: question/answer_card.html ==== #} + {% if answers|length > 1 and loop.index == 2 %} + {{ settings.QUESTION_PAGE_ANSWER_BANNER|safe }} + {% endif %} {% include "question/answer_card.html" %} - {# ==== END: question/answer_card.html ==== #} {% endfor %} + {{ macros.paginator(paginator_context, anchor='#sort-top') }}
{% else %} - {# ==== START: question/sharing_prompt_phrase.html ==== #} {% include "question/sharing_prompt_phrase.html" %} - {# ==== END: question/sharing_prompt_phrase.html ==== #} {% endif %} -{# ==== START: question/new_answer_form.html ==== #} {# buttons below cannot be cached yet #} {% if user_already_gave_answer %}