src/main/webapp/WEB-INF/jsp/site.jsp

changeset 71
dca186d3911f
parent 70
821c4950b619
child 74
91d1fc2a3a14
     1.1 --- a/src/main/webapp/WEB-INF/jsp/site.jsp	Tue May 19 19:34:57 2020 +0200
     1.2 +++ b/src/main/webapp/WEB-INF/jsp/site.jsp	Fri May 22 16:21:31 2020 +0200
     1.3 @@ -32,7 +32,7 @@
     1.4  <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
     1.5  
     1.6  <%-- Make the base href easily available at request scope --%>
     1.7 -<c:set scope="page" var="baseHref" value="${requestScope[Constants.REQ_ATTR_BASE_HREF]}" />
     1.8 +<c:set scope="page" var="baseHref" value="${requestScope[Constants.REQ_ATTR_BASE_HREF]}"/>
     1.9  
    1.10  <%-- Define an alias for the request path --%>
    1.11  <c:set scope="page" var="requestPath" value="${requestScope[Constants.REQ_ATTR_PATH]}"/>
    1.12 @@ -40,6 +40,9 @@
    1.13  <%-- Define an alias for the main menu --%>
    1.14  <c:set scope="page" var="mainMenu" value="${requestScope[Constants.REQ_ATTR_MENU]}"/>
    1.15  
    1.16 +<%-- Define an alias for the main menu --%>
    1.17 +<c:set scope="page" var="breadcrumbs" value="${requestScope[Constants.REQ_ATTR_BREADCRUMBS]}"/>
    1.18 +
    1.19  <%-- Define an alias for the fragment name --%>
    1.20  <c:set scope="page" var="fragment" value="${requestScope[Constants.REQ_ATTR_FRAGMENT]}"/>
    1.21  
    1.22 @@ -54,7 +57,7 @@
    1.23  
    1.24  <%-- Apply the session locale (should always be present, but check nevertheless) --%>
    1.25  <c:if test="${not empty sessionScope[Constants.SESSION_ATTR_LANGUAGE]}">
    1.26 -<fmt:setLocale scope="request" value="${sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"/>
    1.27 +    <fmt:setLocale scope="request" value="${sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"/>
    1.28  </c:if>
    1.29  
    1.30  <%-- Selected project, if any --%>
    1.31 @@ -62,48 +65,41 @@
    1.32  
    1.33  <!DOCTYPE html>
    1.34  <html>
    1.35 -    <head>
    1.36 -        <base href="${baseHref}">
    1.37 -        <title>LightPIT -
    1.38 -            <fmt:bundle basename="${moduleInfo.bundleBaseName}">
    1.39 -                <fmt:message key="${moduleInfo.titleKey}" />
    1.40 -            </fmt:bundle>
    1.41 -        </title>
    1.42 -        <meta charset="UTF-8">
    1.43 -        <c:if test="${not empty redirectLocation}">
    1.44 +<head>
    1.45 +    <base href="${baseHref}">
    1.46 +    <title>LightPIT -
    1.47 +        <fmt:bundle basename="${moduleInfo.bundleBaseName}">
    1.48 +            <fmt:message key="${moduleInfo.titleKey}"/>
    1.49 +        </fmt:bundle>
    1.50 +    </title>
    1.51 +    <meta charset="UTF-8">
    1.52 +    <c:if test="${not empty redirectLocation}">
    1.53          <meta http-equiv="refresh" content="0; URL=${redirectLocation}">
    1.54 -        </c:if>
    1.55 -        <link rel="stylesheet" href="lightpit.css" type="text/css">
    1.56 -        <c:if test="${not empty extraCss}">
    1.57 +    </c:if>
    1.58 +    <link rel="stylesheet" href="lightpit.css" type="text/css">
    1.59 +    <c:if test="${not empty extraCss}">
    1.60          <link rel="stylesheet" href="${extraCss}" type="text/css">
    1.61 -        </c:if>
    1.62 -    </head>
    1.63 -    <body>
    1.64 -        <div id="mainMenu">
    1.65 -            <c:forEach var="menu" items="${mainMenu}">
    1.66 -                <div class="menuEntry"
    1.67 -                        <c:set var="menuPath" value="/${menu.pathName}"/>
    1.68 -                        <c:if test="${fn:startsWith(requestPath, menuPath)}">
    1.69 -                            data-active
    1.70 -                        </c:if>
    1.71 -                >
    1.72 -                    <a href="${menu.pathName}">
    1.73 -                        <fmt:bundle basename="${menu.resourceKey.bundle}">
    1.74 -                            <fmt:message key="${menu.resourceKey.key}"/>
    1.75 -                        </fmt:bundle>
    1.76 -                    </a>
    1.77 -                </div>
    1.78 -            </c:forEach>
    1.79 -        </div>
    1.80 -        <div id="breadcrumbs">
    1.81 -            <%-- TODO: find a strategy to define the breadcrumbs  --%>
    1.82 -        </div>
    1.83 -        <div id="content-area">
    1.84 -            <c:if test="${not empty fragment}">
    1.85 -                <fmt:setBundle scope="request" basename="${moduleInfo.bundleBaseName}"/>
    1.86 -                <fmt:setBundle scope="request" var="lightpit_bundle" basename="localization.lightpit"/>
    1.87 -                <c:import url="${fragment}" />
    1.88 -            </c:if>
    1.89 -        </div>
    1.90 -    </body>
    1.91 +    </c:if>
    1.92 +</head>
    1.93 +<body>
    1.94 +<div id="mainMenu">
    1.95 +    <c:forEach var="menu" items="${mainMenu}">
    1.96 +        <%@include file="../jspf/menu-entry.jsp" %>
    1.97 +    </c:forEach>
    1.98 +</div>
    1.99 +<c:if test="${not empty breadcrumbs}">
   1.100 +    <div id="breadcrumbs">
   1.101 +        <c:forEach var="menu" items="${breadcrumbs}">
   1.102 +            <%@include file="../jspf/menu-entry.jsp" %>
   1.103 +        </c:forEach>
   1.104 +    </div>
   1.105 +</c:if>
   1.106 +<div id="content-area">
   1.107 +    <c:if test="${not empty fragment}">
   1.108 +        <fmt:setBundle scope="request" basename="${moduleInfo.bundleBaseName}"/>
   1.109 +        <fmt:setBundle scope="request" var="lightpit_bundle" basename="localization.lightpit"/>
   1.110 +        <c:import url="${fragment}"/>
   1.111 +    </c:if>
   1.112 +</div>
   1.113 +</body>
   1.114  </html>

mercurial