summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-02-21 19:00:48 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-02-21 19:00:48 -0300
commitd50a7904db62ba161eea6249e2277fb4bb99c4d2 (patch)
tree89e11e4b2d3512b7c7b86cce15e4b668203f82da
parent0b05b5bd15591f0795992787252d9dc5d9a9aab5 (diff)
downloadaskbot-d50a7904db62ba161eea6249e2277fb4bb99c4d2.tar.gz
askbot-d50a7904db62ba161eea6249e2277fb4bb99c4d2.tar.bz2
askbot-d50a7904db62ba161eea6249e2277fb4bb99c4d2.zip
added space for display ad after the first answer
-rw-r--r--askbot/conf/sidebar_question.py15
-rw-r--r--askbot/templates/question.html2
-rw-r--r--askbot/templates/question/content.html13
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
@@ -29,6 +29,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,
'SIDEBAR_QUESTION_HEADER',
description = _('Custom sidebar header'),
default = '',
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 %}
<div>
- {{ settings.QUESTION_PAGE_TOP_BANNER }}
+ {{ settings.QUESTION_PAGE_TOP_BANNER|safe }}
</div>
{% 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 %}
<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, anchor='#sort-top') }}
<div class="clean"></div>
{% 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') }}
<div class="clean"></div>
{% 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 %}
<a