incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [6/26] git commit: [#5077] ticket:191 add confirmation when removing developer
Date Fri, 26 Oct 2012 19:33:22 GMT
[#5077] ticket:191 add confirmation when removing developer


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/58f6af4e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/58f6af4e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/58f6af4e

Branch: refs/heads/cj/4942
Commit: 58f6af4ebccb5506b3ecd03f7b447cfe6b9b2f97
Parents: 30c0f47
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Wed Oct 17 18:10:36 2012 +0400
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Mon Oct 22 17:09:10 2012 +0000

----------------------------------------------------------------------
 .../allura/ext/admin/templates/project_groups.html |    2 +-
 Allura/allura/public/nf/js/project_groups.js       |   29 ++++++++-------
 2 files changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/58f6af4e/Allura/allura/ext/admin/templates/project_groups.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/project_groups.html b/Allura/allura/ext/admin/templates/project_groups.html
index de3a5eb..7617c0c 100644
--- a/Allura/allura/ext/admin/templates/project_groups.html
+++ b/Allura/allura/ext/admin/templates/project_groups.html
@@ -57,7 +57,7 @@
           {% for r in role.users_with_role() %}
           <li class="deleter" data-user="{{r.user.username}}">
             <b data-icon="{{g.icons['perm_delete'].char}}"
-               class="ico {{g.icons['perm_delete'].css}}"></b>
+               class="ico {{g.icons['perm_delete'].css}} deleter" data-user="{{r.user.username}}"></b>
             {{ r.user.display_name }} ({{r.user.username}})
           </li>
           {% endfor %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/58f6af4e/Allura/allura/public/nf/js/project_groups.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/project_groups.js b/Allura/allura/public/nf/js/project_groups.js
index 6ca9cd3..3ed0ee1 100644
--- a/Allura/allura/public/nf/js/project_groups.js
+++ b/Allura/allura/public/nf/js/project_groups.js
@@ -32,23 +32,24 @@ $(function() {
   });
   // remove user from group
   var delete_user = function(evt){
-    var user_holder = $(this);
-    var params = {'role_id': user_holder.closest('tr').data('group'),
+    var user_holder =  $(this).parent();
+    if(confirm("Are you sure you want to remove the user "+user_holder.data('user')+"?")){
+        var params = {'role_id': user_holder.closest('tr').data('group'),
                   'username': user_holder.data('user'),
                   '_session_id': cval};
-    var old_html = user_holder.html();
-    user_holder.html(spinner_img+' Removing...');
-    $.post('remove_user', params, function(data){
-      if(data.error){
-        flash(data.error, 'error');
-        user_holder.html(old_html);
-      }
-      else{
-        user_holder.slideUp('fast');
+        var old_html = user_holder.html();
+        user_holder.html(spinner_img+' Removing...');
+        $.post('remove_user', params, function(data){
+            if(data.error){
+            flash(data.error, 'error');
+            user_holder.html(old_html);
+        }
+            else{
+             user_holder.slideUp('fast');
       }
     });
-  };
-  $('#usergroup_admin li.deleter').click(delete_user);
+  }};
+  $('#usergroup_admin b.deleter').click(delete_user);
   // add user to group
   $('#usergroup_admin tr').delegate("form.add_user", "submit", function(evt){
     evt.preventDefault();
@@ -66,7 +67,7 @@ $(function() {
       else{
         holder.attr('data-user', data.username).addClass('deleter');
         holder.html(perm_delete_ico+' '+data.displayname);
-        holder.click(delete_user);
+        holder.children('b').click(delete_user);
       }
     });
   });


Mime
View raw message