add ability to delete posts

This commit is contained in:
2025-05-25 04:29:15 +03:00
parent 8a9a5e5bd9
commit ca0256268b
6 changed files with 107 additions and 5 deletions

View File

@ -53,7 +53,13 @@
local reply_text = ("%s\n[quote]%s[/quote]\n---\n\n"):format(quote_src_text, post.original_markup)
%>
<button value="<%= reply_text %>" class="reply-button">Reply</button>
<% end %>
<% end %>
<%
local show_delete = (post.user_id == me.id and not ntob(thread.is_locked)) or me:is_mod()
if show_delete then
%>
<button class="critical post-delete-button" value="<%= post.id %>">Delete</button>
<% end %>
</span>
</div>
<div class="post-content">