ejs stuff
This commit is contained in:
29
views/posts/post.ejs
Normal file
29
views/posts/post.ejs
Normal file
@@ -0,0 +1,29 @@
|
||||
<h1>
|
||||
<%= post.title %>
|
||||
</h1>
|
||||
<%= post.content %><br/>
|
||||
<i>
|
||||
By <a href="/user/<%= user.username %>"><%= user.username %></a><br/>
|
||||
</i>
|
||||
<br/>
|
||||
<%- hyperlink_tags(post.tags) %><br/>
|
||||
<a href="<%= config.edit_post_base_url %>/<%= postID %>">Edit</a><br/>
|
||||
<i>Published: <%= format(fromUnixTime(post.pubdate), config.date_format) %></i><br/>
|
||||
<i>Last Modified: <%= format(fromUnixTime(post.editdate), config.date_format) %></i><br/>
|
||||
|
||||
<%- config.seperator %>
|
||||
|
||||
<!-- Comment form -->
|
||||
<form method="POST" action="/submit_comment">
|
||||
<input type="hidden" name="post_index" value="<%= postID %>">
|
||||
<input placeholder="username" name="name"><br/>
|
||||
<textarea placeholder="comment" name="content"></textarea><br/>
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
<% comments.forEach((comment, postID) => { %>
|
||||
<%- include('../partials/comment', {comment: comment}) %>
|
||||
<% }) %>
|
||||
|
||||
<%- config.seperator %>
|
||||
|
Reference in New Issue
Block a user