topNav.jsp 6.9 KB
Newer Older
1
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
2
3
4
5
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="tpl" tagdir="/WEB-INF/tags" %>
6
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
7

8
<tiles:importAttribute name="collapsePanel" ignore="true" />
9

10
11
12
13
14
15
16
17
18
19
20
<header>
	<nav class="navbar navbar-expand-xl bg-primary navbar-dark">
	
		<div class="container-fluid" style="max-width: 1200px">
	
			<button class="navbar-toggler" type="button" data-toggle="collapse"
				data-target="#navbarSupportedContent"
				aria-controls="navbarSupportedContent" aria-expanded="false"
				aria-label="Toggle navigation">
	
				<span class="ti-menu"></span>
21
				<s:message code="~eu.dariah.de.minfba.common.labels.menu" />
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
			</button>
		
			<div class="collapse navbar-collapse" id="navbarSupportedContent">
				<ul class="navbar-nav mr-auto">
					<c:forEach items="${_nav.rootItems}" var="_navItem">
	    				<c:set var="hide" value="false" />
						<c:forEach items="${_navItem.attributes}" var="attr">
					        <c:if test="${customSearch!=null && customSearch.staticCustomSearch==false && attr.key=='hideInCustomSearch' && attr.value==true}">
					        	<c:set var="hide" value="true" />
					        </c:if>
					    </c:forEach>
	    				<c:if test="${hide==false && (_navItem.authRequired==false ||  ( (_navItem.authRequired==true && _auth!=null && _auth.auth==true) &&
							( _navItem.authMinLevel==0 || (_navItem.authMinLevel<=_auth.level)) ))}">
		    				<c:choose>
				    			<c:when test="${_navItem.subItems!=null && fn:length(_navItem.subItems)>0}">					
									<li class="nav-item dropdown<c:if test="${_navItem.active || _navItem.childActive}"> active</c:if>">
										<a class="nav-link" href="#" id="${_navItem.id}Dropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 
											<c:if test="${_navItem.iconClass!=null && fn:length(_navItem.iconClass)>0}">
												<i class="${_navItem.iconClass}"></i>&nbsp;
											</c:if>
42
43
44
45
											<c:if test="${_navItem.displayCode!=null && fn:length(_navItem.displayCode)>0}">
												<s:message code="${_navItem.displayCode}" />
											</c:if>&nbsp;
											<span class="ti-angle-down"></span>
46
47
48
49
50
51
52
53
54
55
56
57
										</a>
										<div class="dropdown-menu" aria-labelledby="${_navItem.id}Dropdown">
											<tpl:topNav navItem="${_navItem}" />
										</div>
									</li>
				    			</c:when>
				    			<c:otherwise>
				    				<li class="nav-item<c:if test="${_navItem.active || _navItem.childActive}"> active</c:if>">
										<a class="nav-link" href="<s:url value='${_navItem.linkUrl}'/>">
											<c:if test="${_navItem.iconClass!=null && fn:length(_navItem.iconClass)>0}">
												<i class="${_navItem.iconClass}"></i>&nbsp;
											</c:if>
58
59
60
											<c:if test="${_navItem.displayCode!=null && fn:length(_navItem.displayCode)>0}">
												<s:message code="${_navItem.displayCode}" />
											</c:if>
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
										</a>
									</li>
				    			</c:otherwise>
			    			</c:choose>
		    			</c:if>
					</c:forEach>
				</ul>
			</div>
			
			<div class="navbar-expand" id="navbarSupportedContent2" style="margin-right: 40px;">
			
				<!-- Language, login, search -->
				<ul class="navbar-nav">
					<li class="nav-item dropdown navbar-separator">
						<a class="nav-link" href="#" id="languageDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="ti-world"></span> 
							<c:forEach items="${_LANGUAGES}" var="_LANGUAGE">
								<c:if test="${_LANGUAGE.key==pageContext.response.locale}">
									${_LANGUAGE.value}
								</c:if>	
							</c:forEach>
						</a>
						<div class="dropdown-menu" aria-labelledby="languageDropdown">
							<c:forEach items="${_LANGUAGES}" var="_LANGUAGE">
								<a class="dropdown-item" href="?lang=${_LANGUAGE.key}">${_LANGUAGE.value}</a>
							</c:forEach>
						</div>
					</li>
					<li class="nav-item">
