diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js index 4ae328a90..7d9f934c0 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js @@ -609,15 +609,17 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" } }, showErrors: function(validator, errorMap, errorList) { - customShowError("#main-content #appearance-configuration-form-id", validator, errorMap, errorMap); + $.log("activateOrganisationInformationFormValidation#customShowError"); + customShowError($("#main-content" ).find("#appearance-configuration-form-id"), validator, errorMap, errorMap); } }); } OrganisationInformationViewModel=function(organisationInformation){ - activateOrganisationInformationFormValidation(); + this.organisationInformation=ko.observable(organisationInformation); this.save=function(){ + $.log("OrganisationInformationViewModel#save"); var mainContent=$("#main-content" ); if (!mainContent.find("#appearance-configuration-form-id").valid()) { return; @@ -645,34 +647,13 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" }); } } - displayAppearanceConfiguration=function(){ - screenChange(); - var mainContent=$("#main-content"); - mainContent.html(mediumSpinnerImg()); - $.ajax("restServices/archivaServices/archivaAdministrationService/getOrganisationInformation", { - type: "GET", - dataType: 'json', - success: function(data) { - mainContent.html($("#changeAppearance").tmpl()); - var organisationInformation=new OrganisationInformation(data.name,data.url,data.logoLocation); - var organisationInformationViewModel=new OrganisationInformationViewModel(organisationInformation); - ko.applyBindings(organisationInformationViewModel, mainContent.get(0)); - var validator = $("#main-content" ).find("#appearance-configuration-form-id") - .validate({ - showErrors: function(validator,errorMap,errorList) { - customShowError(mainContent.find("#appearance-configuration-form-id").get(0),validator,errorMap,errorMap); - } - }); - } - }); - } //--------------------------- // UiConfiguration part //--------------------------- - displayUiConfiguration=function(){ + displayUiConfigurationOnly=function(){ screenChange(); var mainContent=$("#main-content"); mainContent.html(mediumSpinnerImg()); @@ -726,6 +707,35 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" } } + displayUiConfiguration=function(){ + var mainContent=$("#main-content"); + + mainContent.html($("#ui-configuration" ).tmpl()); + + mainContent.find("#ui-configuration-form").html(mediumSpinnerImg()); + + $.ajax("restServices/archivaServices/archivaAdministrationService/getUiConfiguration", { + type: "GET", + dataType: 'json', + success: function(data){ + var uiConfiguration=new UiConfiguration(data.showFindArtifacts,data.appletFindEnabled,data.disableEasterEggs, + data.applicationUrl,data.disableRegistration); + var uiConfigurationViewModel=new UiConfigurationViewModel(uiConfiguration); + ko.applyBindings(uiConfigurationViewModel,mainContent.find("#ui-configuration-form").get(0)); + } + }); + + $.ajax("restServices/archivaServices/archivaAdministrationService/getOrganisationInformation", { + type: "GET", + dataType: 'json', + success: function(data) { + var organisationInformation=new OrganisationInformation(data.name,data.url,data.logoLocation); + var organisationInformationViewModel=new OrganisationInformationViewModel(organisationInformation); + ko.applyBindings(organisationInformationViewModel, mainContent.find("#change-appearance-form").get(0)); + activateOrganisationInformationFormValidation(); + } + }); + } //--------------------------- // System status part diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js index e29bb008e..b6bd478cd 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js @@ -228,7 +228,6 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa { text : $.i18n.prop('menu.repository-scanning') , id: "menu-repository-scanning-list-a" , href: "#scanningList" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRepositoryScanning()}}, { text : $.i18n.prop('menu.network-configuration') , id: "menu-network-configuration-list-a" , href: "#network" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayNetworkConfiguration()}}, { text : $.i18n.prop('menu.system-status') , id: "menu-system-status-list-a" , href: "#status" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displaySystemStatus()}}, - { text : $.i18n.prop('menu.appearance-configuration') , id: "menu-appearance-list-a" , href: "#appearance" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayAppearanceConfiguration()}}, { text : $.i18n.prop('menu.ui-configuration') , id: "menu-ui-configuration-list-a" , href: "#uiconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayUiConfiguration()}}, { text : $.i18n.prop('menu.reports') , id: "menu-report-list-a" , href: "#reports" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayReportsPage()}} ]); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html index 0a6463046..fffddb7ee 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html @@ -316,36 +316,6 @@ - - - - + + + + + +