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

Sun, 04 Apr 2021 13:03:41 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 04 Apr 2021 13:03:41 +0200
changeset 186
05eec764facd
parent 185
5ec9fcfbdf9c
child 194
2b3b7d0a885e
permissions
-rw-r--r--

fixes some minor migration regressions

     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                                 <c:if test="${empty issue.component and comp eq comp}">selected</c:if>
    96                                 value="${comp.id}"><c:out value="${comp.name}"/></option>
    97                     </c:forEach>
    98                 </select>
    99             </td>
   100         </tr>
   101         <tr>
   102             <th><fmt:message key="issue.category"/></th>
   103             <td>
   104                 <select name="category">
   105                     <c:forEach var="category" items="${viewmodel.issueCategory}">
   106                         <option
   107                                 <c:if test="${category eq issue.category}">selected</c:if>
   108                                 value="${category}">
   109                             <fmt:message key="issue.category.${category}" />
   110                         </option>
   111                     </c:forEach>
   112                 </select>
   113             </td>
   114         </tr>
   115         <tr>
   116             <th><fmt:message key="issue.status"/></th>
   117             <td>
   118                 <select name="status">
   119                     <c:forEach var="status" items="${viewmodel.issueStatus}">
   120                         <option
   121                                 <c:if test="${status eq issue.status}">selected</c:if>
   122                                 value="${status}">
   123                                 <fmt:message key="issue.status.${status}" />
   124                         </option>
   125                     </c:forEach>
   126                 </select>
   127             </td>
   128         </tr>
   129         <tr>
   130             <th><fmt:message key="issue.subject"/></th>
   131             <td><input name="subject" type="text" maxlength="200" required value="<c:out value="${issue.subject}"/>" /></td>
   132         </tr>
   133         <tr>
   134             <th class="vtop"><fmt:message key="issue.description"/></th>
   135             <td>
   136                 <textarea name="description" rows="10"><c:out value="${issue.description}"/></textarea>
   137             </td>
   138         </tr>
   139         <tr>
   140             <th><fmt:message key="issue.assignee"/></th>
   141             <td>
   142                 <select name="assignee">
   143                     <option value="-2" title="<fmt:message key="placeholder.auto-assignee.tooltip"/>"><fmt:message key="placeholder.auto-assignee"/></option>
   144                     <option value="-1"
   145                             <c:if test="${issue.id ge 0 and empty issue.assignee}">selected</c:if>
   146                     ><fmt:message key="placeholder.null-assignee"/></option>
   147                     <c:forEach var="user" items="${viewmodel.users}">
   148                         <option
   149                                 <c:if test="${not empty issue.assignee and user eq issue.assignee}">selected</c:if>
   150                                 value="${user.id}"><c:out value="${user.displayname}"/></option>
   151                     </c:forEach>
   152                 </select>
   153             </td>
   154         </tr>
   155         <c:if test="${issue.project.id ge 0}">
   156         <tr>
   157             <th class="vtop"><fmt:message key="issue.affected-versions"/></th>
   158             <td>
   159                 <c:set var="fieldname" value="affected"/>
   160                 <c:set var="selectionList" value="${viewmodel.versionsRecent}"/>
   161                 <c:set var="data" value="${issue.affectedVersions}" />
   162                 <%@include file="../jspf/version-list.jspf"%>
   163             </td>
   164         </tr>
   165         <tr>
   166             <th class="vtop"><fmt:message key="issue.resolved-versions"/></th>
   167             <td>
   168                 <c:set var="fieldname" value="resolved"/>
   169                 <c:set var="selectionList" value="${viewmodel.versionsUpcoming}"/>
   170                 <c:set var="data" value="${issue.resolvedVersions}" />
   171                 <%@include file="../jspf/version-list.jspf"%>
   172             </td>
   173         </tr>
   174         </c:if>
   175         <tr>
   176             <th><fmt:message key="issue.eta"/></th>
   177             <td><input name="eta" type="date" value="<fmt:formatDate value="${issue.eta}" pattern="YYYY-MM-dd" />" /> </td>
   178         </tr>
   179         </tbody>
   180         <tfoot>
   181         <tr>
   182             <td colspan="2">
   183                 <input type="checkbox" id="more" name="more" <c:if test="${more}">checked</c:if> />
   184                 <label for="more"><fmt:message key="button.issue.create.another"/> </label>
   185                 <input type="hidden" name="id" value="${issue.id}"/>
   186                 <c:if test="${issue.id ge 0}">
   187                 <a href="${issuesHref}${issue.id}" class="button">
   188                     <fmt:message key="button.cancel"/>
   189                 </a>
   190                 </c:if>
   191                 <c:if test="${issue.id lt 0}">
   192                     <a href="${issuesHref}" class="button">
   193                         <fmt:message key="button.cancel"/>
   194                     </a>
   195                 </c:if>
   196                 <button type="submit"><fmt:message key="button.okay"/></button>
   197             </td>
   198         </tr>
   199         </tfoot>
   200     </table>
   201 </form>

mercurial