add threads n posts
This commit is contained in:
20
views/threads/thread.etlua
Normal file
20
views/threads/thread.etlua
Normal file
@ -0,0 +1,20 @@
|
||||
<% for _, post in ipairs(posts) do %>
|
||||
<div>
|
||||
<img src="<%= post.avatar_path or "/avatars/default.webp" %>">
|
||||
<div><%= post.username %></div>
|
||||
<div><p><%- require("lapis.html").escape(post.content):gsub("\n", "<br>") %></p></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if not user:is_guest() then %>
|
||||
<h1>Respond to "<%= thread.title %>"</h1>
|
||||
<form method="post">
|
||||
<textarea id="post_content" name="post_content" placeholder="Response body" required></textarea><br>
|
||||
<input type="submit" value="Reply">
|
||||
</form>
|
||||
<% end %>
|
||||
<% if next_cursor then %>
|
||||
<a href="<%= url_for('thread', {slug = thread.slug}, {cursor = next_cursor}) %>">
|
||||
Older posts →
|
||||
</a>
|
||||
<% end %>
|
Reference in New Issue
Block a user