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

Sat, 23 May 2020 13:34:41 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 23 May 2020 13:34:41 +0200
changeset 77
192298f8161f
parent 74
91d1fc2a3a14
child 78
bb4c52bf3439
permissions
-rw-r--r--

bloat removal 1/3 - configurable resource keys

     1 <%-- 
     2 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     4 Copyright 2018 Mike Becker. All rights reserved.
     6 Redistribution and use in source and binary forms, with or without
     7 modification, are permitted provided that the following conditions are met:
     9 1. Redistributions of source code must retain the above copyright
    10 notice, this list of conditions and the following disclaimer.
    12 2. Redistributions in binary form must reproduce the above copyright
    13 notice, this list of conditions and the following disclaimer in the
    14 documentation and/or other materials provided with the distribution.
    16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    18 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    20 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    21 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    22 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    23 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    24 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    25 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    26 --%>
    27 <%@page contentType="text/html" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
    28 <%@page import="de.uapcore.lightpit.Constants" %>
    29 <%@page import="de.uapcore.lightpit.modules.ProjectsModule" %>
    30 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    31 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    32 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
    34 <%-- Make the base href easily available at request scope --%>
    35 <c:set scope="page" var="baseHref" value="${requestScope[Constants.REQ_ATTR_BASE_HREF]}"/>
    37 <%-- Define an alias for the request path --%>
    38 <c:set scope="page" var="requestPath" value="${requestScope[Constants.REQ_ATTR_PATH]}"/>
    40 <%-- Define an alias for the main menu --%>
    41 <c:set scope="page" var="mainMenu" value="${requestScope[Constants.REQ_ATTR_MENU]}"/>
    43 <%-- Define an alias for the main menu --%>
    44 <c:set scope="page" var="breadcrumbs" value="${requestScope[Constants.REQ_ATTR_BREADCRUMBS]}"/>
    46 <%-- Define an alias for the content page name --%>
    47 <c:set scope="page" var="contentPage" value="${requestScope[Constants.REQ_ATTR_CONTENT_PAGE]}"/>
    49 <%-- Define an alias for the optional redirect location --%>
    50 <c:set scope="page" var="redirectLocation" value="${requestScope[Constants.REQ_ATTR_REDIRECT_LOCATION]}"/>
    52 <%-- Define an alias for the additional stylesheet --%>
    53 <c:set scope="page" var="extraCss" value="${requestScope[Constants.REQ_ATTR_STYLESHEET]}"/>
    55 <%-- Define an alias for the module info --%>
    56 <c:set scope="page" var="moduleInfo" value="${requestScope[Constants.REQ_ATTR_MODULE_INFO]}"/>
    58 <%-- Apply the session locale (should always be present, but check nevertheless) --%>
    59 <c:if test="${not empty sessionScope[Constants.SESSION_ATTR_LANGUAGE]}">
    60     <fmt:setLocale scope="request" value="${sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"/>
    61 </c:if>
    63 <%-- Selected project, if any --%>
    64 <c:set scope="page" var="selectedProject" value="${sessionScope[ProjectsModule.SESSION_ATTR_SELECTED_PROJECT]}"/>
    66 <!DOCTYPE html>
    67 <html>
    68 <head>
    69     <base href="${baseHref}">
    70     <title>LightPIT -
    71         <fmt:bundle basename="${moduleInfo.bundleBaseName}">
    72             <fmt:message key="pageTitle"/>
    73         </fmt:bundle>
    74     </title>
    75     <meta charset="UTF-8">
    76     <c:if test="${not empty redirectLocation}">
    77         <meta http-equiv="refresh" content="0; URL=${redirectLocation}">
    78     </c:if>
    79     <link rel="stylesheet" href="lightpit.css" type="text/css">
    80     <c:if test="${not empty extraCss}">
    81         <link rel="stylesheet" href="${extraCss}" type="text/css">
    82     </c:if>
    83 </head>
    84 <body>
    85 <div id="mainMenu">
    86     <c:forEach var="menu" items="${mainMenu}">
    87         <%@include file="../jspf/menu-entry.jsp" %>
    88     </c:forEach>
    89 </div>
    90 <c:if test="${not empty breadcrumbs}">
    91     <div id="breadcrumbs">
    92         <c:forEach var="menu" items="${breadcrumbs}">
    93             <%@include file="../jspf/menu-entry.jsp" %>
    94         </c:forEach>
    95     </div>
    96 </c:if>
    97 <div id="content-area">
    98     <c:if test="${not empty contentPage}">
    99         <fmt:setBundle scope="request" basename="${moduleInfo.bundleBaseName}"/>
   100         <fmt:setBundle scope="request" var="lightpit_bundle" basename="localization.lightpit"/>
   101         <c:import url="${contentPage}"/>
   102     </c:if>
   103 </div>
   104 </body>
   105 </html>

mercurial