src/main/webapp/WEB-INF/jsp/issue-view.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 284
671c1c8fbf1c
permissions
-rw-r--r--

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

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

mercurial