From cc8eff7c3a0aa2d7a82f76ab57cc6a8bf33bbafa Mon Sep 17 00:00:00 2001 From: Andrea Bollini Date: Mon, 2 Dec 2013 01:16:30 +0100 Subject: [PATCH] DS-1768 Add a default navigation-bar when no one is requested to allow minimal brand and navigation --- .../src/main/webapp/layout/header-default.jsp | 8 ++ .../main/webapp/layout/header-submission.jsp | 8 ++ .../src/main/webapp/layout/navbar-minimal.jsp | 99 +++++++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 dspace-jspui/src/main/webapp/layout/navbar-minimal.jsp diff --git a/dspace-jspui/src/main/webapp/layout/header-default.jsp b/dspace-jspui/src/main/webapp/layout/header-default.jsp index 0ad8443046..250124b2fa 100644 --- a/dspace-jspui/src/main/webapp/layout/header-default.jsp +++ b/dspace-jspui/src/main/webapp/layout/header-default.jsp @@ -133,6 +133,14 @@ <% } + else + { + %> +
+ +
+<% + } %> diff --git a/dspace-jspui/src/main/webapp/layout/header-submission.jsp b/dspace-jspui/src/main/webapp/layout/header-submission.jsp index 4ab16d0fd7..3bee332a94 100644 --- a/dspace-jspui/src/main/webapp/layout/header-submission.jsp +++ b/dspace-jspui/src/main/webapp/layout/header-submission.jsp @@ -133,6 +133,14 @@ <% } + else + { + %> +
+ +
+<% + } %> diff --git a/dspace-jspui/src/main/webapp/layout/navbar-minimal.jsp b/dspace-jspui/src/main/webapp/layout/navbar-minimal.jsp new file mode 100644 index 0000000000..89566aba8b --- /dev/null +++ b/dspace-jspui/src/main/webapp/layout/navbar-minimal.jsp @@ -0,0 +1,99 @@ +<%-- + + The contents of this file are subject to the license and copyright + detailed in the LICENSE and NOTICE files at the root of the source + tree and available online at + + http://www.dspace.org/license/ + +--%> +<%-- + - Default navigation bar +--%> + +<%@page import="org.apache.commons.lang.StringUtils"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> + +<%@ page contentType="text/html;charset=UTF-8" %> + +<%@ taglib uri="/WEB-INF/dspace-tags.tld" prefix="dspace" %> + +<%@ page import="java.util.ArrayList" %> +<%@ page import="java.util.List" %> +<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %> +<%@ page import="org.dspace.app.webui.util.UIUtil" %> +<%@ page import="org.dspace.content.Collection" %> +<%@ page import="org.dspace.content.Community" %> +<%@ page import="org.dspace.eperson.EPerson" %> +<%@ page import="org.dspace.core.ConfigurationManager" %> +<%@ page import="org.dspace.browse.BrowseIndex" %> +<%@ page import="org.dspace.browse.BrowseInfo" %> +<%@ page import="java.util.Map" %> +<% + // Is anyone logged in? + EPerson user = (EPerson) request.getAttribute("dspace.current.user"); + + // Is the logged in user an admin + Boolean admin = (Boolean)request.getAttribute("is.admin"); + boolean isAdmin = (admin == null ? false : admin.booleanValue()); + + // Get the current page, minus query string + String currentPage = UIUtil.getOriginalURL(request); + int c = currentPage.indexOf( '?' ); + if( c > -1 ) + { + currentPage = currentPage.substring( 0, c ); + } + + // E-mail may have to be truncated + String navbarEmail = null; + + if (user != null) + { + navbarEmail = user.getEmail(); + } +%> + + + +