misc: add ban message when you try to comment
This commit is contained in:
1 parent
72a0aa799e
commit
70bebaa3bc
5 files changed
+11
-3
No files matched your search
@@ -179,6 +179,8 @@
|
|||||||
bind:comment={node.comment_view}
|
bind:comment={node.comment_view}
|
||||||
bind:replying
|
bind:replying
|
||||||
on:edit={() => (editing = true)}
|
on:edit={() => (editing = true)}
|
||||||
|
disabled={node.comment_view.banned_from_community ||
|
||||||
|
node.comment_view.post.locked}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
export let comment: CommentView
|
export let comment: CommentView
|
||||||
export let replying: boolean = false
|
export let replying: boolean = false
|
||||||
|
export let disabled = false
|
||||||
|
|
||||||
const dispatcher = createEventDispatcher<{ edit: CommentView }>()
|
const dispatcher = createEventDispatcher<{ edit: CommentView }>()
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@
|
|||||||
color="tertiary"
|
color="tertiary"
|
||||||
class="text-slate-600 dark:text-zinc-400"
|
class="text-slate-600 dark:text-zinc-400"
|
||||||
on:click={() => (replying = !replying)}
|
on:click={() => (replying = !replying)}
|
||||||
disabled={comment.post.locked}
|
disabled={comment.post.locked || disabled}
|
||||||
>
|
>
|
||||||
<Icon src={ArrowUturnLeft} width={14} height={14} mini />
|
<Icon src={ArrowUturnLeft} width={14} height={14} mini />
|
||||||
<span class="text-xs">{$t('comment.reply')}</span>
|
<span class="text-xs">{$t('comment.reply')}</span>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
export let postId: number
|
export let postId: number
|
||||||
export let parentId: number | undefined = undefined
|
export let parentId: number | undefined = undefined
|
||||||
export let locked: boolean = false
|
export let locked: boolean = false
|
||||||
|
export let banned: boolean = false
|
||||||
export let rows: number = 7
|
export let rows: number = 7
|
||||||
export let placeholder: string | undefined = undefined
|
export let placeholder: string | undefined = undefined
|
||||||
|
|
||||||
@@ -67,9 +68,11 @@
|
|||||||
{rows}
|
{rows}
|
||||||
placeholder={locked
|
placeholder={locked
|
||||||
? $t('comment.locked')
|
? $t('comment.locked')
|
||||||
|
: banned
|
||||||
|
? $t('comment.banned')
|
||||||
: placeholder ?? placeholders.get('comment')}
|
: placeholder ?? placeholders.get('comment')}
|
||||||
bind:value
|
bind:value
|
||||||
disabled={locked || loading}
|
disabled={locked || loading || banned}
|
||||||
on:confirm={() => {
|
on:confirm={() => {
|
||||||
if (actions) {
|
if (actions) {
|
||||||
submit()
|
submit()
|
||||||
@@ -87,7 +90,7 @@
|
|||||||
size="lg"
|
size="lg"
|
||||||
class="sm:ml-auto w-28"
|
class="sm:ml-auto w-28"
|
||||||
{loading}
|
{loading}
|
||||||
disabled={locked || loading}
|
disabled={locked || loading || banned}
|
||||||
>
|
>
|
||||||
{$t('form.submit')}
|
{$t('form.submit')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -417,6 +417,7 @@
|
|||||||
"link": "Copy Link"
|
"link": "Copy Link"
|
||||||
},
|
},
|
||||||
"locked": "This post is locked.",
|
"locked": "This post is locked.",
|
||||||
|
"banned": "You are banned from this community.",
|
||||||
"more": "{{comments:number}} more"
|
"more": "{{comments:number}} more"
|
||||||
},
|
},
|
||||||
"moderation": {
|
"moderation": {
|
||||||
|
|||||||
@@ -352,6 +352,7 @@ flex-wrap gap-4 sticky top-20 w-full box-border z-20 mt-4"
|
|||||||
.includes(data.post.community_view.community.id)
|
.includes(data.post.community_view.community.id)
|
||||||
)) ||
|
)) ||
|
||||||
$page.params.instance.toLowerCase() != $instance.toLowerCase()}
|
$page.params.instance.toLowerCase() != $instance.toLowerCase()}
|
||||||
|
banned={data.post.community_view.banned_from_community}
|
||||||
on:focus={() => (commenting = true)}
|
on:focus={() => (commenting = true)}
|
||||||
tools={commenting}
|
tools={commenting}
|
||||||
preview={commenting}
|
preview={commenting}
|
||||||
|
|||||||
Reference in new issue
Block a user