src/main/webapp/WEB-INF/jsp/issue-form.jsp

Thu, 13 May 2021 10:23:37 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 13 May 2021 10:23:37 +0200
changeset 194
2b3b7d0a885e
parent 186
05eec764facd
child 212
c50da26a6d31
permissions
-rw-r--r--

fixes wrong default component selection

universe@75 1 <%--
universe@75 2 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
universe@75 3
universe@180 4 Copyright 2021 Mike Becker. All rights reserved.
universe@75 5
universe@75 6 Redistribution and use in source and binary forms, with or without
universe@75 7 modification, are permitted provided that the following conditions are met:
universe@75 8
universe@75 9 1. Redistributions of source code must retain the above copyright
universe@75 10 notice, this list of conditions and the following disclaimer.
universe@75 11
universe@75 12 2. Redistributions in binary form must reproduce the above copyright
universe@75 13 notice, this list of conditions and the following disclaimer in the
universe@75 14 documentation and/or other materials provided with the distribution.
universe@75 15
universe@75 16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
universe@75 17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
universe@75 18 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
universe@75 19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
universe@75 20 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
universe@75 21 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
universe@75 22 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
universe@75 23 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
universe@75 24 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
universe@75 25 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
universe@75 26 --%>
universe@75 27 <%@page pageEncoding="UTF-8" %>
universe@75 28 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
universe@75 29 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
universe@75 30
universe@86 31 <jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.IssueEditView" scope="request"/>
universe@184 32
universe@86 33 <c:set var="issue" scope="page" value="${viewmodel.issue}" />
universe@184 34 <c:set var="project" scope="page" value="${viewmodel.project}"/>
universe@184 35 <c:set var="component" scope="page" value="${viewmodel.component}"/>
universe@184 36 <c:set var="version" scope="page" value="${viewmodel.version}"/>
universe@75 37
universe@184 38 <c:set var="issuesHref" value="./projects/${project.node}/issues/${empty version ? '-' : version.node }/${empty component ? '-' : component.node}/"/>
universe@184 39
universe@186 40 <form action="${issuesHref}-/commit" method="post">
universe@124 41 <table class="formtable fullwidth">
universe@75 42 <colgroup>
universe@75 43 <col>
universe@124 44 <col style="width: 100%">
universe@75 45 </colgroup>
universe@75 46 <tbody>
universe@113 47 <c:if test="${viewmodel.issue.id ge 0}">
universe@75 48 <tr>
universe@108 49 <th><fmt:message key="issue.id"/></th>
universe@108 50 <td>${issue.id}</td>
universe@108 51 </tr>
universe@113 52 </c:if>
universe@108 53 <tr>
universe@181 54 <th><fmt:message key="project"/></th>
universe@76 55 <td>
universe@86 56 <c:choose>
universe@184 57 <c:when test="${issue.project.id ge 0}">
universe@86 58 <c:out value="${issue.project.name}" />
universe@184 59 <input type="hidden" name="project" value="${issue.project.id}" />
universe@86 60 </c:when>
universe@86 61 <c:otherwise>
universe@184 62 <select name="project" required>
universe@86 63 <c:forEach var="project" items="${viewmodel.projects}">
universe@86 64 <option value="${project.id}">
universe@86 65 <c:out value="${project.name}" />
universe@86 66 </option>
universe@86 67 </c:forEach>
universe@86 68 </select>
universe@86 69 </c:otherwise>
universe@86 70 </c:choose>
universe@76 71 </td>
universe@76 72 </tr>
universe@76 73 <tr>
universe@103 74 <th><fmt:message key="issue.created"/></th>
universe@156 75 <td>
universe@156 76 <c:set var="dateValue" value="${issue.created}"/>
universe@156 77 <%@include file="../jspf/date-with-tooltip.jspf"%>
universe@156 78 </td>
universe@103 79 </tr>
universe@103 80 <tr>
universe@103 81 <th><fmt:message key="issue.updated"/></th>
universe@156 82 <td>
universe@156 83 <c:set var="dateValue" value="${issue.updated}"/>
universe@156 84 <%@include file="../jspf/date-with-tooltip.jspf"%>
universe@156 85 </td>
universe@103 86 </tr>
universe@103 87 <tr>
universe@181 88 <th><fmt:message key="component"/></th>
universe@134 89 <td>
universe@134 90 <select name="component">
universe@134 91 <option value="-1"><fmt:message key="placeholder.null-component"/></option>
universe@186 92 <c:forEach var="comp" items="${viewmodel.components}">
universe@134 93 <option
universe@186 94 <c:if test="${not empty issue.component and comp eq issue.component}">selected</c:if>
universe@186 95 value="${comp.id}"><c:out value="${comp.name}"/></option>
universe@134 96 </c:forEach>
universe@134 97 </select>
universe@134 98 </td>
universe@134 99 </tr>
universe@134 100 <tr>
universe@82 101 <th><fmt:message key="issue.category"/></th>
universe@75 102 <td>
universe@75 103 <select name="category">
universe@86 104 <c:forEach var="category" items="${viewmodel.issueCategory}">
universe@75 105 <option
universe@75 106 <c:if test="${category eq issue.category}">selected</c:if>
universe@75 107 value="${category}">
universe@75 108 <fmt:message key="issue.category.${category}" />
universe@75 109 </option>
universe@75 110 </c:forEach>
universe@75 111 </select>
universe@75 112 </td>
universe@75 113 </tr>
universe@75 114 <tr>
universe@82 115 <th><fmt:message key="issue.status"/></th>
universe@75 116 <td>
universe@75 117 <select name="status">
universe@86 118 <c:forEach var="status" items="${viewmodel.issueStatus}">
universe@75 119 <option
universe@75 120 <c:if test="${status eq issue.status}">selected</c:if>
universe@75 121 value="${status}">
universe@75 122 <fmt:message key="issue.status.${status}" />
universe@75 123 </option>
universe@75 124 </c:forEach>
universe@75 125 </select>
universe@75 126 </td>
universe@75 127 </tr>
universe@75 128 <tr>
universe@82 129 <th><fmt:message key="issue.subject"/></th>
universe@85 130 <td><input name="subject" type="text" maxlength="200" required value="<c:out value="${issue.subject}"/>" /></td>
universe@75 131 </tr>
universe@75 132 <tr>
universe@82 133 <th class="vtop"><fmt:message key="issue.description"/></th>
universe@75 134 <td>
universe@86 135 <textarea name="description" rows="10"><c:out value="${issue.description}"/></textarea>
universe@75 136 </td>
universe@75 137 </tr>
universe@75 138 <tr>
universe@82 139 <th><fmt:message key="issue.assignee"/></th>
universe@75 140 <td>
universe@75 141 <select name="assignee">
universe@136 142 <option value="-2" title="<fmt:message key="placeholder.auto-assignee.tooltip"/>"><fmt:message key="placeholder.auto-assignee"/></option>
universe@136 143 <option value="-1"
universe@136 144 <c:if test="${issue.id ge 0 and empty issue.assignee}">selected</c:if>
universe@136 145 ><fmt:message key="placeholder.null-assignee"/></option>
universe@86 146 <c:forEach var="user" items="${viewmodel.users}">
universe@75 147 <option
universe@75 148 <c:if test="${not empty issue.assignee and user eq issue.assignee}">selected</c:if>
universe@75 149 value="${user.id}"><c:out value="${user.displayname}"/></option>
universe@75 150 </c:forEach>
universe@75 151 </select>
universe@75 152 </td>
universe@75 153 </tr>
universe@83 154 <c:if test="${issue.project.id ge 0}">
universe@75 155 <tr>
universe@83 156 <th class="vtop"><fmt:message key="issue.affected-versions"/></th>
universe@83 157 <td>
universe@83 158 <c:set var="fieldname" value="affected"/>
universe@90 159 <c:set var="selectionList" value="${viewmodel.versionsRecent}"/>
universe@83 160 <c:set var="data" value="${issue.affectedVersions}" />
universe@115 161 <%@include file="../jspf/version-list.jspf"%>
universe@83 162 </td>
universe@75 163 </tr>
universe@75 164 <tr>
universe@83 165 <th class="vtop"><fmt:message key="issue.resolved-versions"/></th>
universe@83 166 <td>
universe@83 167 <c:set var="fieldname" value="resolved"/>
universe@90 168 <c:set var="selectionList" value="${viewmodel.versionsUpcoming}"/>
universe@83 169 <c:set var="data" value="${issue.resolvedVersions}" />
universe@115 170 <%@include file="../jspf/version-list.jspf"%>
universe@83 171 </td>
universe@75 172 </tr>
universe@83 173 </c:if>
universe@75 174 <tr>
universe@82 175 <th><fmt:message key="issue.eta"/></th>
universe@75 176 <td><input name="eta" type="date" value="<fmt:formatDate value="${issue.eta}" pattern="YYYY-MM-dd" />" /> </td>
universe@75 177 </tr>
universe@75 178 </tbody>
universe@75 179 <tfoot>
universe@75 180 <tr>
universe@75 181 <td colspan="2">
universe@185 182 <input type="checkbox" id="more" name="more" <c:if test="${more}">checked</c:if> />
universe@185 183 <label for="more"><fmt:message key="button.issue.create.another"/> </label>
universe@75 184 <input type="hidden" name="id" value="${issue.id}"/>
universe@146 185 <c:if test="${issue.id ge 0}">
universe@184 186 <a href="${issuesHref}${issue.id}" class="button">
universe@180 187 <fmt:message key="button.cancel"/>
universe@75 188 </a>
universe@146 189 </c:if>
universe@146 190 <c:if test="${issue.id lt 0}">
universe@184 191 <a href="${issuesHref}" class="button">
universe@180 192 <fmt:message key="button.cancel"/>
universe@146 193 </a>
universe@146 194 </c:if>
universe@180 195 <button type="submit"><fmt:message key="button.okay"/></button>
universe@75 196 </td>
universe@75 197 </tr>
universe@75 198 </tfoot>
universe@75 199 </table>
universe@75 200 </form>

mercurial