VIVO-541 Add a link on the Site Admin page to activate the developer panel.

This commit is contained in:
j2blake 2013-11-19 16:45:13 -05:00
parent 025f2dd8ec
commit b3c5892679
5 changed files with 19 additions and 4 deletions

View file

@ -481,6 +481,9 @@ restrict_logins_mixed_caps = Restringir conexiones
site_information = Información del sitio
user_accounts = Las cuentas de usuario
activate_developer_panel = Activar el panel desarrollador
activate_developer_panel_mixed_caps = Activar el panel desarrollador
#
# search controller ( PagedSearchController.java )
#

View file

@ -73,6 +73,10 @@ public class BaseSiteAdminController extends FreemarkerHttpServlet {
urls.put("rebuildSearchIndex", UrlBuilder.getUrl("/SearchIndex"));
}
if (PolicyHelper.isAuthorizedForActions(vreq, SimplePermission.ENABLE_DEVELOPER_PANEL.ACTIONS)) {
urls.put("activateDeveloperPanel", "javascript:new DeveloperPanel(developerAjaxUrl).setupDeveloperPanel({developerEnabled: true});");
}
return urls;
}

View file

@ -493,6 +493,9 @@ restrict_logins_mixed_caps = Restrict logins
site_information = Site information
user_accounts = User accounts
activate_developer_panel = Activate developer panel
activate_developer_panel_mixed_caps = Activate developer panel
#
# search controller ( PagedSearchController.java )
#

View file

@ -1,9 +1,9 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
function DeveloperPanel(developerAjaxUrl) {
this.setupDeveloperPanel = updateDeveloperPanel;
function updateDeveloperPanel(data) {
function DeveloperPanel(developerAjaxUrl) {
this.setupDeveloperPanel = updateDeveloperPanel;
function updateDeveloperPanel(data) {
$.ajax({
url: developerAjaxUrl,
dataType: "json",
@ -79,3 +79,4 @@
$(document).ready(function() {
new DeveloperPanel(developerAjaxUrl).setupDeveloperPanel({});
});

View file

@ -18,6 +18,10 @@
<#if indexCacheRebuild.recomputeInferences?has_content>
<li role="listitem"><a href="${indexCacheRebuild.recomputeInferences}" title="${i18n().recompute_inferences}">${i18n().recompute_inferences_mixed_caps}</a></li>
</#if>
<#if indexCacheRebuild.activateDeveloperPanel?has_content>
<li role="listitem"><a href="${indexCacheRebuild.activateDeveloperPanel}" title="${i18n().activate_developer_panel}">${i18n().activate_developer_panel_mixed_caps}</a></li>
</#if>
</ul>
</section>
</#if>