diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-05-06 20:54:07 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-05-06 20:54:07 -0400 |
commit | a26bca9638a5fe77f5e833738386e6805a177744 (patch) | |
tree | 442ef27cfe9c4deadc29295e069e2bcac3c7e6de /askbot/templates | |
parent | cf3605b7c0a86e799077f440e97645b22a69b8a0 (diff) | |
download | askbot-a26bca9638a5fe77f5e833738386e6805a177744.tar.gz askbot-a26bca9638a5fe77f5e833738386e6805a177744.tar.bz2 askbot-a26bca9638a5fe77f5e833738386e6805a177744.zip |
restricted comment edits only to post owners and mods/admins
Diffstat (limited to 'askbot/templates')
-rw-r--r-- | askbot/templates/question.html | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/askbot/templates/question.html b/askbot/templates/question.html index 3364cc2f..9a508a2f 100644 --- a/askbot/templates/question.html +++ b/askbot/templates/question.html @@ -62,6 +62,13 @@ return null; }; + var postIsComment = function(postId) { + if (document.getElementById('comment-' + postId)) { + return true; + } + return false; + }; + var removeNode = function(node) { node.parentNode.removeChild(node); }; @@ -186,9 +193,9 @@ ) { removeNode(closeBtn[0]); } + var repLow = (data['userReputation'] < {{settings.MIN_REP_TO_EDIT_OTHERS_POSTS}}); if (//maybe remove "edit" button - data['userReputation'] < - {{settings.MIN_REP_TO_EDIT_OTHERS_POSTS}} + repLow || postIsComment(post_id)//only authors edit comments ){ var edit_btn = document.getElementById( 'post-' + post_id + '-edit' |