diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/BrowseController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/BrowseController.java index a284f2d69..100b7b25c 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/BrowseController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/BrowseController.java @@ -43,56 +43,51 @@ import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassGroupTemplateMo public class BrowseController extends FreemarkerHttpServlet { static final long serialVersionUID=2006030721126L; - + private static final Log log = LogFactory.getLog(BrowseController.class); - private static final String TEMPLATE_DEFAULT = "classGroups.ftl"; + private static final String TEMPLATE_DEFAULT = "classGroups.ftl"; @Override protected String getTitle(String siteName, VitroRequest vreq) { - return "Index to " + siteName + " Contents"; + return "Index of Contents"; } - + @Override protected ResponseValues processRequest(VitroRequest vreq) { - + Map body = new HashMap(); String message = null; String templateName = TEMPLATE_DEFAULT; - if( vreq.getParameter("clearcache") != null ) //mainly for debugging - clearGroupCache(); - - int portalId = vreq.getPortalId(); - - List groups = null; - VClassGroupCache vcgc = VClassGroupCache.getVClassGroupCache(getServletContext()); - if( vcgc == null ){ - log.error("Could not get VClassGroupCache"); - message = "The system is not configured correctly. Please check your logs for error messages."; - }else{ - groups =vcgc.getGroups( vreq.getPortalId()); - if (groups == null || groups.isEmpty()) { - message = "There are not yet any items in the system."; + if ( vreq.getParameter("clearcache") != null ) //mainly for debugging + clearGroupCache(); + + int portalId = vreq.getPortalId(); + + List groups = null; + VClassGroupCache vcgc = VClassGroupCache.getVClassGroupCache(getServletContext()); + if ( vcgc == null ) { + log.error("Could not get VClassGroupCache"); + message = "The system is not configured correctly. Please check your logs for error messages."; + } else { + groups =vcgc.getGroups( vreq.getPortalId()); + List vcgroups = new ArrayList(groups.size()); + for (VClassGroup group : groups) { + vcgroups.add(new VClassGroupTemplateModel(group)); } - else { - List vcgroups = new ArrayList(groups.size()); - for (VClassGroup group : groups) { - vcgroups.add(new VClassGroupTemplateModel(group)); - } - body.put("classGroups", vcgroups); - } - } - - if (message != null) { - body.put("message", message); - templateName = Template.TITLED_MESSAGE.toString(); - } - + body.put("classGroups", vcgroups); + } + + if (message != null) { + body.put("message", message); + templateName = Template.TITLED_MESSAGE.toString(); + } + return new TemplateResponseValues(templateName, body); } protected void clearGroupCache(){ VClassGroupCache.getVClassGroupCache(getServletContext()).clearGroupCache(); } -} +} \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/partials/browse-classgroups.ftl b/webapp/web/templates/freemarker/body/partials/browse-classgroups.ftl index 8bb721ac6..cf97e76d2 100644 --- a/webapp/web/templates/freemarker/body/partials/browse-classgroups.ftl +++ b/webapp/web/templates/freemarker/body/partials/browse-classgroups.ftl @@ -90,9 +90,13 @@ ${stylesheets.add("/css/browseClassGroups.css")} <#-- <#include "classgroups-checkForData.ftl"> -->

There is currently no content in the system

- <#if !user.loggedIn> + <#if user.loggedIn> + <#if user.hasSiteAdminAccess> +

You can add content and manage this site from the Site Administration page.

+ + <#else>

Please log in to manage content.

- + diff --git a/webapp/web/templates/freemarker/body/partials/classgroups-checkForData.ftl b/webapp/web/templates/freemarker/body/partials/classgroups-checkForData.ftl index 2f45a0c37..a5f2aa40d 100644 --- a/webapp/web/templates/freemarker/body/partials/classgroups-checkForData.ftl +++ b/webapp/web/templates/freemarker/body/partials/classgroups-checkForData.ftl @@ -17,7 +17,11 @@ <#assign noDataNotification>

There is currently no content in the system

- <#if !user.loggedIn> + <#if user.loggedIn> + <#if user.hasSiteAdminAccess> +

You can add content and manage this site from the Site Administration page.

+ + <#else>

Please log in to manage content.

\ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/partials/menupage/menupage-checkForData.ftl b/webapp/web/templates/freemarker/body/partials/menupage/menupage-checkForData.ftl index 34867e28e..1c68d30a5 100644 --- a/webapp/web/templates/freemarker/body/partials/menupage/menupage-checkForData.ftl +++ b/webapp/web/templates/freemarker/body/partials/menupage/menupage-checkForData.ftl @@ -19,7 +19,11 @@ <#assign noDataNotification>

There is currently no ${page.title} content in the system

- <#if !user.loggedIn> + <#if user.loggedIn> + <#if user.hasSiteAdminAccess> +

You can add content and manage this site from the Site Administration page.

+ + <#else>

Please log in to manage content.