i18n: localize ban modal
This commit is contained in:
1 parent
0066e2da2e
commit
76a0fa0495
2 files changed
+27
-16
No files matched your search
@@ -6,6 +6,8 @@
|
|||||||
import { profile } from '$lib/auth.js'
|
import { profile } from '$lib/auth.js'
|
||||||
import { Button, Checkbox, Modal, TextInput } from 'mono-svelte'
|
import { Button, Checkbox, Modal, TextInput } from 'mono-svelte'
|
||||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||||
|
import { t } from '$lib/translations'
|
||||||
|
import CommunityLink from '../community/CommunityLink.svelte'
|
||||||
|
|
||||||
export let open = false
|
export let open = false
|
||||||
let item: Person | undefined
|
let item: Person | undefined
|
||||||
@@ -101,42 +103,38 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal bind:open class="max-w-xl w-full">
|
<Modal bind:open class="max-w-xl w-full">
|
||||||
<h1 slot="title">{banned ? 'Unbanning' : 'Banning'} user</h1>
|
<h1 slot="title">
|
||||||
|
{banned ? $t('moderation.ban.unbanning') : $t('moderation.ban.banning')}
|
||||||
|
</h1>
|
||||||
{#if item}
|
{#if item}
|
||||||
<form class="flex flex-col gap-4" on:submit|preventDefault={submit}>
|
<form class="flex flex-col gap-4" on:submit|preventDefault={submit}>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
<Avatar url={item.avatar} alt={item.name} width={24} />
|
<Avatar url={item.avatar} alt={item.name} width={24} />
|
||||||
<span class="font-bold">{item.name}</span>
|
<span class="font-bold">{item.name}</span>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
{#if community}
|
||||||
{banned ? 'Unbanning' : 'Banning'} from
|
<CommunityLink {community} avatar />
|
||||||
<span class="font-bold">{community ? community.name : 'site'}</span>
|
{/if}
|
||||||
</p>
|
|
||||||
<MarkdownEditor
|
<MarkdownEditor
|
||||||
required
|
required
|
||||||
bind:value={reason}
|
bind:value={reason}
|
||||||
label="Reason"
|
label={$t('moderation.reason')}
|
||||||
placeholder="Why are you {banned
|
|
||||||
? 'unbanning'
|
|
||||||
: 'banning'} {item.name}?"
|
|
||||||
/>
|
/>
|
||||||
{#if !banned}
|
{#if !banned}
|
||||||
<Checkbox bind:checked={deleteData}>
|
<Checkbox bind:checked={deleteData}>
|
||||||
Delete data
|
{$t('moderation.ban.deleteData')}
|
||||||
<svelte:fragment slot="description">
|
<svelte:fragment slot="description">
|
||||||
This will delete ALL of this user's posts and comments on this {community
|
{$t('moderation.ban.warning')}
|
||||||
? 'community'
|
|
||||||
: 'site'}.
|
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
<TextInput
|
<TextInput
|
||||||
bind:value={expires}
|
bind:value={expires}
|
||||||
label="Expires (UTC)"
|
label={$t('moderation.ban.expires')}
|
||||||
placeholder="2024 August 5"
|
placeholder="2024 August 5"
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<Button submit color="primary" {loading} disabled={loading} size="lg">
|
<Button submit color="primary" {loading} disabled={loading} size="lg">
|
||||||
Submit
|
{$t('form.submit')}
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
+14
-1
@@ -391,7 +391,20 @@
|
|||||||
"locked": "This post is locked."
|
"locked": "This post is locked."
|
||||||
},
|
},
|
||||||
"moderation": {
|
"moderation": {
|
||||||
"report": "Report"
|
"report": "Report",
|
||||||
|
"ban": {
|
||||||
|
"banning": "Banning User",
|
||||||
|
"unbanning": "Unbanning User",
|
||||||
|
"deleteData": "Delete data",
|
||||||
|
"warning": "This will delete ALL of this user's submissions here.",
|
||||||
|
"expires": "Expires (UTC)"
|
||||||
|
},
|
||||||
|
"reason": "Reason",
|
||||||
|
"lock": "Lock",
|
||||||
|
"unlock": "Unlock",
|
||||||
|
"remove": "Remove",
|
||||||
|
"restore": "Restore",
|
||||||
|
"label": "Moderation"
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"back": "Back",
|
"back": "Back",
|
||||||
|
|||||||
Reference in new issue
Block a user