mirror of https://github.com/apache/archiva.git
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:
parent
7d266951b7
commit
5ee670912e
|
@ -52,8 +52,7 @@ function(jquery,ui,sammy,tmpl) {
|
||||||
url: 'restServices/redbackServices/loginService/logout',
|
url: 'restServices/redbackServices/loginService/logout',
|
||||||
complete: function(){
|
complete: function(){
|
||||||
// go to welcome on logout
|
// go to welcome on logout
|
||||||
window.sammyArchivaApplication.runRoute('get', '#search')
|
window.sammyArchivaApplication.setLocation("#search");
|
||||||
window.sammyArchivaApplication.setLocation("#welcome");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -601,17 +600,25 @@ function(jquery,ui,sammy,tmpl) {
|
||||||
$.log("repositoryId:"+repositoryId);
|
$.log("repositoryId:"+repositoryId);
|
||||||
displayBrowse(true,repositoryId);
|
displayBrowse(true,repositoryId);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.get('#welcome', function () {
|
||||||
|
$.log("#welcome hash");
|
||||||
|
checkCreateAdminLink(function(){window.sammyArchivaApplication.setLocation("#search")});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
this.get('#:folder', function () {
|
this.get('#:folder', function () {
|
||||||
var folder = this.params.folder;
|
var folder = this.params.folder;
|
||||||
self.activeMenuId(folder);
|
self.activeMenuId(folder);
|
||||||
var baseItems = self.artifactMenuItems?self.artifactMenuItems:[];
|
var baseItems = self.artifactMenuItems?self.artifactMenuItems:[];
|
||||||
ko.utils.arrayFirst(baseItems.concat(self.usersMenuItems, self.administrationMenuItems), function(p) {
|
ko.utils.arrayFirst(baseItems.concat(self.usersMenuItems, self.administrationMenuItems), function(p) {
|
||||||
if ( p.href == "#"+self.activeMenuId()) {
|
if ( p.href == "#"+self.activeMenuId()) {
|
||||||
|
screenChange();
|
||||||
p.func();
|
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 matches = window.location.toString().match(/^[^#]*(#.+)$/);
|
||||||
var hash = matches ? matches[1] : '';
|
var hash = matches ? matches[1] : '';
|
||||||
$.log("location:"+window.sammyArchivaApplication.getLocation()+",hash:"+hash);
|
$.log("location:"+window.sammyArchivaApplication.getLocation()+",hash:"+hash);
|
||||||
// by default display search screen
|
// by default display welcome screen
|
||||||
if(!hash){
|
if(!hash){
|
||||||
window.sammyArchivaApplication.setLocation("#welcome");
|
window.sammyArchivaApplication.setLocation("#welcome");
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,6 +136,7 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
|
||||||
displaySuccessMessage( $.i18n.prop("user.admin.created"));
|
displaySuccessMessage( $.i18n.prop("user.admin.created"));
|
||||||
var onSuccessCall=function(){
|
var onSuccessCall=function(){
|
||||||
reccordLoginCookie(currentAdminUser);
|
reccordLoginCookie(currentAdminUser);
|
||||||
|
window.archivaModel.adminExists=true;
|
||||||
screenChange();
|
screenChange();
|
||||||
checkCreateAdminLink();
|
checkCreateAdminLink();
|
||||||
checkSecurityLinks();
|
checkSecurityLinks();
|
||||||
|
@ -261,6 +262,7 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.user.createAdmin();
|
self.user.createAdmin();
|
||||||
|
|
||||||
// go to search when admin created
|
// go to search when admin created
|
||||||
window.sammyArchivaApplication.setLocation("#search");
|
window.sammyArchivaApplication.setLocation("#search");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue