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

changeset 207
479dd7993ef9
parent 184
e8eecee6aadf
child 212
c50da26a6d31
--- a/src/main/webapp/WEB-INF/jsp/issue-view.jsp	Mon Aug 02 15:13:04 2021 +0200
+++ b/src/main/webapp/WEB-INF/jsp/issue-view.jsp	Mon Aug 02 17:04:17 2021 +0200
@@ -175,15 +175,18 @@
 </form>
     <c:forEach var="comment" items="${viewmodel.comments}">
         <div class="comment">
-            <div class="caption">
+            <div class="comment-author">
                 <c:if test="${not empty comment.author}">
                     <c:if test="${not empty comment.author.mail}">
-                        <a href="mailto:${comment.author.mail}">
+                        <a class="comment-author-name" href="mailto:${comment.author.mail}">
                     </c:if>
                     <c:out value="${comment.author.displayname}"/>
                     <c:if test="${not empty comment.author.mail}">
                         </a>
                     </c:if>
+                    <c:if test="${comment.author.username eq pageContext.request.remoteUser}">
+                        <a class="comment-edit-icon" onclick="showCommentEditor(${comment.id})">&#x270e;</a>
+                    </c:if>
                 </c:if>
                 <c:if test="${empty comment.author}">
                     <fmt:message key="issue.comments.anonauthor"/>
@@ -192,11 +195,34 @@
             <div class="smalltext">
                 <fmt:formatDate type="BOTH" value="${comment.created}" />
                 <c:if test="${comment.updateCount gt 0}">
-                    <!-- TODO: update count -->
+                <span class="comment-edit-info">
+                    (<fmt:message key="issue.comments.lastupdate"/> <fmt:formatDate type="BOTH" value="${comment.updated}" />, ${comment.updateCount} <fmt:message key="issue.comments.updateCount"/>)
+                </span>
                 </c:if>
             </div>
-            <div class="medskip markdown-styled">
-                ${comment.comment}
+            <div id="comment-view-${comment.id}" class="medskip markdown-styled">
+                ${comment.commentFormatted}
+            </div>
+            <div id="comment-editor-${comment.id}" style="display: none">
+                <form id="comment-form-${comment.id}" action="${issuesHref}${issue.id}/comment" method="post">
+                    <input type="hidden" name="commentid" value="${comment.id}">
+                    <table class="formtable fullwidth">
+                        <tbody>
+                        <tr>
+                            <td>
+                                <textarea rows="5" name="comment" required><c:out value="${comment.comment}"/></textarea>
+                            </td>
+                        </tr>
+                        </tbody>
+                        <tfoot>
+                        <tr>
+                            <td>
+                                <button type="submit"><fmt:message key="button.comment.edit"/></button>
+                            </td>
+                        </tr>
+                        </tfoot>
+                    </table>
+                </form>
             </div>
         </div>
     </c:forEach>

mercurial