From 3bca31ea14889568adcb0041fcd324294725b906 Mon Sep 17 00:00:00 2001 From: j2blake Date: Wed, 20 Nov 2013 17:06:48 -0500 Subject: [PATCH] VIVO-541 Rearrange the links on the site admin page. --- .../languages/es_GO/i18n/all_es_GO.properties | 2 +- .../freemarker/BaseSiteAdminController.java | 12 +++---- webapp/web/i18n/all.properties | 2 +- .../siteAdmin/siteAdmin-indexCacheRebuild.ftl | 27 ---------------- .../body/siteAdmin/siteAdmin-main.ftl | 2 +- .../siteAdmin/siteAdmin-siteConfiguration.ftl | 4 --- .../siteAdmin/siteAdmin-siteMaintenance.ftl | 31 +++++++++++++++++++ 7 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-indexCacheRebuild.ftl create mode 100644 webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-siteMaintenance.ftl diff --git a/webapp/languages/es_GO/i18n/all_es_GO.properties b/webapp/languages/es_GO/i18n/all_es_GO.properties index 85e25c9cf..5544aafb0 100644 --- a/webapp/languages/es_GO/i18n/all_es_GO.properties +++ b/webapp/languages/es_GO/i18n/all_es_GO.properties @@ -444,7 +444,7 @@ please_create = Por favor, cree a_classgroup = un grupo de clase associate_classes_with_group = y las clases asociadas con el grupo creado. -refresh_content = Actualizar contenido +site_maintenance = Mantenimiento del sitio rebuild_search_index = Reconstruir índice de búsqueda rebuild_vis_cache = Reconstruir caché de visualización recompute_inferences_mixed_caps = Inferencias Recompute diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/BaseSiteAdminController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/BaseSiteAdminController.java index fd988add8..1a10c92a3 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/BaseSiteAdminController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/BaseSiteAdminController.java @@ -53,14 +53,14 @@ public class BaseSiteAdminController extends FreemarkerHttpServlet { body.put("dataInput", getDataInputData(vreq)); body.put("siteConfig", getSiteConfigData(vreq)); - body.put("indexCacheRebuild", getIndexCacheRebuildUrls(vreq)); + body.put("siteMaintenance", getSiteMaintenanceUrls(vreq)); body.put("ontologyEditor", getOntologyEditorData(vreq)); body.put("dataTools", getDataToolsUrls(vreq)); return new TemplateResponseValues(TEMPLATE_DEFAULT, body); } - protected Map getIndexCacheRebuildUrls(VitroRequest vreq) { + protected Map getSiteMaintenanceUrls(VitroRequest vreq) { Map urls = new HashMap(); @@ -73,6 +73,10 @@ public class BaseSiteAdminController extends FreemarkerHttpServlet { urls.put("rebuildSearchIndex", UrlBuilder.getUrl("/SearchIndex")); } + if (PolicyHelper.isAuthorizedForActions(vreq, SimplePermission.LOGIN_DURING_MAINTENANCE.ACTIONS)) { + urls.put("restrictLogins", UrlBuilder.getUrl("/admin/restrictLogins")); + } + if (PolicyHelper.isAuthorizedForActions(vreq, SimplePermission.ENABLE_DEVELOPER_PANEL.ACTIONS)) { urls.put("activateDeveloperPanel", "javascript:new DeveloperPanel(developerAjaxUrl).setupDeveloperPanel({developerEnabled: true});"); } @@ -147,10 +151,6 @@ public class BaseSiteAdminController extends FreemarkerHttpServlet { data.put("startupStatusAlert", !StartupStatus.getBean(getServletContext()).allClear()); } - if (PolicyHelper.isAuthorizedForActions(vreq, SimplePermission.LOGIN_DURING_MAINTENANCE.ACTIONS)) { - data.put("restrictLogins", UrlBuilder.getUrl("/admin/restrictLogins")); - } - return data; } diff --git a/webapp/web/i18n/all.properties b/webapp/web/i18n/all.properties index 336d1fefc..d201b66c9 100644 --- a/webapp/web/i18n/all.properties +++ b/webapp/web/i18n/all.properties @@ -456,7 +456,7 @@ please_create = Please create a_classgroup = a class group associate_classes_with_group = and associate classes with the group created. -refresh_content = Refresh Content +site_maintenance = Site Maintenance rebuild_search_index = Rebuild search index rebuild_vis_cache = Rebuild visualization cache recompute_inferences_mixed_caps = Recompute inferences diff --git a/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-indexCacheRebuild.ftl b/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-indexCacheRebuild.ftl deleted file mode 100644 index c2317ce27..000000000 --- a/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-indexCacheRebuild.ftl +++ /dev/null @@ -1,27 +0,0 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> - -<#-- Template for the main Site Administration page --> - -<#if indexCacheRebuild?has_content> -
-

${i18n().refresh_content}

- - -
- \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-main.ftl b/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-main.ftl index ef8bb2242..e957d435f 100644 --- a/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-main.ftl +++ b/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-main.ftl @@ -13,5 +13,5 @@ ${stylesheets.add('') <#include "siteAdmin-siteConfiguration.ftl"> <#include "siteAdmin-ontologyEditor.ftl"> <#include "siteAdmin-advancedDataTools.ftl"> - <#include "siteAdmin-indexCacheRebuild.ftl"> + <#include "siteAdmin-siteMaintenance.ftl"> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-siteConfiguration.ftl b/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-siteConfiguration.ftl index eb9a38c76..8ea8df055 100644 --- a/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-siteConfiguration.ftl +++ b/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-siteConfiguration.ftl @@ -23,10 +23,6 @@
  • ${i18n().menu_ordering_mixed_caps}
  • - <#if siteConfig.restrictLogins?has_content> -
  • ${i18n().restrict_logins_mixed_caps}
  • - - <#if siteConfig.siteInfo?has_content>
  • ${i18n().site_information}
  • diff --git a/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-siteMaintenance.ftl b/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-siteMaintenance.ftl new file mode 100644 index 000000000..ab1a20189 --- /dev/null +++ b/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-siteMaintenance.ftl @@ -0,0 +1,31 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Template for the main Site Administration page --> + +<#if siteMaintenance?has_content> +
    +

    ${i18n().site_maintenance}

    + + +
    + \ No newline at end of file