Browse Source

Ask people if they are sure they are reporting posts. #285

Rafał Pitoń 11 years ago
parent
commit
13d8ee9cfb

+ 5 - 0
static/cranefly/js/cranefly.js

@@ -333,6 +333,11 @@ $(function() {
     var csrf_token = $(this).find('input[name="_csrf_token"]').val();
     var button = $(this).find('button');
     $(this).submit(function() {
+      var decision = confirm(l_report_sure);
+      if (!decision) {
+        return false;
+      }
+
       var form = this;
       $.post(form.action, {'_csrf_token': csrf_token}, "json").done(function(data, textStatus, jqXHR) {
         $(button).text(l_post_reported);

+ 2 - 1
templates/cranefly/private_threads/thread.html

@@ -512,7 +512,8 @@
   {{ super() }}
   <script src="{{ STATIC_URL }}cranefly/highlight/highlight.pack.js"></script>
   <script type="text/javascript">
-    var l_post_reported = "{{ _('Reported!') }}";
+    var l_report_sure = "{% trans %}Are you sure you want to bring this message to moderator attention?{% endtrans %}";
+    var l_post_reported = "{% trans %}Reported!{% endtrans %}";
     hljs.tabReplace = '    ';
     hljs.initHighlightingOnLoad();
     EnhancePostsMD();

+ 2 - 1
templates/cranefly/threads/thread.html

@@ -579,7 +579,8 @@
   {{ super() }}
   <script src="{{ STATIC_URL }}cranefly/highlight/highlight.pack.js"></script>
   <script type="text/javascript">
-    var l_post_reported = "{{ _('Reported!') }}";
+    var l_report_sure = "{% trans %}Are you sure you want to bring this message to moderator attention?{% endtrans %}";
+    var l_post_reported = "{% trans %}Reported!{% endtrans %}";
     hljs.tabReplace = '    ';
     hljs.initHighlightingOnLoad();
     EnhancePostsMD();