]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/templates/user.html
allow superusers to see users email
[osqa.git] / forum / skins / default / templates / user.html
index 5931f31cbfcdf955496c7c7b9684fed5e18f2200..ad71505094ccecb595f546f7cd581ead7c95ae23 100644 (file)
@@ -11,8 +11,7 @@
        </style>
 {% endblock %}
 {% block forejs %}
-    {% if request.user|can_moderate_users %}
-        <script type='text/javascript' src='{% media  "/media/js/com.cnprog.admin.js" %}'></script>
+    {% if request.user.is_superuser %}
         <script type='text/javascript' src='{% media  "/media/js/jquery.form.js" %}'></script>
     {% endif %}
     <script type="text/javascript">
             {% else %}
                 $("#nav_users").attr('className',"on");
             {% endifequal %}
-        }); 
+        });
+
+        $(document).ready( function(){
+            var options = {
+                           success: function(a,b){$('.admin #action_status').html($.i18n._('changes saved'));},
+                           dataType:'json',
+                           timeout:5000,
+                           url: scriptUrl + $.i18n._('moderate-user/') + viewUserID +  '/'
+                            };
+            var form = $('.admin #moderate_user_form').ajaxForm(options);
+            var box = $('.admin input#id_is_approved').click(function(){
+                $('.admin #action_status').html($.i18n._('sending data...'));
+                form.ajaxSubmit(options);
+            });
+        });
     </script>
     {% block userjs %}
     {% endblock %}