summaryrefslogtreecommitdiff
path: root/src/main/resources/templates
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2022-05-26 08:05:00 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2022-06-04 16:24:24 +0200
commit0351a8fbbac6cfa671128513605288fb940ce94b (patch)
tree1613514bf7f539f6e55176e58c67885fcc91b141 /src/main/resources/templates
parent14e59440fd5f03d046e4e329eec73560450f1467 (diff)
KB66 Add comment box.
Change-Id: I9bf140ded85045b09997145ed2a9fb421fedc7d4
Diffstat (limited to 'src/main/resources/templates')
-rw-r--r--src/main/resources/templates/benki/posts/postList.html4
-rw-r--r--src/main/resources/templates/tags/commentBox.html20
2 files changed, 19 insertions, 5 deletions
diff --git a/src/main/resources/templates/benki/posts/postList.html b/src/main/resources/templates/benki/posts/postList.html
index 0fc8a6d..2f932ec 100644
--- a/src/main/resources/templates/benki/posts/postList.html
+++ b/src/main/resources/templates/benki/posts/postList.html
@@ -84,7 +84,7 @@
</div>
{#if showCommentBox}
- {#commentBox postId=post.id /}
+ {#commentBox postId=post.id comments=post.comments /}
{/if}
</article>
{#else}
@@ -117,7 +117,7 @@
</div>
{#if showCommentBox}
- {#commentBox postId=post.id /}
+ {#commentBox postId=post.id comments=post.comments /}
{/if}
</article>
{/if}
diff --git a/src/main/resources/templates/tags/commentBox.html b/src/main/resources/templates/tags/commentBox.html
index 3049687..40cec4a 100644
--- a/src/main/resources/templates/tags/commentBox.html
+++ b/src/main/resources/templates/tags/commentBox.html
@@ -1,4 +1,5 @@
{@java.lang.Integer postId}
+{@java.util.List<eu.mulk.mulkcms2.benki.lazychat.LazychatMessage> comments}
<div class="comment-box">
<script type="module" src="/lib.js"></script>
@@ -10,9 +11,6 @@
<fieldset>
<legend>Post Comment</legend>
- <label for="comment-form-author-{postId}">Author (optional)</label>
- <input name="author" id="comment-form-author-{postId}" type="text" placeholder="Anonymous Coward"/>
-
<label for="comment-form-message-{postId}">Message</label>
<textarea name="message" id="comment-form-message-{postId}" placeholder="Great article!" required></textarea>
@@ -23,4 +21,20 @@
</div>
</fieldset>
</form>
+
+ {#for comment in comments}
+ <div class="comment" id="comment-{comment.id}">
+ {#if comment.owner != null}<span class="comment-owner post-owner">{comment.owner.firstName}</span>{/if}
+
+ <div class="comment-info">
+ <a class="comment-link" href="/posts/{postId}#comment-{comment.id}">
+ <span class="comment-self-link">#</span>
+ </a>
+ </div>
+
+ <div class="comment-content post-content">
+ {comment.descriptionHtml.raw}
+ </div>
+ </div>
+ {/for}
</div>