From 246a980a2364e6807ed534866b21155ca301e8a2 Mon Sep 17 00:00:00 2001 From: Scott Date: Sat, 25 Nov 2017 17:41:18 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Added=20a=20delete=20action=20butto?= =?UTF-8?q?n=20next=20to=20the=20reply=20button=20on=20a=20thread?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- pages/threads/threads.pixy | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pages/threads/threads.pixy b/pages/threads/threads.pixy index 09120799..d56b6ef8 100644 --- a/pages/threads/threads.pixy +++ b/pages/threads/threads.pixy @@ -20,4 +20,9 @@ component Thread(thread *arn.Thread, posts []*arn.Post, user *arn.User) .buttons button.action(data-action="forumReply", data-trigger="click") Icon("mail-reply") - span Reply \ No newline at end of file + 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 + \ No newline at end of file