Sat, 23 May 2020 13:24:49 +0200
issue and version form now also work if no project is selected in the session
universe@51 | 1 | <%-- |
universe@51 | 2 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
universe@51 | 3 | |
universe@51 | 4 | Copyright 2018 Mike Becker. All rights reserved. |
universe@51 | 5 | |
universe@51 | 6 | Redistribution and use in source and binary forms, with or without |
universe@51 | 7 | modification, are permitted provided that the following conditions are met: |
universe@51 | 8 | |
universe@51 | 9 | 1. Redistributions of source code must retain the above copyright |
universe@51 | 10 | notice, this list of conditions and the following disclaimer. |
universe@51 | 11 | |
universe@51 | 12 | 2. Redistributions in binary form must reproduce the above copyright |
universe@51 | 13 | notice, this list of conditions and the following disclaimer in the |
universe@51 | 14 | documentation and/or other materials provided with the distribution. |
universe@51 | 15 | |
universe@51 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
universe@51 | 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
universe@51 | 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
universe@51 | 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
universe@51 | 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
universe@51 | 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
universe@51 | 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
universe@51 | 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
universe@51 | 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
universe@51 | 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
universe@51 | 26 | --%> |
universe@51 | 27 | <%@page pageEncoding="UTF-8" %> |
universe@51 | 28 | <%@page import="de.uapcore.lightpit.Constants" %> |
universe@51 | 29 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> |
universe@51 | 30 | <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> |
universe@51 | 31 | |
universe@51 | 32 | <c:set scope="page" var="moduleInfo" value="${requestScope[Constants.REQ_ATTR_MODULE_INFO]}"/> |
universe@51 | 33 | |
universe@76 | 34 | <jsp:useBean id="projects" type="java.util.List<de.uapcore.lightpit.entities.Project>" scope="request" /> |
universe@59 | 35 | <jsp:useBean id="version" type="de.uapcore.lightpit.entities.Version" scope="request"/> |
universe@72 | 36 | <jsp:useBean id="versionStatusEnum" type="de.uapcore.lightpit.entities.VersionStatus[]" scope="request"/> |
universe@51 | 37 | |
universe@59 | 38 | <form action="./${moduleInfo.modulePath}/versions/commit" method="post"> |
universe@51 | 39 | <table class="formtable" style="width: 35ch"> |
universe@51 | 40 | <colgroup> |
universe@51 | 41 | <col> |
universe@51 | 42 | <col style="width: 100%"> |
universe@51 | 43 | </colgroup> |
universe@51 | 44 | <tbody> |
universe@51 | 45 | <tr> |
universe@76 | 46 | <th><fmt:message key="thead.version.project"/></th> |
universe@76 | 47 | <td> |
universe@76 | 48 | <select name="pid" required> |
universe@76 | 49 | <c:forEach var="project" items="${projects}"> |
universe@76 | 50 | <option value="${project.id}" <c:if test="${project eq version.project}">selected</c:if> > |
universe@76 | 51 | <c:out value="${project.name}" /> |
universe@76 | 52 | </option> |
universe@76 | 53 | </c:forEach> |
universe@76 | 54 | </select> |
universe@76 | 55 | </td> |
universe@76 | 56 | </tr> |
universe@76 | 57 | <tr> |
universe@59 | 58 | <th><fmt:message key="thead.version.name"/></th> |
universe@75 | 59 | <td><input name="name" type="text" maxlength="20" required value="<c:out value="${version.name}"/>" /></td> |
universe@51 | 60 | </tr> |
universe@51 | 61 | <tr> |
universe@59 | 62 | <th><fmt:message key="thead.version.status"/></th> |
universe@59 | 63 | <td> |
universe@59 | 64 | <select name="status" required> |
universe@59 | 65 | <c:forEach var="elem" items="${versionStatusEnum}"> |
universe@72 | 66 | <option |
universe@72 | 67 | <c:if test="${elem eq version.status}">selected</c:if> value="${elem}"><fmt:message |
universe@72 | 68 | key="version.status.${elem}"/></option> |
universe@59 | 69 | </c:forEach> |
universe@59 | 70 | </select> |
universe@59 | 71 | </td> |
universe@51 | 72 | </tr> |
universe@59 | 73 | <tr title="<fmt:message key="tooltip.ordinal" />"> |
universe@59 | 74 | <th><fmt:message key="thead.version.ordinal"/></th> |
universe@59 | 75 | <td> |
universe@72 | 76 | <input name="ordinal" type="number" min="0" value="${version.ordinal}"/> |
universe@59 | 77 | </td> |
universe@51 | 78 | </tr> |
universe@51 | 79 | </tbody> |
universe@51 | 80 | <tfoot> |
universe@51 | 81 | <tr> |
universe@51 | 82 | <td colspan="2"> |
universe@72 | 83 | <input type="hidden" name="id" value="${version.id}"/> |
universe@76 | 84 | <c:choose> |
universe@76 | 85 | <c:when test="${not empty version.project and version.project.id ge 0}"> |
universe@76 | 86 | <c:set var="cancelUrl">./${moduleInfo.modulePath}/view?pid=${version.project.id}</c:set> |
universe@76 | 87 | </c:when> |
universe@76 | 88 | <c:otherwise> |
universe@76 | 89 | <c:set var="cancelUrl">./${moduleInfo.modulePath}/</c:set> |
universe@76 | 90 | </c:otherwise> |
universe@76 | 91 | </c:choose> |
universe@76 | 92 | <a href="${cancelUrl}" class="button"> |
universe@75 | 93 | <fmt:message bundle="${lightpit_bundle}" key="button.cancel"/> |
universe@75 | 94 | </a> |
universe@72 | 95 | <button type="submit"><fmt:message bundle="${lightpit_bundle}" key="button.okay"/></button> |
universe@51 | 96 | </td> |
universe@51 | 97 | </tr> |
universe@51 | 98 | </tfoot> |
universe@51 | 99 | </table> |
universe@51 | 100 | </form> |