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

Fri, 09 Oct 2020 19:14:40 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 09 Oct 2020 19:14:40 +0200
changeset 125
decc4c3854a1
parent 124
ed2e7aef2a3e
child 131
67df332e3146
permissions
-rw-r--r--

adds missing required attribute to comment textfield

     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 <form action="./projects/issues/commit" method="post">
    35     <table class="formtable fullwidth">
    36         <colgroup>
    37             <col>
    38             <col style="width: 100%">
    39         </colgroup>
    40         <tbody>
    41         <c:if test="${viewmodel.issue.id ge 0}">
    42         <tr>
    43             <th><fmt:message key="issue.id"/></th>
    44             <td>${issue.id}</td>
    45         </tr>
    46         </c:if>
    47         <tr>
    48             <th><fmt:message key="issue.project"/></th>
    49             <td>
    50                 <c:choose>
    51                     <c:when test="${not empty issue.project}">
    52                         <c:out value="${issue.project.name}" />
    53                         <input type="hidden" name="pid" value="${issue.project.id}" />
    54                     </c:when>
    55                     <c:otherwise>
    56                         <select name="pid" required>
    57                             <c:forEach var="project" items="${viewmodel.projects}">
    58                                 <option value="${project.id}">
    59                                     <c:out value="${project.name}" />
    60                                 </option>
    61                             </c:forEach>
    62                         </select>
    63                     </c:otherwise>
    64                 </c:choose>
    65             </td>
    66         </tr>
    67         <tr>
    68             <th><fmt:message key="issue.created"/></th>
    69             <td><fmt:formatDate value="${issue.created}" /></td>
    70         </tr>
    71         <tr>
    72             <th><fmt:message key="issue.updated"/></th>
    73             <td><fmt:formatDate value="${issue.updated}" /></td>
    74         </tr>
    75         <tr>
    76             <th><fmt:message key="issue.category"/></th>
    77             <td>
    78                 <select name="category">
    79                     <c:forEach var="category" items="${viewmodel.issueCategory}">
    80                         <option
    81                                 <c:if test="${category eq issue.category}">selected</c:if>
    82                                 value="${category}">
    83                             <fmt:message key="issue.category.${category}" />
    84                         </option>
    85                     </c:forEach>
    86                 </select>
    87             </td>
    88         </tr>
    89         <tr>
    90             <th><fmt:message key="issue.status"/></th>
    91             <td>
    92                 <select name="status">
    93                     <c:forEach var="status" items="${viewmodel.issueStatus}">
    94                         <option
    95                                 <c:if test="${status eq issue.status}">selected</c:if>
    96                                 value="${status}">
    97                                 <fmt:message key="issue.status.${status}" />
    98                         </option>
    99                     </c:forEach>
   100                 </select>
   101             </td>
   102         </tr>
   103         <tr>
   104             <th><fmt:message key="issue.subject"/></th>
   105             <td><input name="subject" type="text" maxlength="200" required value="<c:out value="${issue.subject}"/>" /></td>
   106         </tr>
   107         <tr>
   108             <th class="vtop"><fmt:message key="issue.description"/></th>
   109             <td>
   110                 <textarea name="description" rows="10"><c:out value="${issue.description}"/></textarea>
   111             </td>
   112         </tr>
   113         <tr>
   114             <th><fmt:message key="issue.assignee"/></th>
   115             <td>
   116                 <select name="assignee">
   117                     <option value="-1"><fmt:message key="placeholder.null-assignee"/></option>
   118                     <c:forEach var="user" items="${viewmodel.users}">
   119                         <option
   120                                 <c:if test="${not empty issue.assignee and user eq issue.assignee}">selected</c:if>
   121                                 value="${user.id}"><c:out value="${user.displayname}"/></option>
   122                     </c:forEach>
   123                 </select>
   124             </td>
   125         </tr>
   126         <c:if test="${issue.project.id ge 0}">
   127         <tr>
   128             <th class="vtop"><fmt:message key="issue.affected-versions"/></th>
   129             <td>
   130                 <c:set var="fieldname" value="affected"/>
   131                 <c:set var="selectionList" value="${viewmodel.versionsRecent}"/>
   132                 <c:set var="data" value="${issue.affectedVersions}" />
   133                 <%@include file="../jspf/version-list.jspf"%>
   134             </td>
   135         </tr>
   136         <tr>
   137             <th class="vtop"><fmt:message key="issue.resolved-versions"/></th>
   138             <td>
   139                 <c:set var="fieldname" value="resolved"/>
   140                 <c:set var="selectionList" value="${viewmodel.versionsUpcoming}"/>
   141                 <c:set var="data" value="${issue.resolvedVersions}" />
   142                 <%@include file="../jspf/version-list.jspf"%>
   143             </td>
   144         </tr>
   145         </c:if>
   146         <tr>
   147             <th><fmt:message key="issue.eta"/></th>
   148             <td><input name="eta" type="date" value="<fmt:formatDate value="${issue.eta}" pattern="YYYY-MM-dd" />" /> </td>
   149         </tr>
   150         </tbody>
   151         <tfoot>
   152         <tr>
   153             <td colspan="2">
   154                 <input type="hidden" name="id" value="${issue.id}"/>
   155                 <c:choose>
   156                     <c:when test="${not empty issue.project}">
   157                         <c:set var="cancelUrl">./projects/view?pid=${issue.project.id}</c:set>
   158                     </c:when>
   159                     <c:otherwise>
   160                         <c:set var="cancelUrl">./projects/</c:set>
   161                     </c:otherwise>
   162                 </c:choose>
   163                 <a href="${cancelUrl}" class="button">
   164                     <fmt:message bundle="${lightpit_bundle}" key="button.cancel"/>
   165                 </a>
   166                 <button type="submit"><fmt:message bundle="${lightpit_bundle}" key="button.okay"/></button>
   167             </td>
   168         </tr>
   169         </tfoot>
   170     </table>
   171 </form>
   172 <hr class="comments-separator"/>
   173 <h2><fmt:message key="issue.comments"/></h2>
   174 <c:if test="${viewmodel.issue.id ge 0}">
   175 <form id="comment-form" action="./projects/issues/comment" method="post">
   176     <table class="formtable fullwidth">
   177         <tbody>
   178             <tr>
   179                 <td><textarea rows="5" name="comment" required></textarea></td>
   180             </tr>
   181         </tbody>
   182         <tfoot>
   183             <tr>
   184                 <td>
   185                     <input type="hidden" name="issueid" value="${issue.id}"/>
   186                     <button type="submit"><fmt:message key="button.comment"/></button>
   187                 </td>
   188             </tr>
   189         </tfoot>
   190     </table>
   191 </form>
   192     <c:forEach var="comment" items="${viewmodel.comments}">
   193         <div class="comment">
   194             <div class="caption">
   195                 <c:if test="${not empty comment.author}">
   196                     <c:out value="${comment.author.displayname}"/>
   197                 </c:if>
   198                 <c:if test="${empty comment.author}">
   199                     <fmt:message key="issue.comments.anonauthor"/>
   200                 </c:if>
   201             </div>
   202             <div class="smalltext">
   203                 <fmt:formatDate type="BOTH" value="${comment.created}" />
   204                 <c:if test="${comment.updateCount gt 0}">
   205                     <!-- TODO: update count -->
   206                 </c:if>
   207             </div>
   208             <div class="medskip">
   209                 <c:out value="${comment.comment}"/>
   210             </div>
   211         </div>
   212     </c:forEach>
   213 </c:if>

mercurial