summaryrefslogtreecommitdiff
path: root/src/main/resources/templates
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2022-06-04 16:02:25 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2022-06-04 16:24:24 +0200
commit8dcc6ae4ee418cdfdc60c76709ad03b4814fb83a (patch)
tree6d7dbefe5bad6e47e324fc302e5bcde41181d768 /src/main/resources/templates
parent1937e6a72594f98d1fa031d8220f10ccc798c2be (diff)
KB66 Add comment count to post header.
Change-Id: I98fd99327fdfebaddfebe3541e6b1ccb1d78fe3c
Diffstat (limited to 'src/main/resources/templates')
-rw-r--r--src/main/resources/templates/PostResource/postList.html10
-rw-r--r--src/main/resources/templates/tags/commentBox.html2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/main/resources/templates/PostResource/postList.html b/src/main/resources/templates/PostResource/postList.html
index 2f932ec..8c66e1d 100644
--- a/src/main/resources/templates/PostResource/postList.html
+++ b/src/main/resources/templates/PostResource/postList.html
@@ -66,6 +66,11 @@
<a class="post-link" href="/posts/{post.id}">
<span class="post-self-link">#</span>
</a>
+ {#if post.comments.size() > 0}
+ <a class="comment-box-link" href="/posts/{post.id}#comment-box-{post.id}">
+ <span class="comment-box-self-link">({post.comments.size()})</span>
+ </a>
+ {/if}
<a href="{post.uri}" class="bookmark-title">
<h2 class="bookmark-title"><span class="bookmark-symbol">🔖 </span> {post.title}</h2>.
@@ -103,6 +108,11 @@
<a class="post-link" href="/posts/{post.id}">
<span class="post-self-link">#</span>
</a>
+ {#if post.comments.size() > 0}
+ <a class="comment-box-link" href="/posts/{post.id}#comment-box-{post.id}">
+ <span class="comment-box-self-link">({post.comments.size()})</span>
+ </a>
+ {/if}
</div>
</header>
diff --git a/src/main/resources/templates/tags/commentBox.html b/src/main/resources/templates/tags/commentBox.html
index 40cec4a..abe73f5 100644
--- a/src/main/resources/templates/tags/commentBox.html
+++ b/src/main/resources/templates/tags/commentBox.html
@@ -1,7 +1,7 @@
{@java.lang.Integer postId}
{@java.util.List<eu.mulk.mulkcms2.benki.lazychat.LazychatMessage> comments}
-<div class="comment-box">
+<div class="comment-box" id="comment-box-{postId}">
<script type="module" src="/lib.js"></script>
<script type="module" src="/posts/commentBox.js"></script>