summaryrefslogtreecommitdiff
path: root/src/main/resources/templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/templates')
-rw-r--r--src/main/resources/templates/benki/posts/postList.html8
-rw-r--r--src/main/resources/templates/tags/commentBox.html26
2 files changed, 33 insertions, 1 deletions
diff --git a/src/main/resources/templates/benki/posts/postList.html b/src/main/resources/templates/benki/posts/postList.html
index fc874cf..0fc8a6d 100644
--- a/src/main/resources/templates/benki/posts/postList.html
+++ b/src/main/resources/templates/benki/posts/postList.html
@@ -83,7 +83,9 @@
{post.descriptionHtml.raw}
</div>
- <div class="comment-box"></div>
+ {#if showCommentBox}
+ {#commentBox postId=post.id /}
+ {/if}
</article>
{#else}
<article class="lazychat-message">
@@ -113,6 +115,10 @@
<div class="lazychat-message-content post-content">
{post.descriptionHtml.raw}
</div>
+
+ {#if showCommentBox}
+ {#commentBox postId=post.id /}
+ {/if}
</article>
{/if}
{/for}
diff --git a/src/main/resources/templates/tags/commentBox.html b/src/main/resources/templates/tags/commentBox.html
new file mode 100644
index 0000000..3049687
--- /dev/null
+++ b/src/main/resources/templates/tags/commentBox.html
@@ -0,0 +1,26 @@
+{@java.lang.Integer postId}
+
+<div class="comment-box">
+ <script type="module" src="/lib.js"></script>
+ <script type="module" src="/posts/commentBox.js"></script>
+
+ <hr/>
+
+ <form class="comment-form pure-form" method="post" action="/posts/{postId}/comments">
+ <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>
+
+ <input name="hashcash-salt" id="comment-form-hashcash-salt-{postId}" type="hidden"/>
+
+ <div class="controls">
+ <input type="submit" class="pure-button"/>
+ </div>
+ </fieldset>
+ </form>
+</div>