ui: Working on works
This commit is contained in:
parent
b9acaa798b
commit
197c23736d
12 changed files with 475 additions and 10 deletions
39
ui/src/routes/works/[wid]/__layout.svelte
Normal file
39
ui/src/routes/works/[wid]/__layout.svelte
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<script context="module">
|
||||
import { getWork } from '../../../lib/works';
|
||||
|
||||
export async function load({ params, stuff }) {
|
||||
const work = getWork(params.wid);
|
||||
|
||||
return {
|
||||
props: {
|
||||
work,
|
||||
},
|
||||
stuff: {
|
||||
...stuff,
|
||||
work,
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
export let work;
|
||||
</script>
|
||||
|
||||
{#await work}
|
||||
<div class="text-center">
|
||||
<div class="spinner-border text-primary mx-3" role="status"></div>
|
||||
<span>Chargement du rendu …</span>
|
||||
</div>
|
||||
{:then}
|
||||
<slot></slot>
|
||||
{:catch error}
|
||||
<div class="text-center">
|
||||
<h2>
|
||||
<a href="works/" class="text-muted" style="text-decoration: none"><</a>
|
||||
Travail introuvable
|
||||
</h2>
|
||||
<span>{error}</span>
|
||||
</div>
|
||||
{/await}
|
||||
Reference in a new issue