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

     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 pageEncoding="UTF-8" %>
    28 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    29 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    31 <jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.IssueEditView" scope="request"/>
    33 <c:set var="issue" scope="page" value="${viewmodel.issue}" />
    34 <c:set var="project" scope="page" value="${viewmodel.project}"/>
    35 <c:set var="component" scope="page" value="${viewmodel.component}"/>
    36 <c:set var="version" scope="page" value="${viewmodel.version}"/>
    38 <c:set var="issuesHref" value="./projects/${project.node}/issues/${empty version ? '-' : version.node }/${empty component ? '-' : component.node}/"/>
    40 <form action="${issuesHref}-/commit" method="post">
    41     <table class="formtable fullwidth">
    42         <colgroup>
    43             <col>
    44             <col style="width: 100%">
    45         </colgroup>
    46         <tbody>
    47         <c:if test="${viewmodel.issue.id ge 0}">
    48         <tr>
    49             <th><fmt:message key="issue.id"/></th>
    50             <td>${issue.id}</td>
    51         </tr>
    52         </c:if>
    53         <tr>
    54             <th><fmt:message key="project"/></th>
    55             <td>
    56                 <c:choose>
    57                     <c:when test="${issue.project.id ge 0}">
    58                         <c:out value="${issue.project.name}" />
    59                         <input type="hidden" name="project" value="${issue.project.id}" />
    60                     </c:when>
    61                     <c:otherwise>
    62                         <select name="project" required>
    63                             <c:forEach var="project" items="${viewmodel.projects}">
    64                                 <option value="${project.id}">
    65                                     <c:out value="${project.name}" />
    66                                 </option>
    67                             </c:forEach>
    68                         </select>
    69                     </c:otherwise>
    70                 </c:choose>
    71             </td>
    72         </tr>
    73         <tr>
    74             <th><fmt:message key="issue.created"/></th>
    75             <td>
    76                 <c:set var="dateValue" value="${issue.created}"/>
    77                 <%@include file="../jspf/date-with-tooltip.jspf"%>
    78             </td>
    79         </tr>
    80         <tr>
    81             <th><fmt:message key="issue.updated"/></th>
    82             <td>
    83                 <c:set var="dateValue" value="${issue.updated}"/>
    84                 <%@include file="../jspf/date-with-tooltip.jspf"%>
    85             </td>
    86         </tr>
    87         <tr>
    88             <th><fmt:message key="component"/></th>
    89             <td>
    90                 <select name="component">
    91                     <option value="-1"><fmt:message key="placeholder.null-component"/></option>
    92                     <c:forEach var="comp" items="${viewmodel.components}">
    93                         <option
    94                                 <c:if test="${not empty issue.component and comp eq issue.component}">selected</c:if>
    95                                 value="${comp.id}"><c:out value="${comp.name}"/></option>
    96                     </c:forEach>
    97                 </select>
    98             </td>
    99         </tr>
   100         <tr>
   101             <th><fmt:message key="issue.category"/></th>
   102             <td>
   103                 <select name="category">
   104                     <c:forEach var="category" items="${viewmodel.issueCategory}">
   105                         <option
   106                                 <c:if test="${category eq issue.category}">selected</c:if>
   107                                 value="${category}">
   108                             <fmt:message key="issue.category.${category}" />
   109                         </option>
   110                     </c:forEach>
   111                 </select>
   112             </td>
   113         </tr>
   114         <tr>
   115             <th><fmt:message key="issue.status"/></th>
   116             <td>
   117                 <select name="status">
   118                     <c:forEach var="status" items="${viewmodel.issueStatus}">
   119                         <option
   120                                 <c:if test="${status eq issue.status}">selected</c:if>
   121                                 value="${status}">
   122                                 <fmt:message key="issue.status.${status}" />
   123                         </option>
   124                     </c:forEach>
   125                 </select>
   126             </td>
   127         </tr>
   128         <tr>
   129             <th><fmt:message key="issue.subject"/></th>
   130             <td><input name="subject" type="text" maxlength="200" required value="<c:out value="${issue.subject}"/>" /></td>
   131         </tr>
   132         <tr>
   133             <th class="vtop"><fmt:message key="issue.description"/></th>
   134             <td>
   135                 <textarea name="description" rows="10"><c:out value="${issue.description}"/></textarea>
   136             </td>
   137         </tr>
   138         <tr>
   139             <th><fmt:message key="issue.assignee"/></th>
   140             <td>
   141                 <select name="assignee">
   142                     <option value="-2" title="<fmt:message key="placeholder.auto-assignee.tooltip"/>"><fmt:message key="placeholder.auto-assignee"/></option>
   143                     <option value="-1"
   144                             <c:if test="${issue.id ge 0 and empty issue.assignee}">selected</c:if>
   145                     ><fmt:message key="placeholder.null-assignee"/></option>
   146                     <c:forEach var="user" items="${viewmodel.users}">
   147                         <option
   148                                 <c:if test="${not empty issue.assignee and user eq issue.assignee}">selected</c:if>
   149                                 value="${user.id}"><c:out value="${user.displayname}"/></option>
   150                     </c:forEach>
   151                 </select>
   152             </td>
   153         </tr>
   154         <c:if test="${issue.project.id ge 0}">
   155         <tr>
   156             <th class="vtop"><fmt:message key="issue.affected-versions"/></th>
   157             <td>
   158                 <c:set var="fieldname" value="affected"/>
   159                 <c:set var="selectionList" value="${viewmodel.versionsRecent}"/>
   160                 <c:set var="data" value="${issue.affectedVersions}" />
   161                 <%@include file="../jspf/version-list.jspf"%>
   162             </td>
   163         </tr>
   164         <tr>
   165             <th class="vtop"><fmt:message key="issue.resolved-versions"/></th>
   166             <td>
   167                 <c:set var="fieldname" value="resolved"/>
   168                 <c:set var="selectionList" value="${viewmodel.versionsUpcoming}"/>
   169                 <c:set var="data" value="${issue.resolvedVersions}" />
   170                 <%@include file="../jspf/version-list.jspf"%>
   171             </td>
   172         </tr>
   173         </c:if>
   174         <tr>
   175             <th><fmt:message key="issue.eta"/></th>
   176             <td><input name="eta" type="date" value="<fmt:formatDate value="${issue.eta}" pattern="YYYY-MM-dd" />" /> </td>
   177         </tr>
   178         </tbody>
   179         <tfoot>
   180         <tr>
   181             <td colspan="2">
   182                 <input type="checkbox" id="more" name="more" <c:if test="${more}">checked</c:if> />
   183                 <label for="more"><fmt:message key="button.issue.create.another"/> </label>
   184                 <input type="hidden" name="id" value="${issue.id}"/>
   185                 <c:if test="${issue.id ge 0}">
   186                 <a href="${issuesHref}${issue.id}" class="button">
   187                     <fmt:message key="button.cancel"/>
   188                 </a>
   189                 </c:if>
   190                 <c:if test="${issue.id lt 0}">
   191                     <a href="${issuesHref}" class="button">
   192                         <fmt:message key="button.cancel"/>
   193                     </a>
   194                 </c:if>
   195                 <button type="submit"><fmt:message key="button.okay"/></button>
   196             </td>
   197         </tr>
   198         </tfoot>
   199     </table>
   200 </form>

mercurial