aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-07-11 22:03:29 +0000
committerOlivier Lamy <olamy@apache.org>2012-07-11 22:03:29 +0000
commitf2fa9085d0a75a88e4bd3c1a72dec8ef2d596027 (patch)
tree1cd0715bb53e22a676586c74985d49a3be27165d /archiva-modules
parent71da38205106cae0e67dcfb727f992d61f024280 (diff)
downloadarchiva-f2fa9085d0a75a88e4bd3c1a72dec8ef2d596027.tar.gz
archiva-f2fa9085d0a75a88e4bd3c1a72dec8ef2d596027.zip
do not display admin createbox if admin already created
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1360439 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html1
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js3
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js48
3 files changed, 35 insertions, 17 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
index d1c1bf26f..f7d744fa7 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
@@ -159,7 +159,6 @@
window.archivaRuntimeInfo=data;
require(['sammy','archiva.main','domReady!'],function (domReady) {
- $.log("startArchivaApplication");
startArchivaApplication();
$("#loadingDiv").hide();
})
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
index a220541ee..eeb372a6a 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
@@ -65,7 +65,8 @@ function() {
return;
}
// by default display search screen
- window.sammyArchivaApplication.setLocation("#search");
+ $.log("location:"+window.sammyArchivaApplication.getLocation());
+ //window.sammyArchivaApplication.setLocation("#search");
}
hasKarma=function(karmaName){
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js
index ea11fa92b..3994edc58 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js
@@ -289,6 +289,8 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
return;
}
self.user.createAdmin();
+ // go to search when admin created
+ window.sammyArchivaApplication.setLocation("#search");
}
}
@@ -296,24 +298,40 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
* open a modal box to create admin user
*/
adminCreateBox=function() {
- $.log("adminCreateBox");
- window.redbackModel.createUser=true;
- $("#main-content").attr("data-bind",'template: {name:"redback/user-edit-tmpl",data: user}');
- var viewModel = new AdminUserViewModel();
- ko.applyBindings(viewModel,$("#main-content" ).get(0));
- $("#user-create").validate({
- rules: {
- confirmPassword: {
- equalTo: "#password"
+
+
+ $.ajax("restServices/redbackServices/userService/isAdminUserExists", {
+ type: "GET",
+ dataType: 'json',
+ success: function(data) {
+ var adminExists = data;
+ if (adminExists == false) {
+
+ window.redbackModel.createUser=true;
+ $("#main-content").attr("data-bind",'template: {name:"redback/user-edit-tmpl",data: user}');
+ var viewModel = new AdminUserViewModel();
+ ko.applyBindings(viewModel,$("#main-content" ).get(0));
+ $.log("adminCreateBox");
+ $("#user-create").validate({
+ rules: {
+ confirmPassword: {
+ equalTo: "#password"
+ }
+ },
+ showErrors: function(validator, errorMap, errorList) {
+ customShowError("#main-content #user-create",validator,errorMap,errorMap);
+ }
+
+ });
+ // desactivate roles pill when adding user
+ $("#edit_user_details_pills_headers").hide();
+
+ } else {
+ window.sammyArchivaApplication.setLocation("#search");
}
- },
- showErrors: function(validator, errorMap, errorList) {
- customShowError("#main-content #user-create",validator,errorMap,errorMap);
- }
+ }
});
- // desactivate roles pill when adding user
- $("#edit_user_details_pills_headers").hide();
}
/**