fix: improve consistency for user headers
This commit is contained in:
6 files changed
+73
-63
No files matched your search
@@ -46,7 +46,7 @@
|
||||
|
||||
{#snippet extended()}
|
||||
<form class="" method="get" action="/">
|
||||
<div class="flex flex-row gap-4">
|
||||
<div class="flex flex-row gap-2">
|
||||
{#if data.filters.value.type_}
|
||||
<Location
|
||||
name="type"
|
||||
|
||||
@@ -143,8 +143,7 @@
|
||||
<Button
|
||||
loading={formData.addingModerator}
|
||||
disabled={formData.addingModerator}
|
||||
size="lg"
|
||||
class="w-max shrink-0"
|
||||
rounding="xl"
|
||||
color="primary"
|
||||
submit
|
||||
>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { defaultSettings, settings } from '$lib/settings.svelte'
|
||||
import { Button, toast, Modal } from 'mono-svelte'
|
||||
import { Button, toast, Modal, modal, action } from 'mono-svelte'
|
||||
import TextArea from 'mono-svelte/forms/TextArea.svelte'
|
||||
import {
|
||||
ArrowDownTray,
|
||||
@@ -78,11 +78,20 @@
|
||||
</Button>
|
||||
<Button
|
||||
onclick={() => {
|
||||
toast({
|
||||
content: $t('toast.resetSettings'),
|
||||
action: () => {
|
||||
Object.assign(settings, defaultSettings)
|
||||
},
|
||||
modal({
|
||||
title: $t('settings.reset'),
|
||||
body: $t('toast.resetSettings'),
|
||||
actions: [
|
||||
action({
|
||||
action: () => Object.assign(settings, defaultSettings),
|
||||
close: true,
|
||||
type: 'danger',
|
||||
content: $t('settings.reset'),
|
||||
}),
|
||||
action({
|
||||
content: $t('common.cancel'),
|
||||
}),
|
||||
],
|
||||
})
|
||||
}}
|
||||
rounding="pill"
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
<Button
|
||||
size="sm"
|
||||
rounding="pill"
|
||||
color="secondary"
|
||||
color="primary"
|
||||
href="/inbox/messages/{data.person_view.value.person.id}"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
@@ -278,8 +278,8 @@
|
||||
</Menu>
|
||||
{/if}
|
||||
<Menu placement="bottom-end">
|
||||
{#snippet target()}
|
||||
<Button size="custom" class="h-7 w-7" rounding="pill">
|
||||
{#snippet target(attachment)}
|
||||
<Button {@attach attachment} size="custom" class="h-8 w-8" rounding="pill">
|
||||
{#snippet prefix()}
|
||||
<Icon src={EllipsisHorizontal} size="16" mini />
|
||||
{/snippet}
|
||||
@@ -305,56 +305,58 @@
|
||||
{/snippet}
|
||||
</EntityHeader>
|
||||
</div>
|
||||
{#snippet extended()}
|
||||
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
||||
<form
|
||||
action={page.url.origin + page.url.pathname}
|
||||
method="GET"
|
||||
class="flex flex-row gap-4 flex-wrap"
|
||||
bind:this={sortForm}
|
||||
>
|
||||
<Select
|
||||
bind:value={data.filters.value.type}
|
||||
name="type"
|
||||
onchange={() => sortForm?.requestSubmit()}
|
||||
>
|
||||
{#snippet customLabel()}
|
||||
<span class="flex items-center gap-1">
|
||||
<Icon src={AdjustmentsHorizontal} size="15" mini />
|
||||
{$t('filter.type')}
|
||||
</span>
|
||||
{/snippet}
|
||||
<Option value="all">{$t('content.all')}</Option>
|
||||
<Option value="posts">{$t('content.posts')}</Option>
|
||||
<Option value="comments">{$t('content.comments')}</Option>
|
||||
</Select>
|
||||
<Sort
|
||||
bind:selected={data.filters.value.sort}
|
||||
onchange={() => sortForm?.requestSubmit()}
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
{/snippet}
|
||||
</Header>
|
||||
{/if}
|
||||
|
||||
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
||||
<form
|
||||
action={page.url.origin + page.url.pathname}
|
||||
method="GET"
|
||||
class="flex flex-row gap-4 flex-wrap"
|
||||
bind:this={sortForm}
|
||||
>
|
||||
<Select
|
||||
bind:value={data.filters.value.type}
|
||||
name="type"
|
||||
onchange={() => sortForm?.requestSubmit()}
|
||||
>
|
||||
{#snippet customLabel()}
|
||||
<span class="flex items-center gap-1">
|
||||
<Icon src={AdjustmentsHorizontal} size="15" mini />
|
||||
{$t('filter.type')}
|
||||
</span>
|
||||
{/snippet}
|
||||
<Option value="all">{$t('content.all')}</Option>
|
||||
<Option value="posts">{$t('content.posts')}</Option>
|
||||
<Option value="comments">{$t('content.comments')}</Option>
|
||||
</Select>
|
||||
<Sort
|
||||
bind:selected={data.filters.value.sort}
|
||||
onchange={() => sortForm?.requestSubmit()}
|
||||
/>
|
||||
</form>
|
||||
{#if data.items.value.length == 0}
|
||||
<Placeholder
|
||||
icon={PencilSquare}
|
||||
title="No submissions"
|
||||
description="This user has no submissions that match this filter."
|
||||
/>
|
||||
{:else}
|
||||
<CommonList items={data.items.value}>
|
||||
{#snippet item(item)}
|
||||
{#if isCommentView(item)}
|
||||
<CommentItem comment={item} />
|
||||
{:else if !isCommentView(item)}
|
||||
<PostItem post={item} />
|
||||
{/if}
|
||||
{/snippet}
|
||||
</CommonList>
|
||||
{/if}
|
||||
<Pageination
|
||||
bind:page={data.filters.value.page}
|
||||
href={page => `?page=${page}`}
|
||||
{#if data.items.value.length == 0}
|
||||
<Placeholder
|
||||
icon={PencilSquare}
|
||||
title="No submissions"
|
||||
description="This user has no submissions that match this filter."
|
||||
/>
|
||||
</div>
|
||||
{:else}
|
||||
<CommonList items={data.items.value}>
|
||||
{#snippet item(item)}
|
||||
{#if isCommentView(item)}
|
||||
<CommentItem comment={item} />
|
||||
{:else if !isCommentView(item)}
|
||||
<PostItem post={item} />
|
||||
{/if}
|
||||
{/snippet}
|
||||
</CommonList>
|
||||
{/if}
|
||||
<Pageination
|
||||
bind:page={data.filters.value.page}
|
||||
href={page => `?page=${page}`}
|
||||
/>
|
||||
</div>
|
||||
Reference in new issue
Block a user