summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-04-11 00:33:18 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-04-11 00:33:18 -0400
commit744240d5fd7c67764ba61a2e4b2204dc3320a6bb (patch)
tree9c331d8386747fd6e86792c3164e94e2373fd452
parent7377d4b06d4f5c6ce7823ee016e26b4718a8b2a3 (diff)
downloadaskbot-744240d5fd7c67764ba61a2e4b2204dc3320a6bb.tar.gz
askbot-744240d5fd7c67764ba61a2e4b2204dc3320a6bb.tar.bz2
askbot-744240d5fd7c67764ba61a2e4b2204dc3320a6bb.zip
enable/disable accepted answer feature
-rw-r--r--askbot/conf/forum_data_rules.py9
-rw-r--r--askbot/doc/source/changelog.rst2
-rw-r--r--askbot/templates/question/answer_vote_buttons.html2
-rw-r--r--askbot/views/commands.py2
4 files changed, 15 insertions, 0 deletions
diff --git a/askbot/conf/forum_data_rules.py b/askbot/conf/forum_data_rules.py
index 362f4735..28a1b7b4 100644
--- a/askbot/conf/forum_data_rules.py
+++ b/askbot/conf/forum_data_rules.py
@@ -178,6 +178,15 @@ settings.register(
settings.register(
livesettings.BooleanValue(
FORUM_DATA_RULES,
+ 'ACCEPTING_ANSWERS_ENABLED',
+ default=True,
+ description = _('Enable accepting best answer')
+ )
+)
+
+settings.register(
+ livesettings.BooleanValue(
+ FORUM_DATA_RULES,
'TAGS_ARE_REQUIRED',
description = _('Are tags required?'),
default = False,
diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst
index 0d5981c6..51c5c5cd 100644
--- a/askbot/doc/source/changelog.rst
+++ b/askbot/doc/source/changelog.rst
@@ -3,6 +3,8 @@ Changes in Askbot
Development version
-------------------
+* Disable/enable best answer feature
+* Allowed post owners repost answers and comments (this used to be mod-only function).
* Answer editor is "folded" by default. Editor buttons and options show on click.
* Management command `askbot_import_jive` to import data from Jive forums.
* Added possibility to choose editor for comments: plain text, or same as
diff --git a/askbot/templates/question/answer_vote_buttons.html b/askbot/templates/question/answer_vote_buttons.html
index 242bf2be..cd6f62f0 100644
--- a/askbot/templates/question/answer_vote_buttons.html
+++ b/askbot/templates/question/answer_vote_buttons.html
@@ -1,4 +1,5 @@
{{ macros.post_vote_buttons(post = answer) }}
+{% if settings.ACCEPTING_ANSWERS_ENABLED %}
<div
id="answer-img-accept-{{ answer.id }}"
class="answer-img-accept"
@@ -8,3 +9,4 @@
title="{% trans %}mark this answer as correct (click again to undo){% endtrans %}"
{% endif %}
></div>
+{% endif %}
diff --git a/askbot/views/commands.py b/askbot/views/commands.py
index 133ef70e..b7642440 100644
--- a/askbot/views/commands.py
+++ b/askbot/views/commands.py
@@ -263,6 +263,8 @@ def vote(request, id):
raise Exception(_('Sorry, something is not right here...'))
if vote_type == '0':
+ if askbot_settings.ACCEPTING_ANSWERS_ENABLED is False:
+ return
if request.user.is_authenticated():
answer_id = request.POST.get('postId')
answer = get_object_or_404(models.Post, post_type='answer', id = answer_id)