]> source.dussan.org Git - archiva.git/commitdiff
use label-warning in delete user modal confirm, add missing i18n
authorOlivier Lamy <olamy@apache.org>
Sun, 26 Feb 2012 23:08:02 +0000 (23:08 +0000)
committerOlivier Lamy <olamy@apache.org>
Sun, 26 Feb 2012 23:08:02 +0000 (23:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1293960 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js

index 84a3b948c660638cae233287dcba44e2cb88d7b4..6289a8d233196c5cbb6840dfdb357692b5c87c1d 100644 (file)
@@ -137,6 +137,12 @@ validated=Validated
 user.locked=User {0} locked.
 user.unlocked=User {0} unlocked.
 user.passwordChangeRequired.updated=Password change required updated for user {0} to {1}
+user.created=User {0} created.
+user.deleted=User {0} deleted.
+user.updated=User {0} updated.
+user.admin.created=admin user created
+user.details.updated=details updated.
+user.delete.message=The following user {0} will be deleted
 
 #roles management
 roles.management.header=Roles Management
index 8cc279893cebd5b66cefe078ab8adf5ffc174c1a..944d83260e3afc9c32c0529ee040a723c3a0e24f 100644 (file)
@@ -102,7 +102,7 @@ $(function() {
           success: function(result) {
             var created = JSON.parse(result);
             if (created == true) {
-              displaySuccessMessage("user created:"+currentUser.username());
+              displaySuccessMessage( $.i18n.prop("user.created",currentUser.username()));
               if (successFnCallback){
                 successFnCallback(currentUser);
               }
@@ -137,9 +137,8 @@ $(function() {
           success: function(result) {
             var created = JSON.parse(result);
             if (created == true) {
-              displaySuccessMessage("admin user created");
+              displaySuccessMessage( $.i18n.prop("user.admin.created"));
               var onSuccessCall=function(){
-                $.log("onSuccessCall after admin creation");
                 reccordLoginCookie(currentAdminUser);
                 screenChange();
                 checkCreateAdminLink();
@@ -169,6 +168,7 @@ $(function() {
           success: function(result) {
             var updated = JSON.parse(result);
             if (updated == true) {
+              clearUserMessages();
               displaySuccessMessage($.i18n.prop("user.updated",currentUser.username()));
               $("#main-content #users-view-tabs-li-user-edit a").html($.i18n.prop("add"));
               clearForm("#main-content #user-create");
@@ -347,10 +347,8 @@ $(function() {
         logged = true;
       }
     }
-    $.log("successLoginCallbackFn, logged:"+logged);
     if (logged == true) {
       var user = mapUser(result.user);
-      $.log("user.passwordChangeRequired:"+user.passwordChangeRequired());
       if (user.passwordChangeRequired()==true){
         changePasswordBox(true,false,user);
         return;
@@ -548,7 +546,7 @@ $(function() {
           var created = JSON.parse(result);
           // FIXME i18n
           if (created == true) {
-            displaySuccessMessage("details updated.");
+            displaySuccessMessage( $.i18n.prop("user.details.updated"));
             window.modalEditUserBox.modal('hide');
             reccordLoginCookie(user);
             clearForm("#user-edit-form");
index bc0523640847588aa69d2d73bb65a17dd9156d42..2d581268c1e2e2923782192577e89474c43e3e7b 100644 (file)
@@ -105,7 +105,7 @@ $(function() {
               dataType: 'json',
               success: function(data) {
                 // FIXME i18n
-                displaySuccessMessage("user " + currentUser.username() + " deleted");
+                displaySuccessMessage( $.i18n.prop("user.deleted", currentUser.username()));
                 self.users.remove(currentUser);
               },
               error: function(result) {
@@ -118,7 +118,7 @@ $(function() {
             }
           );
         }
-        ,"Ok", $.i18n.prop("cancel"), $.i18n.prop("user.delete.message") + ": " + currentUser.username(),
+        ,"Ok", $.i18n.prop("cancel"), $.i18n.prop("user.delete.message", currentUser.username()),
         $("#user-delete-warning-tmpl" ).tmpl(currentUser));
 
     }
@@ -197,7 +197,6 @@ $(function() {
             return mapApplicationRoles(item);
           });
           viewModel.applicationRoles=ko.observableArray(mappedApplicationRoles);
-          $.log("applicationRoles length:"+mappedApplicationRoles.length);
           mainContent.find("#user-edit-roles-edit").attr("data-bind",'template: {name:"user_edit_roles_tmpl"}');
           ko.applyBindings(viewModel,mainContent.find("#user-edit-roles-edit").get(0));
           $.log("assignedRoles:"+user.assignedRoles().length);
@@ -217,13 +216,9 @@ $(function() {
     }
 
     saveUser=function(){
-      $.log("UserViewModel#saveUser");
       var valid = $("#main-content #user-create").valid();
       if (valid==false) {
-        $.log("user#save valid:false");
         return;
-      } else {
-        $.log("user#save valid:true,update:"+self.updateMode);
       }
       if (self.updateMode==false){
         return user.create(function(){self.usersViewModel.users.push(user)});
@@ -292,10 +287,6 @@ $(function() {
     mainContent.find("#users-view-tabs-li-user-edit").addClass("active");
   }
 
-
-
-
-
 });