mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 18:14:26 +00:00
DS-1768 Add a default navigation-bar when no one is requested to allow minimal brand and navigation
This commit is contained in:
@@ -131,6 +131,14 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<dspace:include page="<%= navbar %>" />
|
<dspace:include page="<%= navbar %>" />
|
||||||
</div>
|
</div>
|
||||||
|
<%
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%>
|
||||||
|
<div class="container">
|
||||||
|
<dspace:include page="/layout/navbar-minimal.jsp" />
|
||||||
|
</div>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
|
@@ -131,6 +131,14 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<dspace:include page="<%= navbar %>" />
|
<dspace:include page="<%= navbar %>" />
|
||||||
</div>
|
</div>
|
||||||
|
<%
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%>
|
||||||
|
<div class="container">
|
||||||
|
<dspace:include page="/layout/navbar-minimal.jsp" />
|
||||||
|
</div>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
|
99
dspace-jspui/src/main/webapp/layout/navbar-minimal.jsp
Normal file
99
dspace-jspui/src/main/webapp/layout/navbar-minimal.jsp
Normal file
@@ -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();
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="navbar-header">
|
||||||
|
<a class="navbar-brand" href="<%= request.getContextPath() %>/"><img height="25px" src="<%= request.getContextPath() %>/image/dspace-logo-only.png" /></a>
|
||||||
|
</div>
|
||||||
|
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
|
||||||
|
<div class="nav navbar-nav navbar-right">
|
||||||
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
<li class="dropdown">
|
||||||
|
<%
|
||||||
|
if (user != null)
|
||||||
|
{
|
||||||
|
%>
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span> <fmt:message key="jsp.layout.navbar-default.loggedin">
|
||||||
|
<fmt:param><%= StringUtils.abbreviate(navbarEmail, 20) %></fmt:param>
|
||||||
|
</fmt:message> <b class="caret"></b></a>
|
||||||
|
<%
|
||||||
|
} else {
|
||||||
|
%>
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span> <fmt:message key="jsp.layout.navbar-default.sign"/> <b class="caret"></b></a>
|
||||||
|
<% } %>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a href="<%= request.getContextPath() %>/mydspace"><fmt:message key="jsp.layout.navbar-default.users"/></a></li>
|
||||||
|
<li><a href="<%= request.getContextPath() %>/subscribe"><fmt:message key="jsp.layout.navbar-default.receive"/></a></li>
|
||||||
|
<li><a href="<%= request.getContextPath() %>/profile"><fmt:message key="jsp.layout.navbar-default.edit"/></a></li>
|
||||||
|
|
||||||
|
<%
|
||||||
|
if (isAdmin)
|
||||||
|
{
|
||||||
|
%>
|
||||||
|
<li class="divider"></li>
|
||||||
|
<li><a href="<%= request.getContextPath() %>/dspace-admin"><fmt:message key="jsp.administer"/></a></li>
|
||||||
|
<%
|
||||||
|
}
|
||||||
|
if (user != null) {
|
||||||
|
%>
|
||||||
|
<li><a href="<%= request.getContextPath() %>/logout"><span class="glyphicon glyphicon-log-out"></span> <fmt:message key="jsp.layout.navbar-default.logout"/></a></li>
|
||||||
|
<% } %>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</nav>
|
Reference in New Issue
Block a user