remove unnecessary check in issue-view.jsp

Thu, 04 Sep 2025 20:20:36 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 04 Sep 2025 20:20:36 +0200
changeset 377
f6e409c17fab
parent 376
52193577339c
child 378
ee605da75f78

remove unnecessary check in issue-view.jsp

src/main/webapp/WEB-INF/jsp/issue-view.jsp file | annotate | diff | comparison | revisions
--- a/src/main/webapp/WEB-INF/jsp/issue-view.jsp	Thu Sep 04 20:10:27 2025 +0200
+++ b/src/main/webapp/WEB-INF/jsp/issue-view.jsp	Thu Sep 04 20:20:36 2025 +0200
@@ -297,7 +297,6 @@
         (${fn:length(viewmodel.comments)})
     </c:if>
 </h2>
-<c:if test="${viewmodel.issue.id ge 0}">
 <form id="comment-form" action="${issuesHref}${issue.id}/comment" method="post">
     <table class="formtable fullwidth">
         <tbody>
@@ -314,59 +313,58 @@
         </tfoot>
     </table>
 </form>
-    <c:forEach var="comment" items="${viewmodel.comments}">
-        <div class="comment">
-            <div class="comment-author">
-                <c:if test="${not empty comment.author}">
-                    <c:if test="${not empty 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:forEach var="comment" items="${viewmodel.comments}">
+    <div class="comment">
+        <div class="comment-author">
+            <c:if test="${not empty comment.author}">
+                <c:if test="${not empty comment.author.mail}">
+                    <a class="comment-author-name" href="mailto:${comment.author.mail}">
                 </c:if>
-                <c:if test="${empty comment.author}">
-                    <fmt:message key="issue.comments.anonauthor"/>
+                <c:out value="${comment.author.displayname}"/>
+                <c:if test="${not empty comment.author.mail}">
+                    </a>
                 </c:if>
-            </div>
-            <div class="smalltext">
-                <fmt:formatDate type="BOTH" value="${comment.created}" timeZone="${timezone}" />
-                <c:if test="${comment.updateCount gt 0}">
-                <span class="comment-edit-info">
-                    (<fmt:message key="issue.comments.lastupdate"/> <fmt:formatDate type="BOTH" value="${comment.updated}" timeZone="${timezone}" />, ${comment.updateCount} <fmt:message key="issue.comments.updateCount"/>)
-                </span>
+                <c:if test="${comment.author.username eq pageContext.request.remoteUser}">
+                    <a class="comment-edit-icon" onclick="showCommentEditor(${comment.id})">&#x270e;</a>
                 </c:if>
-            </div>
-            <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="reset" onclick="cancelCommentEditor(${comment.id})"><fmt:message key="button.cancel"/></button>
-                                <button type="submit"><fmt:message key="button.comment.edit"/></button>
-                            </td>
-                        </tr>
-                        </tfoot>
-                    </table>
-                </form>
-            </div>
+            </c:if>
+            <c:if test="${empty comment.author}">
+                <fmt:message key="issue.comments.anonauthor"/>
+            </c:if>
+        </div>
+        <div class="smalltext">
+            <fmt:formatDate type="BOTH" value="${comment.created}" timeZone="${timezone}" />
+            <c:if test="${comment.updateCount gt 0}">
+            <span class="comment-edit-info">
+                (<fmt:message key="issue.comments.lastupdate"/> <fmt:formatDate type="BOTH" value="${comment.updated}" timeZone="${timezone}" />, ${comment.updateCount} <fmt:message key="issue.comments.updateCount"/>)
+            </span>
+            </c:if>
+        </div>
+        <div id="comment-view-${comment.id}" class="medskip markdown-styled">
+            ${comment.commentFormatted}
         </div>
-    </c:forEach>
-</c:if>
+        <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="reset" onclick="cancelCommentEditor(${comment.id})"><fmt:message key="button.cancel"/></button>
+                            <button type="submit"><fmt:message key="button.comment.edit"/></button>
+                        </td>
+                    </tr>
+                    </tfoot>
+                </table>
+            </form>
+        </div>
+    </div>
+</c:forEach>
 

mercurial