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

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

mercurial