--- a/src/main/webapp/WEB-INF/jsp/site.jsp Tue May 19 19:34:57 2020 +0200 +++ b/src/main/webapp/WEB-INF/jsp/site.jsp Fri May 22 16:21:31 2020 +0200 @@ -32,7 +32,7 @@ <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%-- Make the base href easily available at request scope --%> -<c:set scope="page" var="baseHref" value="${requestScope[Constants.REQ_ATTR_BASE_HREF]}" /> +<c:set scope="page" var="baseHref" value="${requestScope[Constants.REQ_ATTR_BASE_HREF]}"/> <%-- Define an alias for the request path --%> <c:set scope="page" var="requestPath" value="${requestScope[Constants.REQ_ATTR_PATH]}"/> @@ -40,6 +40,9 @@ <%-- Define an alias for the main menu --%> <c:set scope="page" var="mainMenu" value="${requestScope[Constants.REQ_ATTR_MENU]}"/> +<%-- Define an alias for the main menu --%> +<c:set scope="page" var="breadcrumbs" value="${requestScope[Constants.REQ_ATTR_BREADCRUMBS]}"/> + <%-- Define an alias for the fragment name --%> <c:set scope="page" var="fragment" value="${requestScope[Constants.REQ_ATTR_FRAGMENT]}"/> @@ -54,7 +57,7 @@ <%-- Apply the session locale (should always be present, but check nevertheless) --%> <c:if test="${not empty sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"> -<fmt:setLocale scope="request" value="${sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"/> + <fmt:setLocale scope="request" value="${sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"/> </c:if> <%-- Selected project, if any --%> @@ -62,48 +65,41 @@ <!DOCTYPE html> <html> - <head> - <base href="${baseHref}"> - <title>LightPIT - - <fmt:bundle basename="${moduleInfo.bundleBaseName}"> - <fmt:message key="${moduleInfo.titleKey}" /> - </fmt:bundle> - </title> - <meta charset="UTF-8"> - <c:if test="${not empty redirectLocation}"> +<head> + <base href="${baseHref}"> + <title>LightPIT - + <fmt:bundle basename="${moduleInfo.bundleBaseName}"> + <fmt:message key="${moduleInfo.titleKey}"/> + </fmt:bundle> + </title> + <meta charset="UTF-8"> + <c:if test="${not empty redirectLocation}"> <meta http-equiv="refresh" content="0; URL=${redirectLocation}"> - </c:if> - <link rel="stylesheet" href="lightpit.css" type="text/css"> - <c:if test="${not empty extraCss}"> + </c:if> + <link rel="stylesheet" href="lightpit.css" type="text/css"> + <c:if test="${not empty extraCss}"> <link rel="stylesheet" href="${extraCss}" type="text/css"> - </c:if> - </head> - <body> - <div id="mainMenu"> - <c:forEach var="menu" items="${mainMenu}"> - <div class="menuEntry" - <c:set var="menuPath" value="/${menu.pathName}"/> - <c:if test="${fn:startsWith(requestPath, menuPath)}"> - data-active - </c:if> - > - <a href="${menu.pathName}"> - <fmt:bundle basename="${menu.resourceKey.bundle}"> - <fmt:message key="${menu.resourceKey.key}"/> - </fmt:bundle> - </a> - </div> - </c:forEach> - </div> - <div id="breadcrumbs"> - <%-- TODO: find a strategy to define the breadcrumbs --%> - </div> - <div id="content-area"> - <c:if test="${not empty fragment}"> - <fmt:setBundle scope="request" basename="${moduleInfo.bundleBaseName}"/> - <fmt:setBundle scope="request" var="lightpit_bundle" basename="localization.lightpit"/> - <c:import url="${fragment}" /> - </c:if> - </div> - </body> + </c:if> +</head> +<body> +<div id="mainMenu"> + <c:forEach var="menu" items="${mainMenu}"> + <%@include file="../jspf/menu-entry.jsp" %> + </c:forEach> +</div> +<c:if test="${not empty breadcrumbs}"> + <div id="breadcrumbs"> + <c:forEach var="menu" items="${breadcrumbs}"> + <%@include file="../jspf/menu-entry.jsp" %> + </c:forEach> + </div> +</c:if> +<div id="content-area"> + <c:if test="${not empty fragment}"> + <fmt:setBundle scope="request" basename="${moduleInfo.bundleBaseName}"/> + <fmt:setBundle scope="request" var="lightpit_bundle" basename="localization.lightpit"/> + <c:import url="${fragment}"/> + </c:if> +</div> +</body> </html>