summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-08-02 12:20:00 +0200
committerTor Andersson <tor@ccxvii.net>2022-08-02 12:57:55 +0200
commit5c1d5d9c2a74502e40f67ef47337a97349be0d0d (patch)
treeccbc75c0511484708955b5a8772c14b8d24f4c89 /views
parentcaa863f358209117260911b88dca65a95948605d (diff)
downloadserver-5c1d5d9c2a74502e40f67ef47337a97349be0d0d.tar.gz
Moderation tools for admin user.
Ban and unban users. Delete forum posts and threads.
Diffstat (limited to 'views')
-rw-r--r--views/forum_thread.pug5
-rw-r--r--views/head.pug3
-rw-r--r--views/user.pug6
3 files changed, 13 insertions, 1 deletions
diff --git a/views/forum_thread.pug b/views/forum_thread.pug
index 3ed117e..be3f0f4 100644
--- a/views/forum_thread.pug
+++ b/views/forum_thread.pug
@@ -13,4 +13,7 @@ html
+forumpost(row,1)
if user
- p: a(href="/forum/reply/"+posts[0].post_id) Reply
+ if posts.length > 0
+ p: a(href="/forum/reply/"+posts[0].post_id) Reply
+ if user.user_id === 1
+ p: a(href="/admin/delete-thread/"+thread.thread_id) DELETE THREAD
diff --git a/views/head.pug b/views/head.pug
index 08f2660..4df5759 100644
--- a/views/head.pug
+++ b/views/head.pug
@@ -29,6 +29,9 @@ mixin forumpost(row,show_buttons)
.body!= row.body
if show_buttons && user
.edit
+ if user.user_id === 1
+ | #[a(href="/admin/delete-post/"+row.post_id) DELETE]
+ |
if row.author_id === user.user_id
| #[a(href="/forum/edit/"+row.post_id) Edit]
|
diff --git a/views/user.pug b/views/user.pug
index fb98da7..c28fbd0 100644
--- a/views/user.pug
+++ b/views/user.pug
@@ -38,3 +38,9 @@ html
+gamelist(finished_games)
p <a href="/games/finished/#{who.name}">All #{who.name}'s finished games</a>
+
+ if user && user.user_id === 1
+ if who.is_banned
+ p <a href="/admin/unban-user/#{who.name}">UNBAN USER</a>
+ else
+ p <a href="/admin/ban-user/#{who.name}">BAN USER</a>