display error message if admin user not exists

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

View File

@ -460,3 +460,8 @@ report.health.result.name=Name
report.health.result.problem=Problem
report.health.result.message=Message
report.result.title=Result
admin.creation.mandatory=You must create the admin user!

View File

@ -644,6 +644,7 @@ function(jquery,ui,sammy,tmpl) {
dataType: 'json',
success: function(data) {
var adminExists = data;
window.archivaModel.adminExists=adminExists;
var createAdminLink=$("#create-admin-link");
if (adminExists == false) {
createAdminLink.show();

View File

@ -123,6 +123,10 @@ require(["jquery","jquery.tmpl","i18n"], function(jquery,jqueryTmpl,i18n) {
mainContent.removeAttr("data-bind");
$("#body_content" ).find(".popover" ).hide();
clearUserMessages();
if(window.archivaModel.adminExists==false){
displayErrorMessage($.i18n.prop("admin.creation.mandatory"));
}
}
/**

View File

@ -277,6 +277,7 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
dataType: 'json',
success: function(data) {
var adminExists = data;
window.archivaModel.adminExists=adminExists;
if (adminExists == false) {
window.redbackModel.createUser=true;