]> git.openstreetmap.org Git - osqa.git/commitdiff
The accept answer button changes it's title when using the ajax command.
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 22 Dec 2010 22:33:54 +0000 (22:33 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 22 Dec 2010 22:33:54 +0000 (22:33 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@624 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/media/js/osqa.main.js
forum/skins/default/templates/node/accept_button.html

index 658ac996360697a95a5f12c946059c0af5d34174..b52fd61e764e3f2c729b3d5f2095880c1e3dad99 100644 (file)
@@ -53,12 +53,14 @@ var response_commands = {
         var $answer = $('#answer-container-' + id);\r
         $answer.addClass('accepted-answer');\r
         $answer.find('.accept-answer').addClass('on');\r
         var $answer = $('#answer-container-' + id);\r
         $answer.addClass('accepted-answer');\r
         $answer.find('.accept-answer').addClass('on');\r
+        $answer.find('.accept-answer').attr('title', $answer.find('.accept-answer').attr('bn:on'));\r
     },\r
 \r
     unmark_accepted: function(id) {\r
         var $answer = $('#answer-container-' + id);\r
         $answer.removeClass('accepted-answer');\r
         $answer.find('.accept-answer').removeClass('on');\r
     },\r
 \r
     unmark_accepted: function(id) {\r
         var $answer = $('#answer-container-' + id);\r
         $answer.removeClass('accepted-answer');\r
         $answer.find('.accept-answer').removeClass('on');\r
+        $answer.find('.accept-answer').attr('title', $answer.find('.accept-answer').attr('bn:off'));\r
     },\r
 \r
     remove_comment: function(id) {\r
     },\r
 \r
     remove_comment: function(id) {\r
index 9da66f58d54bf9b0bed82ce462d2d5123aa43b27..653f8b181e2ea7d581111b946372be97e3e7aae9 100644 (file)
@@ -2,11 +2,21 @@
 \r
 {% if can_accept %}\r
     <a id="accept-answer-{{ answer.id }}" class="ajax-command accept-answer{% if answer.nis.accepted %} on{% endif %}"\r
 \r
 {% if can_accept %}\r
     <a id="accept-answer-{{ answer.id }}" class="ajax-command accept-answer{% if answer.nis.accepted %} on{% endif %}"\r
-        title="{% if answer.nis.accepted %}{% blocktrans with answer.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 %}"\r
-         href="{% url accept_answer id=answer.id %}" rel="nofollow"> </a>\r
+      title=" {% if answer.nis.accepted %}\r
+              {% blocktrans with answer.nstate.accepted.by.username as who %}{{ who }} has selected this answer as the correct answer{% endblocktrans %}\r
+              {% else %}\r
+                {% trans "mark this answer as the accepted answer" %}\r
+              {% endif %}"\r
+              bn:on="{% blocktrans with answer.nstate.accepted.by.username as who %}{{ who }} has selected this answer as the correct answer{% endblocktrans %}"\r
+              bn:off="{% trans "mark this answer as the accepted answer" %}"\r
+       href="{% url accept_answer id=answer.id %}" rel="nofollow"> \r
+    </a>\r
 {% else %}\r
     {% if answer.nis.accepted %}\r
 {% else %}\r
     {% if answer.nis.accepted %}\r
-        <a class="accept-answer on"></a>\r
+      <a class="accept-answer on"\r
+        title="{% blocktrans with answer.nstate.accepted.by.username as who %}{{ who }} has selected this answer as the correct answer{% endblocktrans %}"\r
+        href="{% url accept_answer id=answer.id %}" rel="nofollow"> \r
+      </a>\r
     {% endif %}\r
 {% endif %}\r
 \r
     {% endif %}\r
 {% endif %}\r
 \r