From 43ce98844279dacea6c81d671e275063540e4992 Mon Sep 17 00:00:00 2001 From: jordan Date: Wed, 22 Dec 2010 22:33:54 +0000 Subject: [PATCH] The accept answer button changes it's title when using the ajax command. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@624 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/skins/default/media/js/osqa.main.js | 2 ++ .../default/templates/node/accept_button.html | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/forum/skins/default/media/js/osqa.main.js b/forum/skins/default/media/js/osqa.main.js index 658ac99..b52fd61 100644 --- a/forum/skins/default/media/js/osqa.main.js +++ b/forum/skins/default/media/js/osqa.main.js @@ -53,12 +53,14 @@ var response_commands = { var $answer = $('#answer-container-' + id); $answer.addClass('accepted-answer'); $answer.find('.accept-answer').addClass('on'); + $answer.find('.accept-answer').attr('title', $answer.find('.accept-answer').attr('bn:on')); }, unmark_accepted: function(id) { var $answer = $('#answer-container-' + id); $answer.removeClass('accepted-answer'); $answer.find('.accept-answer').removeClass('on'); + $answer.find('.accept-answer').attr('title', $answer.find('.accept-answer').attr('bn:off')); }, remove_comment: function(id) { diff --git a/forum/skins/default/templates/node/accept_button.html b/forum/skins/default/templates/node/accept_button.html index 9da66f5..653f8b1 100644 --- a/forum/skins/default/templates/node/accept_button.html +++ b/forum/skins/default/templates/node/accept_button.html @@ -2,11 +2,21 @@ {% if can_accept %} + title=" {% if answer.nis.accepted %} + {% blocktrans with answer.nstate.accepted.by.username as who %}{{ who }} has selected this answer as the correct answer{% endblocktrans %} + {% else %} + {% trans "mark this answer as the accepted answer" %} + {% endif %}" + bn:on="{% blocktrans with answer.nstate.accepted.by.username as who %}{{ who }} has selected this answer as the correct answer{% endblocktrans %}" + bn:off="{% trans "mark this answer as the accepted answer" %}" + href="{% url accept_answer id=answer.id %}" rel="nofollow"> + {% else %} {% if answer.nis.accepted %} - + + {% endif %} {% endif %} -- 2.39.5