src/main/webapp/WEB-INF/dynamic_fragments/projects.jsp

Sat, 16 May 2020 15:45:06 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 16 May 2020 15:45:06 +0200
changeset 53
6a8498291606
parent 52
67a02e79b7a1
child 59
c759c60507a2
permissions
-rw-r--r--

fixes bug where displaying an error page for missing data source would also require that data source (error pages don't try to get database connections now)

also improves error pages in general

universe@47 1 <%--
universe@47 2 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
universe@47 3
universe@47 4 Copyright 2018 Mike Becker. All rights reserved.
universe@47 5
universe@47 6 Redistribution and use in source and binary forms, with or without
universe@47 7 modification, are permitted provided that the following conditions are met:
universe@47 8
universe@47 9 1. Redistributions of source code must retain the above copyright
universe@47 10 notice, this list of conditions and the following disclaimer.
universe@47 11
universe@47 12 2. Redistributions in binary form must reproduce the above copyright
universe@47 13 notice, this list of conditions and the following disclaimer in the
universe@47 14 documentation and/or other materials provided with the distribution.
universe@47 15
universe@47 16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
universe@47 17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
universe@47 18 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
universe@47 19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
universe@47 20 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
universe@47 21 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
universe@47 22 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
universe@47 23 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
universe@47 24 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
universe@47 25 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
universe@47 26 --%>
universe@47 27 <%@page pageEncoding="UTF-8" %>
universe@47 28 <%@page import="de.uapcore.lightpit.Constants" %>
universe@52 29 <%@page import="de.uapcore.lightpit.modules.ProjectsModule" %>
universe@47 30 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
universe@47 31 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
universe@47 32
universe@47 33 <c:set scope="page" var="moduleInfo" value="${requestScope[Constants.REQ_ATTR_MODULE_INFO]}"/>
universe@52 34 <c:set scope="page" var="selectedProject" value="${sessionScope[ProjectsModule.SESSION_ATTR_SELECTED_PROJECT]}"/>
universe@47 35
universe@47 36 <jsp:useBean id="projects" type="java.util.List<de.uapcore.lightpit.entities.Project>" scope="request"/>
universe@47 37
universe@47 38 <c:if test="${empty projects}">
universe@47 39 <div class="info-box">
universe@47 40 <fmt:message key="no-projects" />
universe@47 41 </div>
universe@47 42 </c:if>
universe@47 43
universe@47 44 <div id="tool-area">
universe@47 45 <a href="./${moduleInfo.modulePath}/edit" class="button"><fmt:message key="button.create" /></a>
universe@47 46 </div>
universe@47 47
universe@47 48 <c:if test="${not empty projects}">
universe@52 49 <table id="project-list" class="datatable medskip">
universe@47 50 <colgroup>
universe@47 51 <col>
universe@51 52 <col style="width: 10%">
universe@47 53 <col style="width: 35%">
universe@47 54 <col style="width: 30%">
universe@51 55 <col style="width: 25%">
universe@47 56 </colgroup>
universe@47 57 <thead>
universe@47 58 <tr>
universe@47 59 <th></th>
universe@47 60 <th><fmt:message key="thead.name"/></th>
universe@47 61 <th><fmt:message key="thead.description"/></th>
universe@47 62 <th><fmt:message key="thead.repoUrl"/></th>
universe@47 63 <th><fmt:message key="thead.owner"/></th>
universe@47 64 </tr>
universe@47 65 </thead>
universe@47 66 <tbody>
universe@47 67 <c:forEach var="project" items="${projects}">
universe@52 68 <tr class="nowrap" <c:if test="${project eq selectedProject}">data-selected</c:if> >
universe@51 69 <td style="width: 2em;"><a href="./${moduleInfo.modulePath}/edit?id=${project.id}">&#x270e;</a></td>
universe@52 70 <td><a href="./${moduleInfo.modulePath}?select=${project.id}"><c:out value="${project.name}"/></a></td>
universe@47 71 <td><c:out value="${project.description}"/></td>
universe@47 72 <td>
universe@47 73 <c:if test="${not empty project.repoUrl}">
universe@47 74 <a target="_blank" href="<c:out value="${project.repoUrl}"/>"><c:out value="${project.repoUrl}"/></a>
universe@47 75 </c:if>
universe@47 76 </td>
universe@47 77 <td>
universe@47 78 <c:if test="${not empty project.owner}"><c:out value="${project.owner.displayname}"/></c:if>
universe@47 79 <c:if test="${empty project.owner}"><fmt:message key="placeholder.null-owner" /></c:if>
universe@47 80 </td>
universe@47 81 </tr>
universe@47 82 </c:forEach>
universe@47 83 </tbody>
universe@47 84 </table>
universe@47 85 </c:if>

mercurial