89
						<c:set var="currentUrl" value="${requestScope['javax.servlet.forward.request_uri']}" />
90
91
92
93
94
95
96
97
98
						<c:choose>
							<c:when test="${_auth==null || _auth.auth!=true}">
								<a class="nav-link account_toggle" href="<s:url value='/login?url=${currentUrl}' />"><span class="ti-login"></span></a>
							</c:when>
							<c:otherwise>
								<a class="nav-link account_toggle" href="<s:url value='/logout' />"><span class="ti-logout"></span></a>
							</c:otherwise>
						</c:choose>
					</li>
99
100
101
102
103
					<c:if test="${_auth!=null && _auth.auth==true}">
						<li class="nav-item">
							<a class="nav-link" href="<s:url value='/user' />" title="${_auth.displayName}"><span class="ti-user"></span></a>
						</li>
					</c:if>
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
	
					<c:if test="${collapsePanel!=null}">
			        	<li class="nav-item navbar-separator grid-xl-hidden">
							<a class="nav-link version-panel-toggle collapse-panel-trigger" href="javascript:void"><i class="fas fa-archive fa-lg"></i></a>
						</li>
			        </c:if>
				</ul>
			</div>
			
		</div>
		<div class="container-fluid "style="position: absolute; top: 0; right: 0; width: 55px; padding: 0;">
			<div class="grid-hidden grid-xl-visible">
				<ul class="navbar-nav float-right">
					<c:if test="${collapsePanel!=null}">
			        	<li class="nav-item navbar-separator" style="width: 55px;">
							<a class="nav-link version-panel-toggle collapse-panel-trigger" href="javascript:void"><i class="fas fa-archive fa-lg"></i></a>
						</li>
			        </c:if>
			    </ul>
123
124
			</div>
		</div>
125
126
127
	</nav>
	<h1 class="logobar">
		<a class="logobar-link<c:if test="${smallLogo==true}"> logobar-link-sm</c:if>" href="" title="Startseite">
Gradl, Tobias's avatar
Gradl, Tobias committed
128
			<img class="logobar-logo" src='<s:url value="/resources/img/logos/mww-green.svg" />' alt="DARIAH-DE">
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
			<span class="logobar-title">
				<c:choose>
					<c:when test="${smallLogo==true}">
						<c:choose>
							<c:when test="${customSearch!=null}">
			   					<h1>${customSearch.name}</h1>
			   				</c:when>
			   				<c:otherwise>
			   					<s:message code="~eu.dariah.de.minfba.search.view.titles.generic_search" />
			   				</c:otherwise>
		   				</c:choose>
					</c:when>
					<c:otherwise>
						<c:choose>
							<c:when test="${customSearch!=null}">
			   					<h1>${customSearch.name}</h1>
			   				</c:when>
			   				<c:otherwise>
			   					<s:message code="~eu.dariah.de.minfba.search.view.titles.generic_search.br" />
			   				</c:otherwise>
		   				</c:choose>
					</c:otherwise>
				</c:choose>
			</span>
			
154
155
156
157
158
159
		</a>
	</h1>
</header>
<input id="currentUrl" type="hidden" value="${requestScope['javax.servlet.forward.request_uri']}" />
<input id="baseUrl" type="hidden" value="<s:url value="/" />" />
<input id="baseUrl2" type="hidden" value="<s:url value="/{}" />" />
160
161
162
<input type="hidden" id="uauth" value="${_auth!=null && _auth.auth==true}" />
<input type="hidden" id="ulevel" value="${_auth.level}" />