-$('.award_points_slider').slider({
- min: 1, max: {{ user.reputation }},
- slide: function(evt, ui) {
- $('#reputation_points_award').html(ui.value)
+ var awardPointsNotified = false;
+ var reputation_to_comment = {{ reputation_to_comment }};
+ var user_reputation = {{ user.reputation }};
+
+ function points_award_confirm(reputation, event) {
+ var message = '<div style="max-width: 300px !important; text-align: left;">';
+ message += "{% blocktrans %}Your karma points will be below the minimum reputation to comment. Are you sure you want to award points?{% endblocktrans %}";
+ message += "</div>";
+
+ if ((user_reputation - reputation) < reputation_to_comment && !awardPointsNotified) {
+ awardPointsNotified = true;
+
+ var doptions = {
+ html: message,
+ extra_class: 'confirm',
+ yes_text: messages.yes,
+ show_no: true,
+ no_callback: function() {
+ $(".dialog").fadeOut("fast", function() {
+ $('.dialog').remove();
+ })
+ },
+
+ no_text: messages.no
+ }
+
+ doptions.event = event;
+ show_dialog(doptions);
+ }