]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/templates/node/award_points.html
The convert to answer action now works only if the comment parent is a question or...
[osqa.git] / forum / skins / default / templates / node / award_points.html
index 82100694d26bb2a117ffd6fe5413376e32a3da2d..a031fa0cd3bddbd8abaffbfe6aaffbb090d37877 100644 (file)
@@ -2,22 +2,38 @@
 
 <p>
 {% blocktrans %}
-Award {{ awarded_user }} with reputation points.
+If you like this answer you can award {{ awarded_user }} with reputation points.
 {% endblocktrans %}
 </p>
 
 <p>
-    Points:
-    <span id="reputation_points_award">1</span>
+{% blocktrans %}
+Use the slider below or the input field to choose the amount of points you would like to give.
+{% endblocktrans %}
 </p>
 
+<table>
+    <tr>
+        <td width="50%">{% trans "Points:" %}</td>
+        <td width="50%"><input type="text" name="points" id="points_input" value="1" style="border: 1px solid #ccc; padding: 1px 2px;" /></td>
+    </tr>
+</table>
+
 <div class="award_points_slider"></div>
 
 <script>
 $('.award_points_slider').slider({
     min: 1, max: {{ user.reputation }},
     slide: function(evt, ui) {
-        $('#reputation_points_award').html(ui.value)
+        $('#points_input').val(ui.value)
     }
 });
+
+$('#points_input').bind('change keydown', function() {
+    if ($(this).val() > {{ user.reputation }}) {
+        $(this).attr('value', {{ user.reputation }})
+    }
+    $('.award_points_slider').slider('option', 'value', $(this).val())
+})
+
 </script>
\ No newline at end of file