impr: moderation experience (#587)

* feat: display filters on the top

* feat: add grid view for modlog cards

* misc: add user modlog button

* fix: add pageination to moderation page

* feat: make reply reason save
This commit is contained in:
Xylight authored and GitHub committed 2025-06-17 20:49:07 -07:00
1 parent 02b4c72233
commit 4e88f11ced
15 files changed
+193 -31

No files matched your search

@@ -13,6 +13,7 @@
instance?: string | undefined
listing_type?: ListingType
showWhenEmpty?: boolean
placeholder?: string
// eslint-disable-next-line
onselect?: (item: any) => void
}
+1 -1
View File
@@ -134,7 +134,7 @@
<div class="flex flex-row flex-wrap gap-1">
<Link highlight href="/modlog">
{$t('routes.modlog')}
{$t('routes.modlog.title')}
</Link>
•
<Link highlight href="/legal">
@@ -5,6 +5,7 @@
Fire,
Icon,
Megaphone,
Newspaper,
ShieldExclamation,
Trash,
} from 'svelte-hero-icons'
@@ -88,6 +89,18 @@
? $t('moderation.unfeature')
: $t('moderation.feature')}
</MenuButton>
<MenuButton color="success-subtle" href="/modlog?user={item.creator.id}">
<Icon src={Newspaper} size="16" micro />
{$t('moderation.modlog.user')}
</MenuButton>
<MenuButton
color="success-subtle"
href="/modlog?comment={item.comment.id}"
>
<Icon src={Newspaper} size="16" micro />
{$t('moderation.modlog.comment')}
</MenuButton>
{/if}
{/if}
@@ -11,6 +11,7 @@
LockClosed,
LockOpen,
Megaphone,
Newspaper,
ShieldExclamation,
Trash,
} from 'svelte-hero-icons'
@@ -148,6 +149,14 @@
? $t('moderation.ban.unbanFromCommunity')
: $t('moderation.ban.banFromCommunity')}
</MenuButton>
<MenuButton color="success-subtle" href="/modlog?user={item.creator.id}">
<Icon src={Newspaper} size="16" micro />
{$t('moderation.modlog.user')}
</MenuButton>
<MenuButton color="success-subtle" href="/modlog?post={item.post.id}">
<Icon src={Newspaper} size="16" micro />
{$t('moderation.modlog.post')}
</MenuButton>
{/if}
{/if}
{#if profile.data?.user && isAdmin(profile.data.user)}
@@ -32,11 +32,21 @@
}: Props = $props()
let reason = $state('')
let commentReason: boolean = $state(false)
let privateMessage: boolean = $state(false)
let commentReason: boolean = $state(
settings.moderation.defaultRemoveAction != null,
)
let privateMessage: boolean = $state(
settings.moderation.defaultRemoveAction == 'message',
)
let loading = $state(false)
let preset = $state(settings.moderation.presets[0]?.content ?? '')
$effect(() => {
if (!commentReason) settings.moderation.defaultRemoveAction = null
else if (privateMessage) settings.moderation.defaultRemoveAction = 'message'
else settings.moderation.defaultRemoveAction = 'comment'
})
let removed = $derived(
item
? isCommentView(item)
@@ -163,7 +173,6 @@
const resetText = () => {
reason = ''
commentReason = false
}
run(() => {