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

Thu, 22 Oct 2020 11:06:15 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 22 Oct 2020 11:06:15 +0200
changeset 136
7281bdf43c60
parent 134
f47e82cd6077
child 142
c0549bcdf2ab
permissions
-rw-r--r--

automatic assignment of component lead (if available) - fixes #28

     1 <%--
     2 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     4 Copyright 2018 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><fmt:formatDate value="${issue.created}" /></td>
    71         </tr>
    72         <tr>
    73             <th><fmt:message key="issue.updated"/></th>
    74             <td><fmt:formatDate value="${issue.updated}" /></td>
    75         </tr>
    76         <tr>
    77             <th><fmt:message key="issue.component"/></th>
    78             <td>
    79                 <select name="component">
    80                     <option value="-1"><fmt:message key="placeholder.null-component"/></option>
    81                     <c:forEach var="component" items="${viewmodel.components}">
    82                         <option
    83                                 <c:if test="${not empty issue.component and component eq issue.component}">selected</c:if>
    84                                 value="${component.id}"><c:out value="${component.name}"/></option>
    85                     </c:forEach>
    86                 </select>
    87             </td>
    88         </tr>
    89         <tr>
    90             <th><fmt:message key="issue.category"/></th>
    91             <td>
    92                 <select name="category">
    93                     <c:forEach var="category" items="${viewmodel.issueCategory}">
    94                         <option
    95                                 <c:if test="${category eq issue.category}">selected</c:if>
    96                                 value="${category}">
    97                             <fmt:message key="issue.category.${category}" />
    98                         </option>
    99                     </c:forEach>
   100                 </select>
   101             </td>
   102         </tr>
   103         <tr>
   104             <th><fmt:message key="issue.status"/></th>
   105             <td>
   106                 <select name="status">
   107                     <c:forEach var="status" items="${viewmodel.issueStatus}">
   108                         <option
   109                                 <c:if test="${status eq issue.status}">selected</c:if>
   110                                 value="${status}">
   111                                 <fmt:message key="issue.status.${status}" />
   112                         </option>
   113                     </c:forEach>
   114                 </select>
   115             </td>
   116         </tr>
   117         <tr>
   118             <th><fmt:message key="issue.subject"/></th>
   119             <td><input name="subject" type="text" maxlength="200" required value="<c:out value="${issue.subject}"/>" /></td>
   120         </tr>
   121         <tr>
   122             <th class="vtop"><fmt:message key="issue.description"/></th>
   123             <td>
   124                 <textarea name="description" rows="10"><c:out value="${issue.description}"/></textarea>
   125             </td>
   126         </tr>
   127         <tr>
   128             <th><fmt:message key="issue.assignee"/></th>
   129             <td>
   130                 <select name="assignee">
   131                     <option value="-2" title="<fmt:message key="placeholder.auto-assignee.tooltip"/>"><fmt:message key="placeholder.auto-assignee"/></option>
   132                     <option value="-1"
   133                             <c:if test="${issue.id ge 0 and empty issue.assignee}">selected</c:if>
   134                     ><fmt:message key="placeholder.null-assignee"/></option>
   135                     <c:forEach var="user" items="${viewmodel.users}">
   136                         <option
   137                                 <c:if test="${not empty issue.assignee and user eq issue.assignee}">selected</c:if>
   138                                 value="${user.id}"><c:out value="${user.displayname}"/></option>
   139                     </c:forEach>
   140                 </select>
   141             </td>
   142         </tr>
   143         <c:if test="${issue.project.id ge 0}">
   144         <tr>
   145             <th class="vtop"><fmt:message key="issue.affected-versions"/></th>
   146             <td>
   147                 <c:set var="fieldname" value="affected"/>
   148                 <c:set var="selectionList" value="${viewmodel.versionsRecent}"/>
   149                 <c:set var="data" value="${issue.affectedVersions}" />
   150                 <%@include file="../jspf/version-list.jspf"%>
   151             </td>
   152         </tr>
   153         <tr>
   154             <th class="vtop"><fmt:message key="issue.resolved-versions"/></th>
   155             <td>
   156                 <c:set var="fieldname" value="resolved"/>
   157                 <c:set var="selectionList" value="${viewmodel.versionsUpcoming}"/>
   158                 <c:set var="data" value="${issue.resolvedVersions}" />
   159                 <%@include file="../jspf/version-list.jspf"%>
   160             </td>
   161         </tr>
   162         </c:if>
   163         <tr>
   164             <th><fmt:message key="issue.eta"/></th>
   165             <td><input name="eta" type="date" value="<fmt:formatDate value="${issue.eta}" pattern="YYYY-MM-dd" />" /> </td>
   166         </tr>
   167         </tbody>
   168         <tfoot>
   169         <tr>
   170             <td colspan="2">
   171                 <input type="hidden" name="id" value="${issue.id}"/>
   172                 <%-- TODO: fix #14 --%>
   173                 <a href="./projects/${issue.project.node}/versions/" class="button">
   174                     <fmt:message bundle="${lightpit_bundle}" key="button.cancel"/>
   175                 </a>
   176                 <button type="submit"><fmt:message bundle="${lightpit_bundle}" key="button.okay"/></button>
   177             </td>
   178         </tr>
   179         </tfoot>
   180     </table>
   181 </form>
   182 <hr class="comments-separator"/>
   183 <h2><fmt:message key="issue.comments"/></h2>
   184 <c:if test="${viewmodel.issue.id ge 0}">
   185 <form id="comment-form" action="./projects/commit-issue-comment" method="post">
   186     <table class="formtable fullwidth">
   187         <tbody>
   188             <tr>
   189                 <td><textarea rows="5" name="comment" required></textarea></td>
   190             </tr>
   191         </tbody>
   192         <tfoot>
   193             <tr>
   194                 <td>
   195                     <input type="hidden" name="issueid" value="${issue.id}"/>
   196                     <button type="submit"><fmt:message key="button.comment"/></button>
   197                 </td>
   198             </tr>
   199         </tfoot>
   200     </table>
   201 </form>
   202     <c:forEach var="comment" items="${viewmodel.comments}">
   203         <div class="comment">
   204             <div class="caption">
   205                 <c:if test="${not empty comment.author}">
   206                     <c:out value="${comment.author.displayname}"/>
   207                 </c:if>
   208                 <c:if test="${empty comment.author}">
   209                     <fmt:message key="issue.comments.anonauthor"/>
   210                 </c:if>
   211             </div>
   212             <div class="smalltext">
   213                 <fmt:formatDate type="BOTH" value="${comment.created}" />
   214                 <c:if test="${comment.updateCount gt 0}">
   215                     <!-- TODO: update count -->
   216                 </c:if>
   217             </div>
   218             <div class="medskip">
   219                 <c:out value="${comment.comment}"/>
   220             </div>
   221         </div>
   222     </c:forEach>
   223 </c:if>

mercurial