fix welcome page to display warning on missing admin

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1386692 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-09-17 16:22:55 +00:00
parent 7d266951b7
commit 5ee670912e
2 changed files with 13 additions and 4 deletions

View File

@ -52,8 +52,7 @@ function(jquery,ui,sammy,tmpl) {
url: 'restServices/redbackServices/loginService/logout',
complete: function(){
// go to welcome on logout
window.sammyArchivaApplication.runRoute('get', '#search')
window.sammyArchivaApplication.setLocation("#welcome");
window.sammyArchivaApplication.setLocation("#search");
}
});
@ -601,17 +600,25 @@ function(jquery,ui,sammy,tmpl) {
$.log("repositoryId:"+repositoryId);
displayBrowse(true,repositoryId);
});
this.get('#welcome', function () {
$.log("#welcome hash");
checkCreateAdminLink(function(){window.sammyArchivaApplication.setLocation("#search")});
});
this.get('#:folder', function () {
var folder = this.params.folder;
self.activeMenuId(folder);
var baseItems = self.artifactMenuItems?self.artifactMenuItems:[];
ko.utils.arrayFirst(baseItems.concat(self.usersMenuItems, self.administrationMenuItems), function(p) {
if ( p.href == "#"+self.activeMenuId()) {
screenChange();
p.func();
}
});
});
this.get('#welcome', function () { this.app.runRoute('get', '#search') });
});
};
@ -677,7 +684,7 @@ function(jquery,ui,sammy,tmpl) {
var matches = window.location.toString().match(/^[^#]*(#.+)$/);
var hash = matches ? matches[1] : '';
$.log("location:"+window.sammyArchivaApplication.getLocation()+",hash:"+hash);
// by default display search screen
// by default display welcome screen
if(!hash){
window.sammyArchivaApplication.setLocation("#welcome");
}

View File

@ -136,6 +136,7 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
displaySuccessMessage( $.i18n.prop("user.admin.created"));
var onSuccessCall=function(){
reccordLoginCookie(currentAdminUser);
window.archivaModel.adminExists=true;
screenChange();
checkCreateAdminLink();
checkSecurityLinks();
@ -261,6 +262,7 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
return;
}
self.user.createAdmin();
// go to search when admin created
window.sammyArchivaApplication.setLocation("#search");
}