diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2022-05-26 08:05:00 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2022-06-04 16:24:24 +0200 |
commit | 0351a8fbbac6cfa671128513605288fb940ce94b (patch) | |
tree | 1613514bf7f539f6e55176e58c67885fcc91b141 /src/main/resources | |
parent | 14e59440fd5f03d046e4e329eec73560450f1467 (diff) |
KB66 Add comment box.
Change-Id: I9bf140ded85045b09997145ed2a9fb421fedc7d4
Diffstat (limited to 'src/main/resources')
-rw-r--r-- | src/main/resources/META-INF/resources/cms2/base.css | 14 | ||||
-rw-r--r-- | src/main/resources/templates/benki/posts/postList.html | 4 | ||||
-rw-r--r-- | src/main/resources/templates/tags/commentBox.html | 20 |
3 files changed, 28 insertions, 10 deletions
diff --git a/src/main/resources/META-INF/resources/cms2/base.css b/src/main/resources/META-INF/resources/cms2/base.css index e11f295..d68e07e 100644 --- a/src/main/resources/META-INF/resources/cms2/base.css +++ b/src/main/resources/META-INF/resources/cms2/base.css @@ -323,7 +323,7 @@ a.bookmark-title { color: #555; } -.post-self-link { +.post-self-link, .comment-self-link { padding-left: 5px; padding-right: 5px; } @@ -355,27 +355,31 @@ article.bookmark > header { float: left; } -.lazychat-message-info { +.comment { + margin: 5px; +} + +.lazychat-message-info, .comment-info { font-style: italic; margin: 0; padding: 0; flex: auto; } -article.lazychat-message { +article.lazychat-message, .comment { border: 1px solid #a0c0c0; padding: 0.3em; background: #f0f8f0; } -article.lazychat-message > header { +article.lazychat-message > header, .comment-info { display: flex; float: left; margin-right: 5px; line-height: 1em; } -a.post-link { +a.post-link, a.comment-link { text-decoration: none; } 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> |