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

Sat, 26 Dec 2020 20:19:09 +0100

author
Mike Becker <universe@uap-core.de>
date
Sat, 26 Dec 2020 20:19:09 +0100
changeset 168
1c3694ae224c
parent 156
c5d6820d884e
child 178
88207b860cba
permissions
-rw-r--r--

adds "Create another" checkbox to issue form - fixes #110

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

mercurial