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

Mon, 09 Aug 2021 16:22:56 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 09 Aug 2021 16:22:56 +0200
changeset 214
69647ddb57f2
parent 212
c50da26a6d31
child 227
f0ede8046b59
permissions
-rw-r--r--

#153 adds comment box to issues form

     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     <input type="hidden" name="project" value="${issue.project.id}" />
    42     <table class="formtable fullwidth">
    43         <colgroup>
    44             <col>
    45             <col style="width: 100%">
    46         </colgroup>
    47         <tbody>
    48         <c:if test="${viewmodel.issue.id ge 0}">
    49         <tr>
    50             <th><fmt:message key="issue.id"/></th>
    51             <td>${issue.id}</td>
    52         </tr>
    53         </c:if>
    54         <tr>
    55             <th><label for="issue-component"><fmt:message key="component"/></label></th>
    56             <td>
    57                 <select id="issue-component" name="component">
    58                     <option value="-1"><fmt:message key="placeholder.null-component"/></option>
    59                     <c:forEach var="comp" items="${viewmodel.components}">
    60                         <option
    61                                 <c:if test="${not empty issue.component and comp eq issue.component}">selected</c:if>
    62                                 value="${comp.id}"><c:out value="${comp.name}"/></option>
    63                     </c:forEach>
    64                 </select>
    65             </td>
    66         </tr>
    67         <tr>
    68             <th><label for="issue-category"><fmt:message key="issue.category"/></label></th>
    69             <td>
    70                 <select id="issue-category" name="category">
    71                     <c:forEach var="category" items="${viewmodel.issueCategory}">
    72                         <option
    73                                 <c:if test="${category eq issue.category}">selected</c:if>
    74                                 value="${category}">
    75                             <fmt:message key="issue.category.${category}" />
    76                         </option>
    77                     </c:forEach>
    78                 </select>
    79             </td>
    80         </tr>
    81         <tr>
    82             <th><label for="issue-status"><fmt:message key="issue.status"/></label></th>
    83             <td>
    84                 <select id="issue-status" name="status">
    85                     <c:forEach var="status" items="${viewmodel.issueStatus}">
    86                         <option
    87                                 <c:if test="${status eq issue.status}">selected</c:if>
    88                                 value="${status}">
    89                                 <fmt:message key="issue.status.${status}" />
    90                         </option>
    91                     </c:forEach>
    92                 </select>
    93             </td>
    94         </tr>
    95         <tr>
    96             <th><label for="issue-subject"><fmt:message key="issue.subject"/></label></th>
    97             <td><input id="issue-subject" name="subject" type="text" maxlength="200" required value="<c:out value="${issue.subject}"/>" /></td>
    98         </tr>
    99         <tr>
   100             <th class="vtop"><label for="issue-description"><fmt:message key="issue.description"/></label></th>
   101             <td>
   102                 <textarea id="issue-description" name="description" rows="10"><c:out value="${issue.description}"/></textarea>
   103             </td>
   104         </tr>
   105         <tr>
   106             <th><label for="issue-assignee"><fmt:message key="issue.assignee"/></label></th>
   107             <td>
   108                 <select id="issue-assignee" name="assignee">
   109                     <option value="-2" title="<fmt:message key="placeholder.auto-assignee.tooltip"/>"><fmt:message key="placeholder.auto-assignee"/></option>
   110                     <option value="-1"
   111                             <c:if test="${issue.id ge 0 and empty issue.assignee}">selected</c:if>
   112                     ><fmt:message key="placeholder.null-assignee"/></option>
   113                     <c:forEach var="user" items="${viewmodel.users}">
   114                         <option
   115                                 <c:if test="${not empty issue.assignee and user eq issue.assignee}">selected</c:if>
   116                                 value="${user.id}"><c:out value="${user.displayname}"/></option>
   117                     </c:forEach>
   118                 </select>
   119             </td>
   120         </tr>
   121         <c:if test="${issue.project.id ge 0}">
   122         <tr>
   123             <th class="vtop"><label for="issue-affected"><fmt:message key="issue.affected-versions"/></label></th>
   124             <td>
   125                 <c:set var="fieldname" value="affected"/>
   126                 <c:set var="selectionList" value="${viewmodel.versionsRecent}"/>
   127                 <c:set var="data" value="${issue.affectedVersions}" />
   128                 <%@include file="../jspf/version-list.jspf"%>
   129             </td>
   130         </tr>
   131         <tr>
   132             <th class="vtop"><label for="issue-resolved"><fmt:message key="issue.resolved-versions"/></label></th>
   133             <td>
   134                 <c:set var="fieldname" value="resolved"/>
   135                 <c:set var="selectionList" value="${viewmodel.versionsUpcoming}"/>
   136                 <c:set var="data" value="${issue.resolvedVersions}" />
   137                 <%@include file="../jspf/version-list.jspf"%>
   138             </td>
   139         </tr>
   140         </c:if>
   141         <tr>
   142             <th><label for="issue-eta"><fmt:message key="issue.eta"/></label></th>
   143             <td><input id="issue-eta" name="eta" type="date" value="<fmt:formatDate value="${issue.eta}" pattern="YYYY-MM-dd" />" /> </td>
   144         </tr>
   145         <c:if test="${issue.id ge 0}">
   146         <tr>
   147             <th class="vtop"><label for="issue-comment"><fmt:message key="issue.comment"/></label> </th>
   148             <td><textarea id="issue-comment" rows="3" name="comment"></textarea></td>
   149         </tr>
   150         </c:if>
   151         </tbody>
   152         <tfoot>
   153         <tr>
   154             <td colspan="2">
   155                 <input type="checkbox" id="more" name="more" <c:if test="${more}">checked</c:if> />
   156                 <label for="more"><fmt:message key="button.issue.create.another"/> </label>
   157                 <input type="hidden" name="id" value="${issue.id}"/>
   158                 <c:if test="${issue.id ge 0}">
   159                 <a href="${issuesHref}${issue.id}" class="button">
   160                     <fmt:message key="button.cancel"/>
   161                 </a>
   162                 </c:if>
   163                 <c:if test="${issue.id lt 0}">
   164                     <a href="${issuesHref}" class="button">
   165                         <fmt:message key="button.cancel"/>
   166                     </a>
   167                 </c:if>
   168                 <button type="submit"><fmt:message key="button.okay"/></button>
   169             </td>
   170         </tr>
   171         </tfoot>
   172     </table>
   173 </form>

mercurial