Added a delete action button next to the reply button on a thread

This button is accessible only to connected users and members of the staff.
As for the post deletion, this action requires validating the choice of deleting
a thread to avoid deleting a thread by mistake.

After deleting a thread the user is redirected to the forum.
This commit is contained in:
Scott 2017-11-25 17:41:18 +01:00
parent 1c23d6d2a5
commit 246a980a23

View File

@ -20,4 +20,9 @@ component Thread(thread *arn.Thread, posts []*arn.Post, user *arn.User)
.buttons .buttons
button.action(data-action="forumReply", data-trigger="click") button.action(data-action="forumReply", data-trigger="click")
Icon("mail-reply") Icon("mail-reply")
span Reply span Reply
if user.Role == "admin" || user.Role == "editor"
button.action(data-action="deleteObject", data-trigger="click", data-return-path="/forum", data-confirm-type="thread", data-api="/api/thread/" + thread.ID)
Icon("trash")
span Delete