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

Fri, 30 Dec 2022 19:04:34 +0100

author
Mike Becker <universe@uap-core.de>
date
Fri, 30 Dec 2022 19:04:34 +0100
changeset 263
aa22103809cd
parent 231
dcb1d5a7ea3a
child 264
7d67245e5121
permissions
-rw-r--r--

#29 add possibility to relate issues

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@224 30 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
universe@75 31
universe@146 32 <jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.IssueDetailView" scope="request"/>
universe@184 33
universe@184 34 <c:set var="project" scope="page" value="${viewmodel.project}"/>
universe@184 35 <c:set var="component" scope="page" value="${viewmodel.component}"/>
universe@184 36 <c:set var="version" scope="page" value="${viewmodel.version}"/>
universe@86 37 <c:set var="issue" scope="page" value="${viewmodel.issue}" />
universe@75 38
universe@184 39 <c:set var="issuesHref" scope="page" value="./projects/${project.node}/issues/${empty version ? '-' : version.node }/${empty component ? '-' : component.node}/"/>
universe@184 40
universe@212 41 <table class="issue-view fullwidth">
universe@146 42 <colgroup>
universe@146 43 <col>
universe@212 44 <col style="width: 50%">
universe@212 45 <col>
universe@212 46 <col style="width: 50%">
universe@146 47 </colgroup>
universe@146 48 <tbody>
universe@146 49 <tr>
universe@146 50 <th><fmt:message key="issue.id"/></th>
universe@146 51 <td>${issue.id}</td>
universe@212 52 <td colspan="2"></td>
universe@146 53 </tr>
universe@146 54 <tr>
universe@146 55 <th><fmt:message key="issue.created"/></th>
universe@156 56 <td>
universe@156 57 <c:set var="dateValue" value="${issue.created}"/>
universe@156 58 <%@include file="../jspf/date-with-tooltip.jspf"%>
universe@156 59 </td>
universe@146 60 <th><fmt:message key="issue.updated"/></th>
universe@156 61 <td>
universe@156 62 <c:set var="dateValue" value="${issue.updated}"/>
universe@156 63 <%@include file="../jspf/date-with-tooltip.jspf"%>
universe@156 64 </td>
universe@146 65 </tr>
universe@146 66 <tr>
universe@212 67 <th><fmt:message key="project"/></th>
universe@212 68 <td>
universe@212 69 <c:out value="${issue.project.name}" />
universe@212 70 </td>
universe@181 71 <th><fmt:message key="component"/></th>
universe@146 72 <td>
universe@146 73 <c:if test="${not empty issue.component}">
universe@146 74 <c:out value="${issue.component.name}"/>
universe@146 75 </c:if>
universe@146 76 <c:if test="${empty issue.component}">
universe@146 77 <fmt:message key="placeholder.null-component"/>
universe@146 78 </c:if>
universe@146 79 </td>
universe@146 80 </tr>
universe@146 81 <tr>
universe@146 82 <th><fmt:message key="issue.category"/></th>
universe@146 83 <td>
universe@230 84 <div class="issue-tag ${issue.category}">
universe@146 85 <fmt:message key="issue.category.${issue.category}" />
universe@146 86 </div>
universe@146 87 </td>
universe@146 88 <th><fmt:message key="issue.status"/></th>
universe@146 89 <td>
universe@230 90 <div class="issue-tag phase-${issue.status.phase.number}">
universe@146 91 <fmt:message key="issue.status.${issue.status}" />
universe@146 92 </div>
universe@146 93 </td>
universe@146 94 </tr>
universe@146 95 <tr>
universe@212 96 <th><fmt:message key="issue.resolved-versions"/></th>
universe@212 97 <td>
universe@231 98 <c:out value="${issue.resolved.name}"/>
universe@212 99 </td>
universe@212 100 <th><fmt:message key="issue.affected-versions"/></th>
universe@212 101 <td>
universe@231 102 <c:out value="${issue.affected.name}"/>
universe@212 103 </td>
universe@212 104 </tr>
universe@212 105 </tbody>
universe@212 106 </table>
universe@212 107 <table class="issue-view fullwidth">
universe@212 108 <colgroup>
universe@212 109 <col>
universe@212 110 <col style="width: 100%">
universe@212 111 </colgroup>
universe@212 112 <tbody>
universe@212 113 <tr>
universe@146 114 <th><fmt:message key="issue.subject"/></th>
universe@146 115 <td><c:out value="${issue.subject}"/></td>
universe@146 116 </tr>
universe@146 117 <tr>
universe@146 118 <th class="vtop"><fmt:message key="issue.description"/></th>
universe@146 119 <td>
universe@162 120 <div class="markdown-styled">
universe@162 121 ${issue.description}
universe@162 122 </div>
universe@146 123 </td>
universe@146 124 </tr>
universe@146 125 <tr>
universe@146 126 <th><fmt:message key="issue.assignee"/></th>
universe@146 127 <td>
universe@146 128 <c:if test="${not empty issue.assignee}">
universe@226 129 <c:if test="${not empty issue.assignee.mail}">
universe@226 130 <a href="mailto:<c:out value="${issue.assignee.mail}"/>">
universe@226 131 <c:out value="${issue.assignee.displayname}"/>
universe@226 132 </a>
universe@226 133 </c:if>
universe@226 134 <c:if test="${empty issue.assignee.mail}">
universe@146 135 <c:out value="${issue.assignee.displayname}"/>
universe@226 136 </c:if>
universe@146 137 </c:if>
universe@146 138 <c:if test="${empty issue.assignee}">
universe@146 139 <fmt:message key="placeholder.null-assignee" />
universe@146 140 </c:if>
universe@146 141 </td>
universe@146 142 </tr>
universe@146 143 <tr>
universe@146 144 <th><fmt:message key="issue.eta"/></th>
universe@146 145 <td><fmt:formatDate value="${issue.eta}" /></td>
universe@146 146 </tr>
universe@146 147 </tbody>
universe@146 148 </table>
universe@212 149 <div class="hright">
universe@212 150 <a href="${issuesHref}" class="button">
universe@212 151 <fmt:message key="button.back"/>
universe@212 152 </a>
universe@212 153 <a href="${issuesHref}${issue.id}/edit" class="button submit">
universe@212 154 <fmt:message key="button.issue.edit"/>
universe@212 155 </a>
universe@212 156 </div>
universe@146 157
universe@263 158 <hr class="issue-view-separator"/>
universe@263 159 <h2>
universe@263 160 <fmt:message key="issue.relations"/>
universe@263 161 </h2>
universe@263 162 <form id="relation-form" action="${issuesHref}${issue.id}/relation" method="post">
universe@263 163 <c:if test="${not empty viewmodel.relationError}">
universe@263 164 <div class="error-box">
universe@263 165 <fmt:message key="${viewmodel.relationError}"/>
universe@263 166 </div>
universe@263 167 </c:if>
universe@263 168 <table class="issue-view relation-editor fullwidth">
universe@263 169 <colgroup>
universe@263 170 <col>
universe@263 171 <col>
universe@263 172 <col class="fullwidth">
universe@263 173 </colgroup>
universe@263 174 <thead>
universe@263 175 <tr>
universe@263 176 <th></th>
universe@263 177 <th><fmt:message key="issue.relations.type"/></th>
universe@263 178 <th><fmt:message key="issue.relations.issue"/></th>
universe@263 179 </tr>
universe@263 180 </thead>
universe@263 181 <tbody>
universe@263 182 <tr>
universe@263 183 <td>
universe@263 184 <button type="submit"><fmt:message key="button.add"/></button>
universe@263 185 </td>
universe@263 186 <td>
universe@263 187 <select name="type">
universe@263 188 <c:forEach var="type" items="${viewmodel.relationTypes}">
universe@263 189 <option value="${type}"><fmt:message key="issue.relations.type.${type}"/></option>
universe@263 190 <c:if test="${not type.bidi}">
universe@263 191 <option value="!${type}"><fmt:message key="issue.relations.type.${type}.rev"/></option>
universe@263 192 </c:if>
universe@263 193 </c:forEach>
universe@263 194 </select>
universe@263 195 </td>
universe@263 196 <td>
universe@263 197 <input name="issue" list="linkable-issues">
universe@263 198 <datalist id="linkable-issues">
universe@263 199 <c:forEach var="linkableIssue" items="${viewmodel.linkableIssues}">
universe@263 200 <option value="#${linkableIssue.id} - <c:out value="${linkableIssue.subject}"/> (<fmt:message key="issue.status.${linkableIssue.status}" />)"></option>
universe@263 201 </c:forEach>
universe@263 202 </datalist>
universe@263 203 </td>
universe@263 204 </tr>
universe@263 205 <c:forEach var="relation" items="${viewmodel.currentRelations}">
universe@263 206 <tr>
universe@263 207 <td>
universe@263 208 <a href="${issuesHref}${issue.id}/removeRelation?to=${relation.to.id}&type=${relation.type}&reverse=${relation.reverse}" class="button submit">
universe@263 209 <fmt:message key="button.remove"/>
universe@263 210 </a>
universe@263 211 </td>
universe@263 212 <td><fmt:message key="issue.relations.type.${relation.type}${relation.reverse?'.rev':''}"/></td>
universe@263 213 <td>
universe@263 214 <a href="${issuesHref}${relation.to.id}">
universe@263 215 #${relation.to.id} - <c:out value="${relation.to.subject}"/> (<fmt:message key="issue.status.${relation.to.status}" />)
universe@263 216 </a>
universe@263 217 </td>
universe@263 218 </tr>
universe@263 219 </c:forEach>
universe@263 220 </tbody>
universe@263 221 </table>
universe@263 222 </form>
universe@263 223
universe@263 224 <hr class="issue-view-separator"/>
universe@224 225 <h2>
universe@224 226 <fmt:message key="issue.comments"/>
universe@224 227 <c:if test="${not empty viewmodel.comments}">
universe@224 228 (${fn:length(viewmodel.comments)})
universe@224 229 </c:if>
universe@224 230 </h2>
universe@124 231 <c:if test="${viewmodel.issue.id ge 0}">
universe@184 232 <form id="comment-form" action="${issuesHref}${issue.id}/comment" method="post">
universe@124 233 <table class="formtable fullwidth">
universe@124 234 <tbody>
universe@124 235 <tr>
universe@214 236 <td><textarea rows="3" name="comment" required></textarea></td>
universe@124 237 </tr>
universe@124 238 </tbody>
universe@124 239 <tfoot>
universe@124 240 <tr>
universe@124 241 <td>
universe@124 242 <button type="submit"><fmt:message key="button.comment"/></button>
universe@124 243 </td>
universe@124 244 </tr>
universe@124 245 </tfoot>
universe@124 246 </table>
universe@124 247 </form>
universe@124 248 <c:forEach var="comment" items="${viewmodel.comments}">
universe@124 249 <div class="comment">
universe@207 250 <div class="comment-author">
universe@124 251 <c:if test="${not empty comment.author}">
universe@165 252 <c:if test="${not empty comment.author.mail}">
universe@207 253 <a class="comment-author-name" href="mailto:${comment.author.mail}">
universe@165 254 </c:if>
universe@124 255 <c:out value="${comment.author.displayname}"/>
universe@165 256 <c:if test="${not empty comment.author.mail}">
universe@165 257 </a>
universe@165 258 </c:if>
universe@207 259 <c:if test="${comment.author.username eq pageContext.request.remoteUser}">
universe@207 260 <a class="comment-edit-icon" onclick="showCommentEditor(${comment.id})">&#x270e;</a>
universe@207 261 </c:if>
universe@124 262 </c:if>
universe@124 263 <c:if test="${empty comment.author}">
universe@124 264 <fmt:message key="issue.comments.anonauthor"/>
universe@124 265 </c:if>
universe@124 266 </div>
universe@124 267 <div class="smalltext">
universe@124 268 <fmt:formatDate type="BOTH" value="${comment.created}" />
universe@124 269 <c:if test="${comment.updateCount gt 0}">
universe@207 270 <span class="comment-edit-info">
universe@207 271 (<fmt:message key="issue.comments.lastupdate"/> <fmt:formatDate type="BOTH" value="${comment.updated}" />, ${comment.updateCount} <fmt:message key="issue.comments.updateCount"/>)
universe@207 272 </span>
universe@124 273 </c:if>
universe@124 274 </div>
universe@207 275 <div id="comment-view-${comment.id}" class="medskip markdown-styled">
universe@207 276 ${comment.commentFormatted}
universe@207 277 </div>
universe@207 278 <div id="comment-editor-${comment.id}" style="display: none">
universe@207 279 <form id="comment-form-${comment.id}" action="${issuesHref}${issue.id}/comment" method="post">
universe@207 280 <input type="hidden" name="commentid" value="${comment.id}">
universe@207 281 <table class="formtable fullwidth">
universe@207 282 <tbody>
universe@207 283 <tr>
universe@207 284 <td>
universe@207 285 <textarea rows="5" name="comment" required><c:out value="${comment.comment}"/></textarea>
universe@207 286 </td>
universe@207 287 </tr>
universe@207 288 </tbody>
universe@207 289 <tfoot>
universe@207 290 <tr>
universe@207 291 <td>
universe@207 292 <button type="submit"><fmt:message key="button.comment.edit"/></button>
universe@207 293 </td>
universe@207 294 </tr>
universe@207 295 </tfoot>
universe@207 296 </table>
universe@207 297 </form>
universe@124 298 </div>
universe@124 299 </div>
universe@124 300 </c:forEach>
universe@124 301 </c:if>
universe@124 302

mercurial