add guild info in post, report and edit button
This commit is contained in:
parent
cd92a4b12e
commit
c33ab48225
4 changed files with 27 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { DateTime } from "luxon";
|
||||
|
||||
import { RiHistoryLine, RiHome2Line, RiUserLine } from "svelte-remixicon";
|
||||
import { RiEditLine, RiFlagLine, RiHistoryLine, RiHome2Line, RiUserLine } from "svelte-remixicon";
|
||||
import type { PostEntry } from "./backend";
|
||||
import SLayout from "./SLayout.svelte";
|
||||
import GuildAbout from "./GuildAbout.svelte";
|
||||
|
|
@ -11,10 +11,13 @@
|
|||
import GuildMenu from "./GuildMenu.svelte";
|
||||
import { SvelteShowdown } from "svelte-showdown";
|
||||
import VoteButton from "./VoteButton.svelte";
|
||||
import { getMe } from "./globals.svelte";
|
||||
|
||||
|
||||
|
||||
let { post }: { post: PostEntry } = $props();
|
||||
|
||||
let me = getMe();
|
||||
let { title, created_at, id, content = '', to } = post;
|
||||
</script>
|
||||
|
||||
|
|
@ -36,6 +39,12 @@ let { title, created_at, id, content = '', to } = post;
|
|||
<VoteButton />
|
||||
</div>
|
||||
<ul class="message-options row">
|
||||
{#if me && me.id !== post.author?.id}
|
||||
<li><a href="/report/post/{id}"><RiFlagLine/> Report</a></li>
|
||||
{/if}
|
||||
{#if me && me.id === post.author?.id }
|
||||
<li><a href="/edit/post/{id}"><RiEditLine/> Edit</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
</article>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue