[IMP] website_forum: better error messages about karma
authorThibault Delavallée <tde@openerp.com>
Fri, 18 Apr 2014 15:16:08 +0000 (17:16 +0200)
committerThibault Delavallée <tde@openerp.com>
Fri, 18 Apr 2014 15:16:08 +0000 (17:16 +0200)
bzr revid: tde@openerp.com-20140418151608-0pb3ui97aksb9en1

addons/website_forum/static/src/js/website_forum.js

index 3eda8a2..eed4947 100644 (file)
@@ -18,9 +18,9 @@ $(document).ready(function () {
                             '</div>');
                     }
                     else if (data['error'] == 'not_enough_karma') {
-                        var $warning = $('<div class="alert alert-danger alert-dismissable" id="vote_alert" style="position:absolute; margin-top: -30px; margin-left: 90px;">'+
+                        var $warning = $('<div class="alert alert-danger alert-dismissable" id="vote_alert" style="max-width: 500px; position:absolute; margin-top: -30px; margin-left: 90px;">'+
                             '<button type="button" class="close notification_close" data-dismiss="alert" aria-hidden="true">&times;</button>'+
-                            'Sorry, at least ' + data['karma'] + ' karma is required to vote'+
+                            'Sorry, at least ' + data['karma'] + ' karma is required to vote. You can gain karma by answering questions and receiving votes.'+
                             '</div>');
                     }
                     vote_alert = $link.parent().find("#vote_alert");
@@ -60,9 +60,9 @@ $(document).ready(function () {
                         'Sorry, only the user who asked this question can accept the answer as correct.'+
                         '</div>');
                 } else if (data['error'] == 'not_enough_karma') {
-                    var $warning = $('<div class="alert alert-danger alert-dismissable" id="vote_alert" style="position:absolute; margin-top: -30px; margin-left: 90px;">'+
+                    var $warning = $('<div class="alert alert-danger alert-dismissable" id="vote_alert" style="max-width: 500px; position:absolute; margin-top: -30px; margin-left: 90px;">'+
                         '<button type="button" class="close notification_close" data-dismiss="alert" aria-hidden="true">&times;</button>'+
-                        'Sorry, at least ' + data['karma'] + ' karma is required to accept your own answers'+
+                        'Sorry, at least ' + data['karma'] + ' karma is required to accept your own answers. You can gain karma by answering questions and receiving votes.'+
                         '</div>');
                 }
                 correct_answer_alert = $link.parent().find("#correct_answer_alert");