summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2014-09-18 16:28:05 +0700
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2014-09-18 16:28:05 +0700
commitc999b3089cb40d539c77f7928e20dea83ddb32c0 (patch)
tree1350c5107a9e07ee1d28350631aafbb3999a3932
parentd1cae4076a8d83c0b7cdfe53a22688ddc4c5ad46 (diff)
parentfcfc2c05917a0a2b452fb298eede8bb4cf5108d6 (diff)
downloadaskbot-c999b3089cb40d539c77f7928e20dea83ddb32c0.tar.gz
askbot-c999b3089cb40d539c77f7928e20dea83ddb32c0.tar.bz2
askbot-c999b3089cb40d539c77f7928e20dea83ddb32c0.zip
Merge pull request #311 from keto/wiki-edit-fix
Respect the wiki edit reputation limit
-rw-r--r--askbot/templates/question.html8
-rw-r--r--askbot/templates/question/answer_controls.html2
-rw-r--r--askbot/templates/question/question_controls.html2
3 files changed, 6 insertions, 6 deletions
diff --git a/askbot/templates/question.html b/askbot/templates/question.html
index 1557eb38..6d5df517 100644
--- a/askbot/templates/question.html
+++ b/askbot/templates/question.html
@@ -202,7 +202,7 @@
};
- function render_post_controls(post_id){
+ function render_post_controls(post_id, is_wiki){
//in this case remove all post controls
if (askbot['settings']['readOnlyModeEnabled'] === true) {
@@ -246,10 +246,10 @@
) {
removeNode(closeBtn[0]);
}
-
- var repLow = (data['userReputation'] < {{settings.MIN_REP_TO_EDIT_OTHERS_POSTS}});
+ var enoughRep = (data['userReputation'] >= {{settings.MIN_REP_TO_EDIT_OTHERS_POSTS}} ||
+ (is_wiki && data['userReputation'] >= {{ settings.MIN_REP_TO_EDIT_WIKI }}));
if (//maybe remove "edit" button
- repLow || data['userIsReadOnly']//only authors edit comments
+ !enoughRep || data['userIsReadOnly']//only authors edit comments
){
var edit_btn = document.getElementById(
'post-' + post_id + '-edit'
diff --git a/askbot/templates/question/answer_controls.html b/askbot/templates/question/answer_controls.html
index 022287a1..e4993c2b 100644
--- a/askbot/templates/question/answer_controls.html
+++ b/askbot/templates/question/answer_controls.html
@@ -93,5 +93,5 @@
<script type="text/javascript">
askbot['functions']['hideConvertAnswerLinks']('{{ answer.id }}');
askbot['functions']['hidePublishAnswerLink']('{{ answer.id }}');
- askbot['functions']['renderPostControls']('{{ answer.id }}');
+ askbot['functions']['renderPostControls']('{{ answer.id }}'{{ ', true' if answer.wiki }});
</script>
diff --git a/askbot/templates/question/question_controls.html b/askbot/templates/question/question_controls.html
index e38157c2..5ebb7a44 100644
--- a/askbot/templates/question/question_controls.html
+++ b/askbot/templates/question/question_controls.html
@@ -36,5 +36,5 @@
class="question-delete"
>{% if question.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a>
<script type="text/javascript">
- askbot['functions']['renderPostControls']('{{question.id}}');
+ askbot['functions']['renderPostControls']('{{question.id}}'{{ ', true' if question.wiki }});
</script>