archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1239832 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback: templates/user-grids.html user.js users.js
Date Thu, 02 Feb 2012 20:43:44 GMT
Author: olamy
Date: Thu Feb  2 20:43:44 2012
New Revision: 1239832

URL: http://svn.apache.org/viewvc?rev=1239832&view=rev
Log:
fix delete user

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html?rev=1239832&r1=1239831&r2=1239832&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html
Thu Feb  2 20:43:44 2012
@@ -39,7 +39,7 @@
                 <td></td>
               {{else}}
                 <td>
-                  <a href="#" data-bind="click: function(){ row.deleteUser() }" id="users-grid-delete-${row.username()}">
+                  <a href="#" data-bind="click: function(){ deleteUser(row) }" id="users-grid-delete-${row.username()}">
                     <img src="images/edit-cut.png" alt="${$.i18n.prop('delete')}"/>
                   </a>
                 </td>

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js?rev=1239832&r1=1239831&r2=1239832&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js
Thu Feb  2 20:43:44 2012
@@ -137,32 +137,6 @@ $(function() {
           });
       };
 
-      this.deleteUser=function() {
-        clearUserMessages();
-
-        var currentUser = this;
-        openDialogConfirm(function(){
-          $.ajax("restServices/redbackServices/userService/deleteUser/"+encodeURIComponent(currentUser.username()),
{
-                type: "GET",
-                dataType: 'json',
-                success: function(data) {
-                  // FIXME i18n
-                  window.redbackModel.usersViewModel.users.remove(currentUser);
-                  displaySuccessMessage("user " + currentUser.username() + " deleted");
-                },
-                error: function(result) {
-                 var obj = jQuery.parseJSON(result.responseText);
-                 displayRedbackError(obj);
-                },
-                complete: function() {
-                  closeDialogConfirm();
-                }
-              }
-            );
-          }
-          ,"Ok", $.i18n.prop("cancel"), $.i18n.prop("user.delete.message") + ": " + currentUser.username());
-
-      };
 
       this.update=function(){
         var currentUser = this;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js?rev=1239832&r1=1239831&r2=1239832&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js
Thu Feb  2 20:43:44 2012
@@ -94,6 +94,33 @@ $(function() {
       });
     };
 
+    deleteUser=function(user){
+      clearUserMessages();
+
+      var currentUser = user;
+      openDialogConfirm(function(){
+        $.ajax("restServices/redbackServices/userService/deleteUser/"+encodeURIComponent(currentUser.username()),
{
+              type: "GET",
+              dataType: 'json',
+              success: function(data) {
+                // FIXME i18n
+                displaySuccessMessage("user " + currentUser.username() + " deleted");
+                self.users.remove(currentUser);
+              },
+              error: function(result) {
+               var obj = jQuery.parseJSON(result.responseText);
+               displayRedbackError(obj);
+              },
+              complete: function() {
+                closeDialogConfirm();
+              }
+            }
+          );
+        }
+        ,"Ok", $.i18n.prop("cancel"), $.i18n.prop("user.delete.message") + ": " + currentUser.username());
+
+    }
+
     editUserBox=function(user) {
       clearUserMessages();
       activateUsersEditTab();



Mime
View raw message