This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
atsebay.t/ui/src/routes/works/[wid]/index.svelte

35 lines
821 B
Svelte
Raw Normal View History

2022-07-08 09:53:50 +00:00
<script context="module">
import { getWork } from '../../../lib/works';
export async function load({ params, stuff }) {
return {
props: {
work: stuff.work,
},
};
}
</script>
<script lang="ts">
import { goto } from '$app/navigation';
import { user } from '../../../stores/user';
import SurveyBadge from '../../../components/SurveyBadge.svelte';
import WorkAdmin from '../../../components/WorkAdmin.svelte';
export let work = null;
</script>
{#await work then w}
<div class="d-flex align-items-center">
<h2>
<a href="works/" class="text-muted" style="text-decoration: none">&lt;</a>
{w.title}
</h2>
</div>
{#if $user && $user.is_admin}
<WorkAdmin work={w} on:saved={() => edit = false} />
{/if}
{/await}