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

changeset 71
dca186d3911f
parent 70
821c4950b619
child 74
91d1fc2a3a14
equal deleted inserted replaced
70:821c4950b619 71:dca186d3911f
30 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 30 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
31 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 31 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
32 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 32 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
33 33
34 <%-- Make the base href easily available at request scope --%> 34 <%-- Make the base href easily available at request scope --%>
35 <c:set scope="page" var="baseHref" value="${requestScope[Constants.REQ_ATTR_BASE_HREF]}" /> 35 <c:set scope="page" var="baseHref" value="${requestScope[Constants.REQ_ATTR_BASE_HREF]}"/>
36 36
37 <%-- Define an alias for the request path --%> 37 <%-- Define an alias for the request path --%>
38 <c:set scope="page" var="requestPath" value="${requestScope[Constants.REQ_ATTR_PATH]}"/> 38 <c:set scope="page" var="requestPath" value="${requestScope[Constants.REQ_ATTR_PATH]}"/>
39 39
40 <%-- Define an alias for the main menu --%> 40 <%-- Define an alias for the main menu --%>
41 <c:set scope="page" var="mainMenu" value="${requestScope[Constants.REQ_ATTR_MENU]}"/> 41 <c:set scope="page" var="mainMenu" value="${requestScope[Constants.REQ_ATTR_MENU]}"/>
42
43 <%-- Define an alias for the main menu --%>
44 <c:set scope="page" var="breadcrumbs" value="${requestScope[Constants.REQ_ATTR_BREADCRUMBS]}"/>
42 45
43 <%-- Define an alias for the fragment name --%> 46 <%-- Define an alias for the fragment name --%>
44 <c:set scope="page" var="fragment" value="${requestScope[Constants.REQ_ATTR_FRAGMENT]}"/> 47 <c:set scope="page" var="fragment" value="${requestScope[Constants.REQ_ATTR_FRAGMENT]}"/>
45 48
46 <%-- Define an alias for the optional redirect location --%> 49 <%-- Define an alias for the optional redirect location --%>
52 <%-- Define an alias for the module info --%> 55 <%-- Define an alias for the module info --%>
53 <c:set scope="page" var="moduleInfo" value="${requestScope[Constants.REQ_ATTR_MODULE_INFO]}"/> 56 <c:set scope="page" var="moduleInfo" value="${requestScope[Constants.REQ_ATTR_MODULE_INFO]}"/>
54 57
55 <%-- Apply the session locale (should always be present, but check nevertheless) --%> 58 <%-- Apply the session locale (should always be present, but check nevertheless) --%>
56 <c:if test="${not empty sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"> 59 <c:if test="${not empty sessionScope[Constants.SESSION_ATTR_LANGUAGE]}">
57 <fmt:setLocale scope="request" value="${sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"/> 60 <fmt:setLocale scope="request" value="${sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"/>
58 </c:if> 61 </c:if>
59 62
60 <%-- Selected project, if any --%> 63 <%-- Selected project, if any --%>
61 <c:set scope="page" var="selectedProject" value="${sessionScope[ProjectsModule.SESSION_ATTR_SELECTED_PROJECT]}"/> 64 <c:set scope="page" var="selectedProject" value="${sessionScope[ProjectsModule.SESSION_ATTR_SELECTED_PROJECT]}"/>
62 65
63 <!DOCTYPE html> 66 <!DOCTYPE html>
64 <html> 67 <html>
65 <head> 68 <head>
66 <base href="${baseHref}"> 69 <base href="${baseHref}">
67 <title>LightPIT - 70 <title>LightPIT -
68 <fmt:bundle basename="${moduleInfo.bundleBaseName}"> 71 <fmt:bundle basename="${moduleInfo.bundleBaseName}">
69 <fmt:message key="${moduleInfo.titleKey}" /> 72 <fmt:message key="${moduleInfo.titleKey}"/>
70 </fmt:bundle> 73 </fmt:bundle>
71 </title> 74 </title>
72 <meta charset="UTF-8"> 75 <meta charset="UTF-8">
73 <c:if test="${not empty redirectLocation}"> 76 <c:if test="${not empty redirectLocation}">
74 <meta http-equiv="refresh" content="0; URL=${redirectLocation}"> 77 <meta http-equiv="refresh" content="0; URL=${redirectLocation}">
75 </c:if> 78 </c:if>
76 <link rel="stylesheet" href="lightpit.css" type="text/css"> 79 <link rel="stylesheet" href="lightpit.css" type="text/css">
77 <c:if test="${not empty extraCss}"> 80 <c:if test="${not empty extraCss}">
78 <link rel="stylesheet" href="${extraCss}" type="text/css"> 81 <link rel="stylesheet" href="${extraCss}" type="text/css">
79 </c:if> 82 </c:if>
80 </head> 83 </head>
81 <body> 84 <body>
82 <div id="mainMenu"> 85 <div id="mainMenu">
83 <c:forEach var="menu" items="${mainMenu}"> 86 <c:forEach var="menu" items="${mainMenu}">
84 <div class="menuEntry" 87 <%@include file="../jspf/menu-entry.jsp" %>
85 <c:set var="menuPath" value="/${menu.pathName}"/> 88 </c:forEach>
86 <c:if test="${fn:startsWith(requestPath, menuPath)}"> 89 </div>
87 data-active 90 <c:if test="${not empty breadcrumbs}">
88 </c:if> 91 <div id="breadcrumbs">
89 > 92 <c:forEach var="menu" items="${breadcrumbs}">
90 <a href="${menu.pathName}"> 93 <%@include file="../jspf/menu-entry.jsp" %>
91 <fmt:bundle basename="${menu.resourceKey.bundle}"> 94 </c:forEach>
92 <fmt:message key="${menu.resourceKey.key}"/> 95 </div>
93 </fmt:bundle> 96 </c:if>
94 </a> 97 <div id="content-area">
95 </div> 98 <c:if test="${not empty fragment}">
96 </c:forEach> 99 <fmt:setBundle scope="request" basename="${moduleInfo.bundleBaseName}"/>
97 </div> 100 <fmt:setBundle scope="request" var="lightpit_bundle" basename="localization.lightpit"/>
98 <div id="breadcrumbs"> 101 <c:import url="${fragment}"/>
99 <%-- TODO: find a strategy to define the breadcrumbs --%> 102 </c:if>
100 </div> 103 </div>
101 <div id="content-area"> 104 </body>
102 <c:if test="${not empty fragment}">
103 <fmt:setBundle scope="request" basename="${moduleInfo.bundleBaseName}"/>
104 <fmt:setBundle scope="request" var="lightpit_bundle" basename="localization.lightpit"/>
105 <c:import url="${fragment}" />
106 </c:if>
107 </div>
108 </body>
109 </html> 105 </html>

mercurial