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

Mon, 30 Oct 2023 14:44:36 +0100

author
Mike Becker <universe@uap-core.de>
date
Mon, 30 Oct 2023 14:44:36 +0100
changeset 292
703591e739f4
parent 231
dcb1d5a7ea3a
permissions
-rw-r--r--

add possibility to show issues w/o version or component - fixes #335

     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="issuesHref" value="./${viewmodel.pathInfos.issuesHref}"/>
    37 <form action="${issuesHref}-/commit" method="post">
    38     <input type="hidden" name="project" value="${issue.project.id}" />
    39     <table class="formtable fullwidth">
    40         <colgroup>
    41             <col>
    42             <col style="width: 100%">
    43         </colgroup>
    44         <tbody>
    45         <c:if test="${viewmodel.issue.id ge 0}">
    46         <tr>
    47             <th><fmt:message key="issue.id"/></th>
    48             <td>${issue.id}</td>
    49         </tr>
    50         </c:if>
    51         <tr>
    52             <th><label for="issue-component"><fmt:message key="component"/></label></th>
    53             <td>
    54                 <select id="issue-component" name="component">
    55                     <option value="-1"><fmt:message key="placeholder.null-component"/></option>
    56                     <c:forEach var="comp" items="${viewmodel.components}">
    57                         <c:set var="isSelectedComponent" value="${not empty issue.component and comp eq issue.component}" scope="page"/>
    58                         <c:if test="${isSelectedComponent or comp.active}">
    59                         <option
    60                                 <c:if test="${isSelectedComponent}">selected</c:if>
    61                                 value="${comp.id}"><c:out value="${comp.name}"/></option>
    62                         </c:if>
    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                 <select id="issue-affected" name="affected">
   126                     <option value="-1"><fmt:message key="placeholder.null-version"/></option>
   127                     <c:forEach var="vselitem" items="${viewmodel.versionsRecent}">
   128                         <option value="${vselitem.id}" <c:if test="${issue.affected eq vselitem}">selected</c:if> >
   129                             <c:out value="${vselitem.name}" />
   130                         </option>
   131                     </c:forEach>
   132                 </select>
   133             </td>
   134         </tr>
   135         <tr>
   136             <th class="vtop"><label for="issue-resolved"><fmt:message key="issue.resolved-versions"/></label></th>
   137             <td>
   138                 <select id="issue-resolved" name="resolved">
   139                     <option value="-1"><fmt:message key="placeholder.null-version"/></option>
   140                     <c:forEach var="vselitem" items="${viewmodel.versionsUpcoming}">
   141                         <option value="${vselitem.id}" <c:if test="${issue.resolved eq vselitem}">selected</c:if> >
   142                             <c:out value="${vselitem.name}" />
   143                         </option>
   144                     </c:forEach>
   145                 </select>
   146             </td>
   147         </tr>
   148         </c:if>
   149         <tr>
   150             <th><label for="issue-eta"><fmt:message key="issue.eta"/></label></th>
   151             <td><input id="issue-eta" name="eta" type="date" value="<fmt:formatDate value="${issue.eta}" pattern="YYYY-MM-dd" />" /> </td>
   152         </tr>
   153         <c:if test="${issue.id ge 0}">
   154         <tr>
   155             <th class="vtop"><label for="issue-comment"><fmt:message key="issue.comment"/></label> </th>
   156             <td><textarea id="issue-comment" rows="3" name="comment"></textarea></td>
   157         </tr>
   158         </c:if>
   159         </tbody>
   160         <tfoot>
   161         <tr>
   162             <td colspan="2">
   163                 <input type="checkbox" id="more" name="more" <c:if test="${more}">checked</c:if> />
   164                 <label for="more"><fmt:message key="button.issue.create.another"/> </label>
   165                 <input type="hidden" name="id" value="${issue.id}"/>
   166                 <c:if test="${issue.id ge 0}">
   167                 <a href="${issuesHref}${issue.id}" class="button">
   168                     <fmt:message key="button.cancel"/>
   169                 </a>
   170                 </c:if>
   171                 <c:if test="${issue.id lt 0}">
   172                     <a href="${issuesHref}" class="button">
   173                         <fmt:message key="button.cancel"/>
   174                     </a>
   175                 </c:if>
   176                 <button type="submit"><fmt:message key="button.okay"/></button>
   177             </td>
   178         </tr>
   179         </tfoot>
   180     </table>
   181 </form>

mercurial