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

Thu, 13 May 2021 19:31:09 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 13 May 2021 19:31:09 +0200
changeset 198
94f174d591ab
parent 197
0a2ad22ac656
child 199
59393c8cc557
permissions
-rw-r--r--

fixes wrong handling of feeds - only one channel per feed is allowed

     1 <%-- 
     2 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     4 Copyright 2021 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 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    30 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    31 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
    33 <%-- Make the base href easily available at request scope --%>
    34 <c:set scope="page" var="baseHref" value="${requestScope[Constants.REQ_ATTR_BASE_HREF]}"/>
    36 <%-- The feed URL for this page. --%>
    37 <c:set scope="page" var="feedHref" value="${requestScope[Constants.REQ_ATTR_FEED_HREF]}"/>
    39 <%-- Define an alias for the request path --%>
    40 <c:set scope="page" var="requestPath" value="${requestScope[Constants.REQ_ATTR_PATH]}"/>
    42 <%-- Define an alias for the navigation menu --%>
    43 <c:set scope="page" var="navMenu" value="${requestScope[Constants.REQ_ATTR_NAVIGATION]}"/>
    45 <%-- Define an alias for the content page name --%>
    46 <c:set scope="page" var="contentPage" value="${requestScope[Constants.REQ_ATTR_CONTENT_PAGE]}"/>
    48 <%-- Define an alias for the optional redirect location --%>
    49 <c:set scope="page" var="redirectLocation" value="${requestScope[Constants.REQ_ATTR_REDIRECT_LOCATION]}"/>
    51 <%-- Define an alias for the additional stylesheet --%>
    52 <c:set scope="page" var="extraCss" value="${requestScope[Constants.REQ_ATTR_STYLESHEET]}"/>
    54 <%-- Load resource bundle --%>
    55 <fmt:setLocale scope="request" value="${pageContext.response.locale}"/>
    56 <fmt:setBundle scope="request" basename="localization.strings"/>
    58 <!DOCTYPE html>
    59 <html>
    60 <head>
    61     <base href="${baseHref}">
    62     <title><fmt:message key="app.title"/></title>
    63     <meta charset="UTF-8">
    64     <c:if test="${not empty redirectLocation}">
    65         <meta http-equiv="refresh" content="0; URL=${redirectLocation}">
    66     </c:if>
    67     <link rel="stylesheet" href="lightpit.css" type="text/css">
    68     <link rel="alternate" type="application/rss+xml" title="RSS" href="${feedHref}" />
    69     <c:if test="${not empty extraCss}">
    70         <c:forEach items="${extraCss}" var="cssFile">
    71         <link rel="stylesheet" href="${cssFile}" type="text/css">
    72         </c:forEach>
    73     </c:if>
    74 </head>
    75 <body>
    76 <div id="mainMenu">
    77     <div class="menuEntry" <c:if test="${fn:startsWith(requestPath, '/projects/')}">data-active</c:if> >
    78         <a href="projects/">
    79             <fmt:message key="menu.projects"/>
    80         </a>
    81     </div>
    82     <div class="menuEntry" <c:if test="${fn:startsWith(requestPath, '/users/')}">data-active</c:if> >
    83         <a href="users/">
    84             <fmt:message key="menu.users"/>
    85         </a>
    86     </div>
    87     <div class="menuEntry" <c:if test="${fn:startsWith(requestPath, '/language/')}">data-active</c:if> >
    88         <a href="language/">
    89             <fmt:message key="menu.languages"/>
    90         </a>
    91     </div>
    92 </div>
    93 <div>
    94     <c:if test="${not empty navMenu}">
    95         <div id="sideMenu">
    96             <%@include file="../jspf/navmenu.jspf"%>
    97         </div>
    98     </c:if>
    99     <div id="content-area" <c:if test="${not empty navMenu}">class="sidebar-spacing"</c:if>>
   100         <c:import url="${contentPage}"/>
   101     </div>
   102 </div>
   103 </body>
   104 </html>

mercurial