summaryrefslogtreecommitdiffstats
path: root/askbot/templates/question.html
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-03-04 15:32:20 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-03-04 15:32:20 -0300
commit13062a447a038fbe5c7cd8ea20887d96c1c37681 (patch)
tree5cc4bb40f212b70c8a0110756c77dc1b9dee37d9 /askbot/templates/question.html
parentcec681f1b4551e3d8588cf2d22e4eae3a8c08b66 (diff)
downloadaskbot-13062a447a038fbe5c7cd8ea20887d96c1c37681.tar.gz
askbot-13062a447a038fbe5c7cd8ea20887d96c1c37681.tar.bz2
askbot-13062a447a038fbe5c7cd8ea20887d96c1c37681.zip
improved comment posting works for tinymce editor
Diffstat (limited to 'askbot/templates/question.html')
-rw-r--r--askbot/templates/question.html56
1 files changed, 12 insertions, 44 deletions
diff --git a/askbot/templates/question.html b/askbot/templates/question.html
index e2e6f394..b3610bd0 100644
--- a/askbot/templates/question.html
+++ b/askbot/templates/question.html
@@ -87,12 +87,11 @@
if (data['userIsAdminOrMod']){
return;//all remaining functions stay on
}
- if (data['user_posts'] === undefined) {
- return;
- }
- if (post_id in data['user_posts']){
- //todo: remove edit button from older comments
- return;//same here
+ if (data['user_posts'] !== undefined) {
+ if (post_id in data['user_posts']){
+ //todo: remove edit button from older comments
+ return;//same here
+ }
}
if (//maybe remove "delete" button
data['userReputation'] <
@@ -117,52 +116,21 @@
{{settings.MIN_REP_TO_RETAG_OTHERS_QUESTIONS}}
){
var retag_btn = document.getElementById('retag');
- retag_btn.parentNode.removeChild(retag_btn);
+ if (retag_btn) {
+ retag_btn.parentNode.removeChild(retag_btn);
+ }
}
}
function render_add_comment_button(post_id, extra_comment_count){
- var can_add = false;
- if (data['user_posts'] === undefined) {
- return;
- }
- {% if user_can_post_comment %}
- can_add = true;
- {% else %}
- if (data['user_posts'] && post_id in data['user_posts']){
- can_add = true;
- }
- {% endif %}
- var add_comment_btn = document.getElementById(
- 'add-comment-to-post-' + post_id
- );
- if (can_add === false){
- add_comment_btn.parentNode.removeChild(add_comment_btn);
- return;
- }
-
- var text = '';
if (extra_comment_count > 0){
- if (can_add){
- text =
- "{% trans %}post a comment / <strong>some</strong> more{% endtrans %}";
- } else {
- text =
- "{% trans %}see <strong>some</strong> more{% endtrans%}";
- }
+ var text = "{% trans %}see more comments{% endtrans%}";
} else {
- if (can_add){
- text = "{% trans %}post a comment{% endtrans %}";
- }
+ var text = "{% trans %}post a comment{% endtrans %}";
}
+ var add_comment_btn = document.getElementById('add-comment-to-post-' + post_id);
add_comment_btn.innerHTML = text;
- //add the count
- for (node in add_comment_btn.childNodes){
- if (node.nodeName === 'strong'){
- node.innerHTML = extra_comment_count;
- break;
- }
- }
}
+
function render_add_answer_button(){
var add_answer_btn = document.getElementById('add-answer-btn');
if (askbot['data']['userIsAuthenticated']){