add comments
This commit is contained in:
parent
e8cc01e66f
commit
59c1daeac5
11 changed files with 94 additions and 11 deletions
21
views/comments.ejs
Normal file
21
views/comments.ejs
Normal file
|
@ -0,0 +1,21 @@
|
|||
<form enctype='multipart/form-data' method='POST' action='/api/form/comment'>
|
||||
<h1>Comments</h1>
|
||||
<!-- probably component-ify this -->
|
||||
<div class='form-message'></div>
|
||||
<input name='targetId' hidden value='<%= id %>'>
|
||||
<input name='targetType' hidden value='<%= route %>'>
|
||||
<textarea name='content'></textarea>
|
||||
<input type='submit'>
|
||||
|
||||
<% for (let comment of comments) { %>
|
||||
<div class='comment'>
|
||||
<div><b>
|
||||
<a href='/client/user?id=<%= comment.username %>'><%= comment.username %></a>
|
||||
</b></div>
|
||||
<div><b>
|
||||
<%= (new Date(comment.date)+'').split(/(GMT|UTC)/g)[0] %>
|
||||
</b></div>
|
||||
<pre><%= comment.content %></pre>
|
||||
</div>
|
||||
<% } %>
|
||||
</form>
|
|
@ -19,4 +19,5 @@
|
|||
</a></div>
|
||||
<pre><%= videoData.desc %></pre>
|
||||
</div>
|
||||
<%- include('comments.ejs') -%>
|
||||
<%- include('footer.ejs') -%>
|
|
@ -14,4 +14,5 @@
|
|||
<%- include('videos.ejs') -%>
|
||||
</div>
|
||||
</div>
|
||||
<%- include('comments.ejs') -%>
|
||||
<%- include('footer.ejs') -%>
|
Loading…
Add table
Add a link
Reference in a new issue