diff options
Diffstat (limited to 'askbot/skins/common/templates')
4 files changed, 33 insertions, 45 deletions
diff --git a/askbot/skins/common/templates/question/answer_controls.html b/askbot/skins/common/templates/question/answer_controls.html index fd12c856..091572af 100644 --- a/askbot/skins/common/templates/question/answer_controls.html +++ b/askbot/skins/common/templates/question/answer_controls.html @@ -8,26 +8,18 @@ {% trans %}link{% endtrans %} </a> </span> -{% if request.user.is_authenticated() and - ( - request.user == answer.author or - request.user.is_administrator_or_moderator() - ) -%} -<span class="action-link delete-post"> +<span id='delete-answer-{{answer.id}}' class="action-link delete-post"> <a class="question-delete" >{% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a> </span> +{% if answer.offensive_flag_count > 0 %} <span - id="answer-offensive-flag-{{ answer.id }}" + id="answer-offensive-remove-flag-{{ answer.id }}" class="action-link offensive-flag" - title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}" + title="{% trans %}remove offensive flag{% endtrans %}" > - <a class="question-flag">{% trans %}flag offensive{% endtrans %} - <span class="darkred">{% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %}</span> - </a> + <a class="question-flag">{% trans %}remove flag{% endtrans %}</a> </span> -{% if answer.offensive_flag_count > 0 %} <span id="answer-offensive-flag-{{ answer.id }}" class="action-link offensive-flag" @@ -36,13 +28,6 @@ <a class="question-flag">{% trans %}flag offensive{% endtrans %} ({{ answer.offensive_flag_count }})</a> </a> </span> -<span - id="answer-offensive-flag-remove-{{ answer.id }}" - class="action-link offensive-flag" - title="{% trans %}remove offensive flag{% endtrans %}" -> - <a class="question-flag">{% trans %}remove flag{% endtrans %} ({{ answer.offensive_flag_count }})</a> -</span> {% else %} <span id="answer-offensive-flag-{{ answer.id }}" @@ -52,7 +37,20 @@ <a class="question-flag">{% trans %}flag offensive{% endtrans %}</a> </span> {% endif %} -<span class="action-link"> +<span id='edit-answer-{{answer.id}}' class="action-link"> <a class="question-edit" href="{% url edit_answer answer.id %}">{% trans %}edit{% endtrans %}</a> </span> -{% endif %} +<script type="text/javascript"> + (function(){ + var del_link = document.getElementById( + 'delete-answer-' + '{{answer.id}}' + ); + var edit_link = document.getElementById( + 'edit-answer-' + '{{answer.id}}' + ); + if (askbot['data']['userIsAuthenticated'] === false){ + del_link.parentNode.removeChild(del_link); + edit_link.parentNode.removeChild(edit_link); + } + })(); +</script> diff --git a/askbot/skins/common/templates/question/answer_vote_buttons.html b/askbot/skins/common/templates/question/answer_vote_buttons.html index 9097fec2..242bf2be 100644 --- a/askbot/skins/common/templates/question/answer_vote_buttons.html +++ b/askbot/skins/common/templates/question/answer_vote_buttons.html @@ -1,20 +1,10 @@ -{{ macros.post_vote_buttons(post = answer, visitor_vote = user_answer_votes[answer.id]) }} -<img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" +{{ macros.post_vote_buttons(post = answer) }} +<div + id="answer-img-accept-{{ answer.id }}" + class="answer-img-accept" {% if answer.accepted() %} - src="{{'/images/vote-accepted-on.png'|media}}" + title="{% trans %}this answer has been selected as correct{% endtrans %}" {% else %} - src="{{'/images/vote-accepted.png'|media}}" + title="{% trans %}mark this answer as correct (click again to undo){% endtrans %}" {% endif %} - {% if request.user.is_authenticated() and - ( - request.user == question.author or - request.user.is_administrator_or_moderator() - ) - %} - alt="{% trans %}mark this answer as correct (click again to undo){% endtrans %}" - title="{% trans %}mark this answer as correct (click again to undo){% endtrans %}" - {% else %} - alt="{% trans question_author=question.author.username %}{{question_author}} has selected this answer as correct{% endtrans %}" - title="{% trans question_author=question.author.username%}{{question_author}} has selected this answer as correct{% endtrans %}" - {% endif %} - /> +></div> diff --git a/askbot/skins/common/templates/question/question_controls.html b/askbot/skins/common/templates/question/question_controls.html index 4710559d..5eee380a 100644 --- a/askbot/skins/common/templates/question/question_controls.html +++ b/askbot/skins/common/templates/question/question_controls.html @@ -15,17 +15,17 @@ {% endif %} {% if question.offensive_flag_count > 0 %} <span - id="question-offensive-flag-{{ question.id }}" class="offensive-flag" + id="question-offensive-remove-flag-{{ question.id }}" + class="offensive-flag" title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}" > - <a class="question-flag">{% trans %}flag offensive{% endtrans %} {{ question.offensive_flag_count }})</a> + <a class="question-flag">{% trans %}remove flag{% endtrans %}</a> </span> <span - id="question-offensive-flag-remove-{{ question.id }}" - class="offensive-flag" + id="question-offensive-flag-{{ question.id }}" class="offensive-flag" title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}" > - <a class="question-flag">{% trans %}remove flag{% endtrans %} ({{ question.offensive_flag_count }})</a> + <a class="question-flag">{% trans %}flag offensive{% endtrans %} ({{ question.offensive_flag_count }})</a> </span> {% else %} <span diff --git a/askbot/skins/common/templates/question/question_vote_buttons.html b/askbot/skins/common/templates/question/question_vote_buttons.html index 8466beb9..6b8774cc 100644 --- a/askbot/skins/common/templates/question/question_vote_buttons.html +++ b/askbot/skins/common/templates/question/question_vote_buttons.html @@ -1 +1 @@ -{{ macros.post_vote_buttons(post = question, visitor_vote = user_question_vote) }} +{{ macros.post_vote_buttons(post = question) }} |