KB66 Add comment box.

Change-Id: I9bf140ded85045b09997145ed2a9fb421fedc7d4
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 @@
   color: #555;
 }
 
-.post-self-link {
+.post-self-link, .comment-self-link {
   padding-left: 5px;
   padding-right: 5px;
 }
@@ -355,27 +355,31 @@
   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>