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

Tue, 03 Aug 2021 13:41:32 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 03 Aug 2021 13:41:32 +0200
changeset 209
c9c6abf167c7
parent 207
479dd7993ef9
child 212
c50da26a6d31
permissions
-rw-r--r--

#21 adds input validation mechanism

Also upgrades to Kotlin 1.5.21

universe@75 1 <%--
universe@75 2 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
universe@75 3
universe@180 4 Copyright 2021 Mike Becker. All rights reserved.
universe@75 5
universe@75 6 Redistribution and use in source and binary forms, with or without
universe@75 7 modification, are permitted provided that the following conditions are met:
universe@75 8
universe@75 9 1. Redistributions of source code must retain the above copyright
universe@75 10 notice, this list of conditions and the following disclaimer.
universe@75 11
universe@75 12 2. Redistributions in binary form must reproduce the above copyright
universe@75 13 notice, this list of conditions and the following disclaimer in the
universe@75 14 documentation and/or other materials provided with the distribution.
universe@75 15
universe@75 16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
universe@75 17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
universe@75 18 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
universe@75 19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
universe@75 20 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
universe@75 21 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
universe@75 22 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
universe@75 23 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
universe@75 24 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
universe@75 25 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
universe@75 26 --%>
universe@75 27 <%@page pageEncoding="UTF-8" %>
universe@75 28 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
universe@75 29 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
universe@75 30
universe@146 31 <jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.IssueDetailView" scope="request"/>
universe@184 32
universe@184 33 <c:set var="project" scope="page" value="${viewmodel.project}"/>
universe@184 34 <c:set var="component" scope="page" value="${viewmodel.component}"/>
universe@184 35 <c:set var="version" scope="page" value="${viewmodel.version}"/>
universe@86 36 <c:set var="issue" scope="page" value="${viewmodel.issue}" />
universe@75 37
universe@184 38 <c:set var="issuesHref" scope="page" value="./projects/${project.node}/issues/${empty version ? '-' : version.node }/${empty component ? '-' : component.node}/"/>
universe@184 39
universe@146 40 <table class="formtable fullwidth">
universe@146 41 <colgroup>
universe@146 42 <col>
universe@146 43 <col style="width: 100%">
universe@146 44 </colgroup>
universe@146 45 <tbody>
universe@146 46 <c:if test="${viewmodel.issue.id ge 0}">
universe@146 47 <tr>
universe@146 48 <th><fmt:message key="issue.id"/></th>
universe@146 49 <td>${issue.id}</td>
universe@146 50 </tr>
universe@146 51 </c:if>
universe@146 52 <tr>
universe@181 53 <th><fmt:message key="project"/></th>
universe@146 54 <td>
universe@146 55 <c:out value="${issue.project.name}" />
universe@146 56 </td>
universe@146 57 </tr>
universe@146 58 <tr>
universe@146 59 <th><fmt:message key="issue.created"/></th>
universe@156 60 <td>
universe@156 61 <c:set var="dateValue" value="${issue.created}"/>
universe@156 62 <%@include file="../jspf/date-with-tooltip.jspf"%>
universe@156 63 </td>
universe@146 64 </tr>
universe@146 65 <tr>
universe@146 66 <th><fmt:message key="issue.updated"/></th>
universe@156 67 <td>
universe@156 68 <c:set var="dateValue" value="${issue.updated}"/>
universe@156 69 <%@include file="../jspf/date-with-tooltip.jspf"%>
universe@156 70 </td>
universe@146 71 </tr>
universe@146 72 <tr>
universe@181 73 <th><fmt:message key="component"/></th>
universe@146 74 <td>
universe@146 75 <c:if test="${not empty issue.component}">
universe@146 76 <c:out value="${issue.component.name}"/>
universe@146 77 </c:if>
universe@146 78 <c:if test="${empty issue.component}">
universe@146 79 <fmt:message key="placeholder.null-component"/>
universe@146 80 </c:if>
universe@146 81 </td>
universe@146 82 </tr>
universe@146 83 <tr>
universe@146 84 <th><fmt:message key="issue.category"/></th>
universe@146 85 <td>
universe@146 86 <div class="issue-tag ${issue.category}" style="width: auto">
universe@146 87 <fmt:message key="issue.category.${issue.category}" />
universe@146 88 </div>
universe@146 89 </td>
universe@146 90 </tr>
universe@146 91 <tr>
universe@146 92 <th><fmt:message key="issue.status"/></th>
universe@146 93 <td>
universe@150 94 <div class="issue-tag phase-${issue.status.phase.number}" style="width: auto">
universe@146 95 <fmt:message key="issue.status.${issue.status}" />
universe@146 96 </div>
universe@146 97 </td>
universe@146 98 </tr>
universe@146 99 <tr>
universe@146 100 <th><fmt:message key="issue.subject"/></th>
universe@146 101 <td><c:out value="${issue.subject}"/></td>
universe@146 102 </tr>
universe@146 103 <tr>
universe@146 104 <th class="vtop"><fmt:message key="issue.description"/></th>
universe@146 105 <td>
universe@162 106 <div class="markdown-styled">
universe@162 107 ${issue.description}
universe@162 108 </div>
universe@146 109 </td>
universe@146 110 </tr>
universe@146 111 <tr>
universe@146 112 <th><fmt:message key="issue.assignee"/></th>
universe@146 113 <td>
universe@146 114 <c:if test="${not empty issue.assignee}">
universe@146 115 <c:out value="${issue.assignee.displayname}"/>
universe@146 116 </c:if>
universe@146 117 <c:if test="${empty issue.assignee}">
universe@146 118 <fmt:message key="placeholder.null-assignee" />
universe@146 119 </c:if>
universe@146 120 </td>
universe@146 121 </tr>
universe@146 122 <tr>
universe@146 123 <th class="vtop"><fmt:message key="issue.affected-versions"/></th>
universe@146 124 <td>
universe@146 125 <c:forEach var="version" items="${issue.affectedVersions}">
universe@146 126 <c:out value="${version.name}"/>
universe@146 127 </c:forEach>
universe@146 128 </td>
universe@146 129 </tr>
universe@146 130 <tr>
universe@146 131 <th class="vtop"><fmt:message key="issue.resolved-versions"/></th>
universe@146 132 <td>
universe@146 133 <c:forEach var="version" items="${issue.resolvedVersions}">
universe@146 134 <c:out value="${version.name}"/>
universe@146 135 </c:forEach>
universe@146 136 </td>
universe@146 137 </tr>
universe@146 138 <tr>
universe@146 139 <th><fmt:message key="issue.eta"/></th>
universe@146 140 <td><fmt:formatDate value="${issue.eta}" /></td>
universe@146 141 </tr>
universe@146 142 </tbody>
universe@146 143 <tfoot>
universe@146 144 <tr>
universe@146 145 <td colspan="2">
universe@184 146 <a href="${issuesHref}" class="button">
universe@180 147 <fmt:message key="button.cancel"/>
universe@146 148 </a>
universe@184 149 <a href="${issuesHref}${issue.id}/edit" class="button submit">
universe@146 150 <fmt:message key="button.issue.edit"/>
universe@146 151 </a>
universe@146 152 </td>
universe@146 153 </tr>
universe@146 154 </tfoot>
universe@146 155 </table>
universe@146 156
universe@124 157 <hr class="comments-separator"/>
universe@124 158 <h2><fmt:message key="issue.comments"/></h2>
universe@124 159 <c:if test="${viewmodel.issue.id ge 0}">
universe@184 160 <form id="comment-form" action="${issuesHref}${issue.id}/comment" method="post">
universe@124 161 <table class="formtable fullwidth">
universe@124 162 <tbody>
universe@124 163 <tr>
universe@125 164 <td><textarea rows="5" name="comment" required></textarea></td>
universe@124 165 </tr>
universe@124 166 </tbody>
universe@124 167 <tfoot>
universe@124 168 <tr>
universe@124 169 <td>
universe@124 170 <button type="submit"><fmt:message key="button.comment"/></button>
universe@124 171 </td>
universe@124 172 </tr>
universe@124 173 </tfoot>
universe@124 174 </table>
universe@124 175 </form>
universe@124 176 <c:forEach var="comment" items="${viewmodel.comments}">
universe@124 177 <div class="comment">
universe@207 178 <div class="comment-author">
universe@124 179 <c:if test="${not empty comment.author}">
universe@165 180 <c:if test="${not empty comment.author.mail}">
universe@207 181 <a class="comment-author-name" href="mailto:${comment.author.mail}">
universe@165 182 </c:if>
universe@124 183 <c:out value="${comment.author.displayname}"/>
universe@165 184 <c:if test="${not empty comment.author.mail}">
universe@165 185 </a>
universe@165 186 </c:if>
universe@207 187 <c:if test="${comment.author.username eq pageContext.request.remoteUser}">
universe@207 188 <a class="comment-edit-icon" onclick="showCommentEditor(${comment.id})">&#x270e;</a>
universe@207 189 </c:if>
universe@124 190 </c:if>
universe@124 191 <c:if test="${empty comment.author}">
universe@124 192 <fmt:message key="issue.comments.anonauthor"/>
universe@124 193 </c:if>
universe@124 194 </div>
universe@124 195 <div class="smalltext">
universe@124 196 <fmt:formatDate type="BOTH" value="${comment.created}" />
universe@124 197 <c:if test="${comment.updateCount gt 0}">
universe@207 198 <span class="comment-edit-info">
universe@207 199 (<fmt:message key="issue.comments.lastupdate"/> <fmt:formatDate type="BOTH" value="${comment.updated}" />, ${comment.updateCount} <fmt:message key="issue.comments.updateCount"/>)
universe@207 200 </span>
universe@124 201 </c:if>
universe@124 202 </div>
universe@207 203 <div id="comment-view-${comment.id}" class="medskip markdown-styled">
universe@207 204 ${comment.commentFormatted}
universe@207 205 </div>
universe@207 206 <div id="comment-editor-${comment.id}" style="display: none">
universe@207 207 <form id="comment-form-${comment.id}" action="${issuesHref}${issue.id}/comment" method="post">
universe@207 208 <input type="hidden" name="commentid" value="${comment.id}">
universe@207 209 <table class="formtable fullwidth">
universe@207 210 <tbody>
universe@207 211 <tr>
universe@207 212 <td>
universe@207 213 <textarea rows="5" name="comment" required><c:out value="${comment.comment}"/></textarea>
universe@207 214 </td>
universe@207 215 </tr>
universe@207 216 </tbody>
universe@207 217 <tfoot>
universe@207 218 <tr>
universe@207 219 <td>
universe@207 220 <button type="submit"><fmt:message key="button.comment.edit"/></button>
universe@207 221 </td>
universe@207 222 </tr>
universe@207 223 </tfoot>
universe@207 224 </table>
universe@207 225 </form>
universe@124 226 </div>
universe@124 227 </div>
universe@124 228 </c:forEach>
universe@124 229 </c:if>
universe@124 230

mercurial