From 6594ca30167a68aba46ddec5306044a4eaf8cd30 Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Tue, 5 Nov 2024 14:58:12 +0100 Subject: [PATCH] Add buttons for blocking and restoring all of a user's files --- res/include/md/abuse.md | 5 +- res/template/fragments/meta_tags.html | 2 +- svelte/src/admin_panel/Router.svelte | 2 +- .../admin_panel/user_bans/BanDetails.svelte | 64 +++++++ .../{ => user_bans}/UserBans.svelte | 168 +++++++++++------- .../admin_panel/user_bans/UserFiles.svelte | 120 +++++++++++++ .../admin_panel/user_bans/UserLists.svelte | 74 ++++++++ 7 files changed, 366 insertions(+), 69 deletions(-) create mode 100644 svelte/src/admin_panel/user_bans/BanDetails.svelte rename svelte/src/admin_panel/{ => user_bans}/UserBans.svelte (50%) create mode 100644 svelte/src/admin_panel/user_bans/UserFiles.svelte create mode 100644 svelte/src/admin_panel/user_bans/UserLists.svelte diff --git a/res/include/md/abuse.md b/res/include/md/abuse.md index d66e69a..c629cc4 100644 --- a/res/include/md/abuse.md +++ b/res/include/md/abuse.md @@ -28,10 +28,7 @@ will be removed when reported. under the _gore_ category. * **Gore** - Graphic and shocking videos or images depicting severe harm to - humans (or animals). I will clarify that I am not strictly against shocking - content, and it is also not illegal in most places. When a shocking video goes - viral it often ends up in the wrong places and it can cause mental issues for - unsuspecting viewers. For that reason I will remove it when it gets reported. + humans (or animals). * **Malware and computer viruses** - Software programs designed to cause harm to computer systems. Please attach some proof that the file actually contains diff --git a/res/template/fragments/meta_tags.html b/res/template/fragments/meta_tags.html index a2330bb..ba326ef 100644 --- a/res/template/fragments/meta_tags.html +++ b/res/template/fragments/meta_tags.html @@ -18,7 +18,7 @@ - +import Euro from "../../util/Euro.svelte"; +import { formatDataVolume, formatDate } from "../../util/Formatting.svelte"; + +export let row = {} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Username{row.user.username}
ID{row.user_id}
Email{row.user.email}
Subscription{row.user.subscription.name}
Credit balance
Storage used{formatDataVolume(row.user.storage_space_used, 3)}
FS Storage used{formatDataVolume(row.user.filesystem_storage_used, 3)}
+
+
+ + + + + + + + + {#each row.offences as offence (offence.ban_time)} + + + + + + + + {/each} +
ReasonReporterBan timeExpire timeFile
{offence.reason}{offence.reporter}{formatDate(offence.ban_time, true, true, false)}{formatDate(offence.expire_time, true, true, false)} + {#if offence.file_link} + + {offence.file_name} + + {/if} +
+
diff --git a/svelte/src/admin_panel/UserBans.svelte b/svelte/src/admin_panel/user_bans/UserBans.svelte similarity index 50% rename from svelte/src/admin_panel/UserBans.svelte rename to svelte/src/admin_panel/user_bans/UserBans.svelte index 38389ef..d58256a 100644 --- a/svelte/src/admin_panel/UserBans.svelte +++ b/svelte/src/admin_panel/user_bans/UserBans.svelte @@ -1,10 +1,12 @@ @@ -112,64 +148,63 @@ onMount(get_bans); -