diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-08-03 15:55:50 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-08-03 15:55:50 -0400 |
commit | fa8bae9a208914465f7c099ad6bfbe1a3d0c9ca8 (patch) | |
tree | 179df9b5defa81c78e371749406cf79202cbc430 | |
parent | 5b0bac82d46c7a948775b69635ab58f4446d7e1b (diff) | |
download | askbot-fa8bae9a208914465f7c099ad6bfbe1a3d0c9ca8.tar.gz askbot-fa8bae9a208914465f7c099ad6bfbe1a3d0c9ca8.tar.bz2 askbot-fa8bae9a208914465f7c099ad6bfbe1a3d0c9ca8.zip |
option to always show answer banner
-rw-r--r-- | askbot/conf/sidebar_question.py | 11 | ||||
-rw-r--r-- | askbot/templates/question/content.html | 9 |
2 files changed, 17 insertions, 3 deletions
diff --git a/askbot/conf/sidebar_question.py b/askbot/conf/sidebar_question.py index 8d38692a..fbd6b19e 100644 --- a/askbot/conf/sidebar_question.py +++ b/askbot/conf/sidebar_question.py @@ -42,7 +42,7 @@ settings.register( description = _('Answers banner'), default = '', help_text = _( - 'This banner will show above the second answer. ' + 'This banner will show under the first 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.' @@ -59,6 +59,15 @@ settings.register( ) ) +settings.register( + values.BooleanValue( + SIDEBAR_QUESTION, + 'QUESTION_PAGE_ALWAYS_SHOW_ANSWER_BANNER', + default=False, + description=_('Show answers banner even if there are no answers') + ) +) + settings.register( values.LongStringValue( diff --git a/askbot/templates/question/content.html b/askbot/templates/question/content.html index c8fef9a6..6a73ebef 100644 --- a/askbot/templates/question/content.html +++ b/askbot/templates/question/content.html @@ -12,14 +12,19 @@ <div class="clean"></div> {% for answer in answers %} - {% if loop.index == 2 and 'QUESTION_PAGE_ANSWER_BANNER'|show_block_to(request.user) %} + {% include "question/answer_card.html" %} + {% if loop.index == 1 and 'QUESTION_PAGE_ANSWER_BANNER'|show_block_to(request.user) %} <div class="banner">{{ settings.QUESTION_PAGE_ANSWER_BANNER|safe }}</div> {% endif %} - {% include "question/answer_card.html" %} {% endfor %} {{ macros.paginator(paginator_context, anchor='#sort-top') }} <div class="clean"></div> +{% elif settings.QUESTION_PAGE_ALWAYS_SHOW_ANSWER_BANNER %} + <div class="clearfix"></div> + {% if 'QUESTION_PAGE_ANSWER_BANNER'|show_block_to(request.user) %} + <div class="banner">{{ settings.QUESTION_PAGE_ANSWER_BANNER|safe }}</div> + {% endif %} {% endif %} {# buttons below cannot be cached yet #} |