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

changeset 45
cc7f082c5ef3
parent 43
9abf0bf44c7b
child 46
1574965c7dc7
--- a/src/main/webapp/WEB-INF/jsp/site.jsp	Wed May 13 18:55:05 2020 +0200
+++ b/src/main/webapp/WEB-INF/jsp/site.jsp	Wed May 13 21:10:23 2020 +0200
@@ -30,9 +30,15 @@
 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
 
+<%-- Define an alias for the request path --%>
+<c:set scope="page" var="requestPath" value="${requestScope[Constants.REQ_ATTR_PATH]}"/>
+
 <%-- Define an alias for the main menu --%>
 <c:set scope="page" var="mainMenu" value="${requestScope[Constants.REQ_ATTR_MENU]}"/>
 
+<%-- Define an alias for the sub menu --%>
+<c:set scope="page" var="subMenu" value="${requestScope[Constants.REQ_ATTR_SUB_MENU]}"/>
+
 <%-- Define an alias for the fragment name --%>
 <c:set scope="page" var="fragment" value="${requestScope[Constants.REQ_ATTR_FRAGMENT]}"/>
 
@@ -65,22 +71,16 @@
     <body>
         <div id="mainMenu">
             <c:forEach var="menu" items="${mainMenu}">
-                <div class="menuEntry"
-                     <c:if test="${requestScope[Constants.REQ_ATTR_MODULE_CLASSNAME] eq menu.moduleClassName}">
-                         data-active
-                     </c:if>
-                >
-                    <a href="${menu.pathName}">
-                    <fmt:bundle basename="${menu.resourceKey.bundle}">
-                        <fmt:message key="${menu.resourceKey.key}" />
-                    </fmt:bundle>
-                    </a>
-                </div>
+                <%@ include file="../jspf/menu-entry.jspf" %>
             </c:forEach>
         </div>
-        <div id="subMenu">
-            
-        </div>
+        <c:if test="${not empty subMenu}">
+            <div id="subMenu">
+                <c:forEach var="menu" items="${subMenu}">
+                    <%@ include file="../jspf/menu-entry.jspf" %>
+                </c:forEach>
+            </div>
+        </c:if>
         <div id="content-area">
             <c:if test="${not empty fragment}">
                 <fmt:setBundle scope="request" basename="${moduleInfo.bundleBaseName}"/>

mercurial