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:
1 parent
02b4c72233
commit
4e88f11ced
15 files changed
+193
-31
No files matched your search
@@ -13,6 +13,7 @@
|
|||||||
instance?: string | undefined
|
instance?: string | undefined
|
||||||
listing_type?: ListingType
|
listing_type?: ListingType
|
||||||
showWhenEmpty?: boolean
|
showWhenEmpty?: boolean
|
||||||
|
placeholder?: string
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
onselect?: (item: any) => void
|
onselect?: (item: any) => void
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@
|
|||||||
|
|
||||||
<div class="flex flex-row flex-wrap gap-1">
|
<div class="flex flex-row flex-wrap gap-1">
|
||||||
<Link highlight href="/modlog">
|
<Link highlight href="/modlog">
|
||||||
{$t('routes.modlog')}
|
{$t('routes.modlog.title')}
|
||||||
</Link>
|
</Link>
|
||||||
•
|
•
|
||||||
<Link highlight href="/legal">
|
<Link highlight href="/legal">
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
Fire,
|
Fire,
|
||||||
Icon,
|
Icon,
|
||||||
Megaphone,
|
Megaphone,
|
||||||
|
Newspaper,
|
||||||
ShieldExclamation,
|
ShieldExclamation,
|
||||||
Trash,
|
Trash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
@@ -88,6 +89,18 @@
|
|||||||
? $t('moderation.unfeature')
|
? $t('moderation.unfeature')
|
||||||
: $t('moderation.feature')}
|
: $t('moderation.feature')}
|
||||||
</MenuButton>
|
</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}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
LockClosed,
|
LockClosed,
|
||||||
LockOpen,
|
LockOpen,
|
||||||
Megaphone,
|
Megaphone,
|
||||||
|
Newspaper,
|
||||||
ShieldExclamation,
|
ShieldExclamation,
|
||||||
Trash,
|
Trash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
@@ -148,6 +149,14 @@
|
|||||||
? $t('moderation.ban.unbanFromCommunity')
|
? $t('moderation.ban.unbanFromCommunity')
|
||||||
: $t('moderation.ban.banFromCommunity')}
|
: $t('moderation.ban.banFromCommunity')}
|
||||||
</MenuButton>
|
</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}
|
{/if}
|
||||||
{#if profile.data?.user && isAdmin(profile.data.user)}
|
{#if profile.data?.user && isAdmin(profile.data.user)}
|
||||||
|
|||||||
@@ -32,11 +32,21 @@
|
|||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
|
|
||||||
let reason = $state('')
|
let reason = $state('')
|
||||||
let commentReason: boolean = $state(false)
|
let commentReason: boolean = $state(
|
||||||
let privateMessage: boolean = $state(false)
|
settings.moderation.defaultRemoveAction != null,
|
||||||
|
)
|
||||||
|
let privateMessage: boolean = $state(
|
||||||
|
settings.moderation.defaultRemoveAction == 'message',
|
||||||
|
)
|
||||||
let loading = $state(false)
|
let loading = $state(false)
|
||||||
let preset = $state(settings.moderation.presets[0]?.content ?? '')
|
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(
|
let removed = $derived(
|
||||||
item
|
item
|
||||||
? isCommentView(item)
|
? isCommentView(item)
|
||||||
@@ -163,7 +173,6 @@
|
|||||||
|
|
||||||
const resetText = () => {
|
const resetText = () => {
|
||||||
reason = ''
|
reason = ''
|
||||||
commentReason = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
run(() => {
|
run(() => {
|
||||||
|
|||||||
+10
-2
@@ -207,7 +207,10 @@
|
|||||||
"footer": "{{users:number}} active {{users; 1:user; default:users;}}",
|
"footer": "{{users:number}} active {{users; 1:user; default:users;}}",
|
||||||
"endFeed": "You have reached the end of {{community_name; undefined:the feed.; default:{{community_name}}.}}"
|
"endFeed": "You have reached the end of {{community_name; undefined:the feed.; default:{{community_name}}.}}"
|
||||||
},
|
},
|
||||||
"modlog": "Modlog",
|
"modlog": {
|
||||||
|
"title": "Modlog",
|
||||||
|
"filters": "Filters"
|
||||||
|
},
|
||||||
"instances": "Instances",
|
"instances": "Instances",
|
||||||
"legal": {
|
"legal": {
|
||||||
"title": "Legal",
|
"title": "Legal",
|
||||||
@@ -603,7 +606,12 @@
|
|||||||
"labelInstanceOnly": "Moderation (Instance Only)",
|
"labelInstanceOnly": "Moderation (Instance Only)",
|
||||||
"feature": "Feature",
|
"feature": "Feature",
|
||||||
"unfeature": "Unfeature",
|
"unfeature": "Unfeature",
|
||||||
"votes": "Votes"
|
"votes": "Votes",
|
||||||
|
"modlog": {
|
||||||
|
"user": "User moderation log",
|
||||||
|
"post": "Post moderation log",
|
||||||
|
"comment": "Comment moderation log"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"back": "Back",
|
"back": "Back",
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ interface Settings {
|
|||||||
nsfwBlur: boolean
|
nsfwBlur: boolean
|
||||||
moderation: {
|
moderation: {
|
||||||
presets: Preset[]
|
presets: Preset[]
|
||||||
|
defaultRemoveAction: 'comment' | 'message' | null
|
||||||
}
|
}
|
||||||
randomPlaceholders: boolean
|
randomPlaceholders: boolean
|
||||||
modlogCardView: boolean | undefined
|
modlogCardView: boolean | undefined
|
||||||
@@ -102,7 +103,7 @@ interface Settings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const defaultSettings: Settings = {
|
export const defaultSettings: Settings = {
|
||||||
settingsVer: 4,
|
settingsVer: 5,
|
||||||
expandableImages: toBool(env.PUBLIC_EXPANDABLE_IMAGES) ?? true,
|
expandableImages: toBool(env.PUBLIC_EXPANDABLE_IMAGES) ?? true,
|
||||||
markReadPosts: toBool(env.PUBLIC_MARK_READ_POSTS) ?? true,
|
markReadPosts: toBool(env.PUBLIC_MARK_READ_POSTS) ?? true,
|
||||||
showInstances: {
|
showInstances: {
|
||||||
@@ -138,6 +139,7 @@ export const defaultSettings: Settings = {
|
|||||||
content: `Your submission in *"{{post}}"* was removed for {{reason}}.`,
|
content: `Your submission in *"{{post}}"* was removed for {{reason}}.`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
defaultRemoveAction: null,
|
||||||
},
|
},
|
||||||
randomPlaceholders: toBool(env.PUBLIC_RANDOM_PLACEHOLDERS) ?? false,
|
randomPlaceholders: toBool(env.PUBLIC_RANDOM_PLACEHOLDERS) ?? false,
|
||||||
modlogCardView: toBool(env.PUBLIC_MODLOG_CARD_VIEW) ?? undefined,
|
modlogCardView: toBool(env.PUBLIC_MODLOG_CARD_VIEW) ?? undefined,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
import { Check, Funnel, Icon, Inbox } from 'svelte-hero-icons'
|
import { Check, Funnel, Icon, Inbox } from 'svelte-hero-icons'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
import Report from './Report.svelte'
|
import Report from './Report.svelte'
|
||||||
|
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||||
|
|
||||||
let { data = $bindable() } = $props()
|
let { data = $bindable() } = $props()
|
||||||
|
|
||||||
@@ -118,6 +119,11 @@
|
|||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
<Pageination
|
||||||
|
page={data.page}
|
||||||
|
href={current => `?page=${current}`}
|
||||||
|
hasMore={data.items.value.length >= 20}
|
||||||
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<Placeholder
|
<Placeholder
|
||||||
icon={Inbox}
|
icon={Inbox}
|
||||||
@@ -125,3 +131,4 @@
|
|||||||
description={$t('routes.moderation.empty.description')}
|
description={$t('routes.moderation.empty.description')}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
<div class="h-4"></div>
|
||||||
@@ -23,6 +23,12 @@
|
|||||||
import ModlogItemCard from './item/ModlogItemCard.svelte'
|
import ModlogItemCard from './item/ModlogItemCard.svelte'
|
||||||
import ModlogItemTable from './item/ModlogItemTable.svelte'
|
import ModlogItemTable from './item/ModlogItemTable.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
|
import { t } from '$lib/i18n/translations'
|
||||||
|
import { client } from '$lib/lemmy.svelte'
|
||||||
|
import Spinner from 'mono-svelte/loader/Spinner.svelte'
|
||||||
|
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
||||||
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
|
import { postLink } from '$lib/components/lemmy/post/helpers'
|
||||||
|
|
||||||
let { data = $bindable() } = $props()
|
let { data = $bindable() } = $props()
|
||||||
|
|
||||||
@@ -41,11 +47,91 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>Modlog</title>
|
<title>{$t('routes.modlog.title')}</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<Header pageHeader>Modlog</Header>
|
<Header pageHeader>
|
||||||
|
{$t('routes.modlog.title')}
|
||||||
|
{#snippet extended()}
|
||||||
|
<span class="font-medium text-lg">{$t('routes.modlog.filters')}</span>
|
||||||
|
<ul class="font-normal flex flex-col gap-2 mt-2">
|
||||||
|
{#if data.params.community}
|
||||||
|
<li>
|
||||||
|
<span class="text-sm text-slate-600 dark:text-zinc-400">
|
||||||
|
{$t('form.post.community')}
|
||||||
|
</span>
|
||||||
|
{#await client().getCommunity({ id: data.params.community })}
|
||||||
|
<Spinner width={24} />
|
||||||
|
{:then community}
|
||||||
|
<CommunityLink community={community.community_view.community} />
|
||||||
|
{/await}
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
{#if data.params.user}
|
||||||
|
<li>
|
||||||
|
<span class="text-sm text-slate-600 dark:text-zinc-400">
|
||||||
|
{$t('routes.admin.applications.user')}
|
||||||
|
</span>
|
||||||
|
{#await client().getPersonDetails( { person_id: data.params.user, limit: 1 }, )}
|
||||||
|
<Spinner width={24} />
|
||||||
|
{:then person}
|
||||||
|
<UserLink class="inline" user={person.person_view.person} />
|
||||||
|
{/await}
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
{#if data.params.moderator}
|
||||||
|
<li>
|
||||||
|
<span class="text-sm text-slate-600 dark:text-zinc-400">
|
||||||
|
<!--TODO add translation key-->
|
||||||
|
Moderator
|
||||||
|
</span>
|
||||||
|
{#await client().getPersonDetails( { person_id: data.params.moderator, limit: 1 }, )}
|
||||||
|
<Spinner width={24} />
|
||||||
|
{:then person}
|
||||||
|
<UserLink class="inline" user={person.person_view.person} />
|
||||||
|
{/await}
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
{#if data.params.post}
|
||||||
|
<li>
|
||||||
|
<span class="text-sm text-slate-600 dark:text-zinc-400">
|
||||||
|
<!--TODO add translation key-->
|
||||||
|
{$t('nav.create.post')}
|
||||||
|
</span>
|
||||||
|
{#await client().getPost({ id: data.params.post })}
|
||||||
|
<Spinner width={24} />
|
||||||
|
{:then post}
|
||||||
|
<a
|
||||||
|
class="hover:underline block"
|
||||||
|
href={postLink(post.post_view.post)}
|
||||||
|
>
|
||||||
|
{post.post_view.post.name}
|
||||||
|
</a>
|
||||||
|
{/await}
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
{#if data.params.comment}
|
||||||
|
<li>
|
||||||
|
<span class="text-sm text-slate-600 dark:text-zinc-400">
|
||||||
|
<!--TODO add translation key-->
|
||||||
|
{$t('moderation.removeSubmission.comment')}
|
||||||
|
</span>
|
||||||
|
{#await client().getComment({ id: data.params.comment })}
|
||||||
|
<Spinner width={24} />
|
||||||
|
{:then comment}
|
||||||
|
<a
|
||||||
|
class="hover:underline block"
|
||||||
|
href="/comment/{data.params.comment}"
|
||||||
|
>
|
||||||
|
{comment.comment_view.comment.content.slice(1, 200)}...
|
||||||
|
</a>
|
||||||
|
{/await}
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
</ul>
|
||||||
|
{/snippet}
|
||||||
|
</Header>
|
||||||
<div class="flex flex-row flex-wrap gap-2">
|
<div class="flex flex-row flex-wrap gap-2">
|
||||||
<Select
|
<Select
|
||||||
bind:value={data.type}
|
bind:value={data.type}
|
||||||
@@ -92,7 +178,6 @@
|
|||||||
<ObjectAutocomplete
|
<ObjectAutocomplete
|
||||||
type="instance"
|
type="instance"
|
||||||
placeholder="Filter by instance"
|
placeholder="Filter by instance"
|
||||||
jwt={profile.data?.jwt}
|
|
||||||
showWhenEmpty={true}
|
showWhenEmpty={true}
|
||||||
label="Instance"
|
label="Instance"
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
@@ -110,7 +195,6 @@
|
|||||||
/>
|
/>
|
||||||
<ObjectAutocomplete
|
<ObjectAutocomplete
|
||||||
placeholder="Filter by community"
|
placeholder="Filter by community"
|
||||||
jwt={profile.data?.jwt}
|
|
||||||
listing_type="All"
|
listing_type="All"
|
||||||
showWhenEmpty={true}
|
showWhenEmpty={true}
|
||||||
label="Community"
|
label="Community"
|
||||||
@@ -169,7 +253,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{#if data.modlog && data.modlog.length > 0}
|
{#if data.modlog && data.modlog.length > 0}
|
||||||
{#if settings.modlogCardView ?? !window.matchMedia('(min-width: 1600px)').matches}
|
{#if settings.modlogCardView ?? !window.matchMedia('(min-width: 1600px)').matches}
|
||||||
<div class="flex flex-col gap-4">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
{#each data.modlog as modlog (modlog)}
|
{#each data.modlog as modlog (modlog)}
|
||||||
<ModlogItemCard item={modlog} />
|
<ModlogItemCard item={modlog} />
|
||||||
{/each}
|
{/each}
|
||||||
@@ -181,14 +265,14 @@
|
|||||||
style="min-width: 800px;"
|
style="min-width: 800px;"
|
||||||
>
|
>
|
||||||
<colgroup class="table-fixed">
|
<colgroup class="table-fixed">
|
||||||
<col width="8%" />
|
<col />
|
||||||
<col width="18%" />
|
<col />
|
||||||
<col width="12%" class="overflow-x-auto" />
|
<col class="overflow-x-auto" />
|
||||||
<col width="8%" />
|
<col />
|
||||||
<col width="10%" />
|
<col />
|
||||||
<col width="18%" />
|
<col />
|
||||||
<col width="20%" />
|
<col />
|
||||||
<col width="20%" />
|
<col />
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead class="text-left sticky top-0">
|
<thead class="text-left sticky top-0">
|
||||||
<tr class="rounded-t-lg overflow-hidden">
|
<tr class="rounded-t-lg overflow-hidden">
|
||||||
|
|||||||
@@ -208,9 +208,13 @@ export const _toModLog = (item: ModAction): ModLog => {
|
|||||||
|
|
||||||
export async function load({ url }) {
|
export async function load({ url }) {
|
||||||
const instance = url.searchParams.get('instance') || undefined
|
const instance = url.searchParams.get('instance') || undefined
|
||||||
|
|
||||||
const community = Number(url.searchParams.get('community')) || undefined
|
const community = Number(url.searchParams.get('community')) || undefined
|
||||||
const user = Number(url.searchParams.get('user')) || undefined
|
const user = Number(url.searchParams.get('user')) || undefined
|
||||||
const modId = Number(url.searchParams.get('mod_id')) || undefined
|
const modId = Number(url.searchParams.get('mod_id')) || undefined
|
||||||
|
const postId = Number(url.searchParams.get('post')) || undefined
|
||||||
|
const commentId = Number(url.searchParams.get('comment')) || undefined
|
||||||
|
|
||||||
const page = Number(url.searchParams.get('page')) || 1
|
const page = Number(url.searchParams.get('page')) || 1
|
||||||
const type: ModlogActionType =
|
const type: ModlogActionType =
|
||||||
(url.searchParams.get('type') as ModlogActionType) || 'All'
|
(url.searchParams.get('type') as ModlogActionType) || 'All'
|
||||||
@@ -222,6 +226,8 @@ export async function load({ url }) {
|
|||||||
page: page,
|
page: page,
|
||||||
mod_person_id: modId,
|
mod_person_id: modId,
|
||||||
other_person_id: user,
|
other_person_id: user,
|
||||||
|
post_id: postId,
|
||||||
|
comment_id: commentId,
|
||||||
})
|
})
|
||||||
|
|
||||||
const moderation = [
|
const moderation = [
|
||||||
@@ -258,5 +264,12 @@ export async function load({ url }) {
|
|||||||
community: community ? moderationActions[0]?.community?.title : undefined,
|
community: community ? moderationActions[0]?.community?.title : undefined,
|
||||||
moderator: modId ? moderationActions[0]?.moderator?.name : undefined,
|
moderator: modId ? moderationActions[0]?.moderator?.name : undefined,
|
||||||
},
|
},
|
||||||
|
params: {
|
||||||
|
user: user,
|
||||||
|
community: community,
|
||||||
|
moderator: modId,
|
||||||
|
post: postId,
|
||||||
|
comment: commentId,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<tr class="">
|
<tr class="">
|
||||||
<td>
|
<td style="width: 10%;">
|
||||||
<span>
|
<span>
|
||||||
<RelativeDate date={new Date(item.timestamp)} />
|
<RelativeDate date={new Date(item.timestamp)} />
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -41,7 +41,9 @@
|
|||||||
|
|
||||||
<div class="w-full h-full flex flex-col justify-center mx-auto max-w-xl gap-6">
|
<div class="w-full h-full flex flex-col justify-center mx-auto max-w-xl gap-6">
|
||||||
<header class="space-y-1">
|
<header class="space-y-1">
|
||||||
<div class="font-mono bg-zinc-950 rounded-xs p-0.5 px-1 w-max">
|
<div
|
||||||
|
class="font-mono bg-slate-100 dark:bg-zinc-950 rounded-xs p-0.5 px-1 w-max"
|
||||||
|
>
|
||||||
{page.params.instance}/post/{page.params.id}
|
{page.params.instance}/post/{page.params.id}
|
||||||
</div>
|
</div>
|
||||||
<Header>
|
<Header>
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
You are being redirected.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { redirect } from '@sveltejs/kit'
|
||||||
|
|
||||||
|
export async function load() {
|
||||||
|
redirect(302, '/moderation')
|
||||||
|
}
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
Envelope,
|
Envelope,
|
||||||
Fire,
|
Fire,
|
||||||
Icon,
|
Icon,
|
||||||
|
Newspaper,
|
||||||
NoSymbol,
|
NoSymbol,
|
||||||
PencilSquare,
|
PencilSquare,
|
||||||
ShieldExclamation,
|
ShieldExclamation,
|
||||||
@@ -151,7 +152,7 @@
|
|||||||
|
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full">
|
<div class="flex flex-col gap-4 max-w-full w-full">
|
||||||
{#if !inline}
|
{#if !inline}
|
||||||
<Header pageHeader>
|
<Header pageHeader class="tracking-normal!">
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<EntityHeader
|
<EntityHeader
|
||||||
avatar={data.person_view.value.person.avatar}
|
avatar={data.person_view.value.person.avatar}
|
||||||
@@ -210,37 +211,44 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#snippet actions()}
|
{#snippet actions()}
|
||||||
{#if profile.data?.user && profile.data.jwt && data.person_view.value.person.id != profile.data.user.local_user_view.person.id}
|
{#if profile.data?.user && profile.data.jwt && data.person_view.value.person.id != profile.data.user.local_user_view.person.id}
|
||||||
<div class="flex items-center gap-2 w-full">
|
<div class="flex items-center gap-2 w-full flex-wrap">
|
||||||
<Button
|
<Button
|
||||||
size="square-md"
|
size="sm"
|
||||||
|
rounding="pill"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
href="/inbox/messages/{data.person_view.value.person.id}"
|
href="/inbox/messages/{data.person_view.value.person.id}"
|
||||||
title="Message"
|
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon solid size="16" src={Envelope} />
|
<Icon micro size="16" src={Envelope} />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
{$t('content.message')}
|
||||||
</Button>
|
</Button>
|
||||||
{#if data.person_view.value.person.matrix_user_id}
|
{#if data.person_view.value.person.matrix_user_id}
|
||||||
<Button
|
<Button
|
||||||
size="square-md"
|
size="sm"
|
||||||
|
rounding="pill"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
href="https://matrix.to/#/{data.person_view.value.person
|
href="https://matrix.to/#/{data.person_view.value.person
|
||||||
.matrix_user_id}"
|
.matrix_user_id}"
|
||||||
title="Matrix User"
|
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon solid size="16" src={AtSymbol} />
|
<Icon solid size="16" src={AtSymbol} />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
{$t('form.profile.matrix')}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
{#if isAdmin(profile.data?.user)}
|
{#if isAdmin(profile.data?.user)}
|
||||||
<Menu class="ml-auto" placement="bottom-end">
|
<Menu class="ml-auto" placement="bottom-end">
|
||||||
{#snippet target()}
|
{#snippet target()}
|
||||||
<Button size="square-md">
|
<Button size="sm" rounding="pill">
|
||||||
<ShieldIcon width={16} filled />
|
<ShieldIcon width={16} filled />
|
||||||
|
{$t('moderation.label')}
|
||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
<MenuButton color="success-subtle">
|
||||||
|
<Icon src={Newspaper} size="16" micro />
|
||||||
|
{$t('moderation.modlog.user')}
|
||||||
|
</MenuButton>
|
||||||
<MenuButton
|
<MenuButton
|
||||||
color="danger-subtle"
|
color="danger-subtle"
|
||||||
onclick={() =>
|
onclick={() =>
|
||||||
@@ -267,7 +275,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<Menu placement="bottom-end">
|
<Menu placement="bottom-end">
|
||||||
{#snippet target()}
|
{#snippet target()}
|
||||||
<Button size="square-md">
|
<Button size="custom" class="h-7 w-7" rounding="pill">
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={EllipsisHorizontal} size="16" mini />
|
<Icon src={EllipsisHorizontal} size="16" mini />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
Reference in new issue
Block a user