feat: add legal page
This commit is contained in:
1 parent
da6f4bab6a
commit
e5a5046a47
3 files changed
+43
-17
No files matched your search
@@ -9,6 +9,7 @@
|
|||||||
import type { PersonView, SiteView, Tagline } from 'lemmy-js-client'
|
import type { PersonView, SiteView, Tagline } from 'lemmy-js-client'
|
||||||
import { Button, Popover } from 'mono-svelte'
|
import { Button, Popover } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
|
BuildingOffice,
|
||||||
Calendar,
|
Calendar,
|
||||||
ChatBubbleOvalLeftEllipsis,
|
ChatBubbleOvalLeftEllipsis,
|
||||||
Icon,
|
Icon,
|
||||||
@@ -34,33 +35,37 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span class="flex flex-row items-center gap-1 text-sm">
|
<span class="flex flex-row items-center gap-1 text-sm" title="Created">
|
||||||
<Icon src={Calendar} width={16} height={16} mini />
|
<Icon src={Calendar} width={16} height={16} mini />
|
||||||
<RelativeDate date={publishedToDate(site.site.published)} />
|
<RelativeDate date={publishedToDate(site.site.published)} />
|
||||||
</span>
|
</span>
|
||||||
<div class="text-sm flex flex-row flex-wrap gap-3">
|
<div class="text-sm flex flex-row flex-wrap gap-3" title="Users">
|
||||||
<span class="flex flex-row items-center gap-1">
|
<span class="flex flex-row items-center gap-1">
|
||||||
<Icon src={UserGroup} width={16} height={16} mini />
|
<Icon src={UserGroup} width={16} height={16} mini />
|
||||||
<FormattedNumber number={site.counts.users} />
|
<FormattedNumber number={site.counts.users} />
|
||||||
</span>
|
</span>
|
||||||
<span class="flex flex-row items-center gap-1">
|
<span class="flex flex-row items-center gap-1" title="Posts">
|
||||||
<Icon src={PencilSquare} width={16} height={16} mini />
|
<Icon src={PencilSquare} width={16} height={16} mini />
|
||||||
<FormattedNumber number={site.counts.posts} />
|
<FormattedNumber number={site.counts.posts} />
|
||||||
</span>
|
</span>
|
||||||
<span class="flex flex-row items-center gap-1">
|
<span class="flex flex-row items-center gap-1" title="Comments">
|
||||||
<Icon src={ChatBubbleOvalLeftEllipsis} width={16} height={16} mini />
|
<Icon src={ChatBubbleOvalLeftEllipsis} width={16} height={16} mini />
|
||||||
<FormattedNumber number={site.counts.comments} />
|
<FormattedNumber number={site.counts.comments} />
|
||||||
</span>
|
</span>
|
||||||
<span class="flex flex-row items-center gap-1">
|
<span class="flex flex-row items-center gap-1" title="Communities">
|
||||||
<Icon src={Newspaper} width={16} height={16} mini />
|
<Icon src={Newspaper} width={16} height={16} mini />
|
||||||
<FormattedNumber number={site.counts.communities} />
|
<FormattedNumber number={site.counts.communities} />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row gap-2 items-center">
|
<div class="flex flex-row items-center">
|
||||||
<Button href="/modlog">
|
<Button href="/modlog" size="md" class="rounded-r-none">
|
||||||
<Icon src={Newspaper} size="16" mini />
|
<Icon src={Newspaper} size="16" mini />
|
||||||
Modlog
|
Modlog
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button href="/legal" size="md" class="rounded-l-none border-l-0">
|
||||||
|
<Icon src={BuildingOffice} size="16" mini />
|
||||||
|
Legal
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if admins}
|
{#if admins}
|
||||||
|
|||||||
@@ -19,20 +19,11 @@
|
|||||||
$: if (source && div) {
|
$: if (source && div) {
|
||||||
replaceURLs(div)
|
replaceURLs(div)
|
||||||
}
|
}
|
||||||
|
|
||||||
let font =
|
|
||||||
$userSettings.font == 'system'
|
|
||||||
? 'font-system'
|
|
||||||
: $userSettings.font == 'browser'
|
|
||||||
? 'font-sans'
|
|
||||||
: inline
|
|
||||||
? 'font-inter'
|
|
||||||
: 'font-system'
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
bind:this={div}
|
bind:this={div}
|
||||||
class="break-words flex flex-col markdown gap-2 leading-[1.5] {font}"
|
class="break-words flex flex-col markdown gap-2 leading-[1.5]"
|
||||||
>
|
>
|
||||||
{#if inline}
|
{#if inline}
|
||||||
{@html mdInline.render(source)}
|
{@html mdInline.render(source)}
|
||||||
@@ -60,10 +51,18 @@
|
|||||||
@apply w-full mx-auto my-2 border-slate-300 dark:border-zinc-800;
|
@apply w-full mx-auto my-2 border-slate-300 dark:border-zinc-800;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:global(.dark .markdown hr) {
|
||||||
|
@apply w-full mx-auto my-2 border-zinc-800;
|
||||||
|
}
|
||||||
|
|
||||||
.markdown :global(img) {
|
.markdown :global(img) {
|
||||||
@apply max-h-[40vh] border rounded-md border-slate-200 dark:border-zinc-800;
|
@apply max-h-[40vh] border rounded-md border-slate-200 dark:border-zinc-800;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:global(.dark .markdown img) {
|
||||||
|
@apply border-zinc-800;
|
||||||
|
}
|
||||||
|
|
||||||
.markdown :global(a) {
|
.markdown :global(a) {
|
||||||
@apply text-sky-500 hover:underline;
|
@apply text-sky-500 hover:underline;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
|
||||||
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
|
import { site } from '$lib/lemmy'
|
||||||
|
import { Spinner } from 'mono-svelte'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="flex flex-row w-full">
|
||||||
|
{#if $site}
|
||||||
|
<div class="flex flex-col flex-1 gap-4">
|
||||||
|
<h1 class="font-bold text-2xl">Legal</h1>
|
||||||
|
<Markdown source={$site.site_view.local_site.legal_information} />
|
||||||
|
</div>
|
||||||
|
<SiteCard
|
||||||
|
site={$site.site_view}
|
||||||
|
admins={$site.admins}
|
||||||
|
taglines={$site.taglines}
|
||||||
|
/>
|
||||||
|
{:else}
|
||||||
|
<Spinner />
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
Reference in new issue
Block a user