qa: Add spinners and rework
This commit is contained in:
parent
1aa82bb2ef
commit
8758effc99
8 changed files with 199 additions and 133 deletions
|
|
@ -2,7 +2,9 @@
|
|||
import { goto } from '$app/navigation';
|
||||
|
||||
import {
|
||||
Container,
|
||||
Icon,
|
||||
Spinner,
|
||||
Table,
|
||||
} from 'sveltestrap';
|
||||
|
||||
|
|
@ -15,37 +17,42 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<h2>
|
||||
Étapes
|
||||
</h2>
|
||||
<Container class="mt-2 mb-5">
|
||||
<h2>
|
||||
Étapes
|
||||
</h2>
|
||||
|
||||
{#await getExercices()}
|
||||
{:then exercices}
|
||||
<p>
|
||||
<input type="search" class="form-control form-control-sm" placeholder="Search" bind:value={query} autofocus>
|
||||
</p>
|
||||
<Table class="table-hover table-bordered table-striped table-sm">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
{#each fieldsExercices as field}
|
||||
<th>
|
||||
{field}
|
||||
</th>
|
||||
{#await getExercices()}
|
||||
<div class="d-flex justify-content-center">
|
||||
<Spinner size="lg" />
|
||||
</div>
|
||||
{:then exercices}
|
||||
<p>
|
||||
<input type="search" class="form-control form-control-sm" placeholder="Search" bind:value={query} autofocus>
|
||||
</p>
|
||||
<Table class="table-hover table-bordered table-striped table-sm">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
{#each fieldsExercices as field}
|
||||
<th>
|
||||
{field}
|
||||
</th>
|
||||
{/each}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each exercices as exercice (exercice.id)}
|
||||
{#if exercice.title.indexOf(query) >= 0}
|
||||
<tr on:click={() => show(exercice.id)}>
|
||||
{#each fieldsExercices as field}
|
||||
<td>
|
||||
{@html exercice[field]}
|
||||
</td>
|
||||
{/each}
|
||||
</tr>
|
||||
{/if}
|
||||
{/each}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each exercices as exercice (exercice.id)}
|
||||
{#if exercice.title.indexOf(query) >= 0}
|
||||
<tr on:click={() => show(exercice.id)}>
|
||||
{#each fieldsExercices as field}
|
||||
<td>
|
||||
{@html exercice[field]}
|
||||
</td>
|
||||
{/each}
|
||||
</tr>
|
||||
{/if}
|
||||
{/each}
|
||||
</tbody>
|
||||
</Table>
|
||||
{/await}
|
||||
</tbody>
|
||||
</Table>
|
||||
{/await}
|
||||
</Container>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,33 @@
|
|||
<script>
|
||||
import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
import {
|
||||
Button,
|
||||
Container,
|
||||
Icon,
|
||||
Spinner,
|
||||
} from 'sveltestrap';
|
||||
|
||||
import { getExercice } from '$lib/exercices';
|
||||
import ExerciceQA from '$lib/components/ExerciceQA.svelte';
|
||||
|
||||
let exerciceP = getExercice($page.params.eid);
|
||||
</script>
|
||||
|
||||
{#await exerciceP}
|
||||
{:then exercice}
|
||||
<ExerciceQA {exercice} />
|
||||
{/await}
|
||||
<Container class="mt-2 mb-5">
|
||||
{#await exerciceP}
|
||||
<div class="d-flex justify-content-center">
|
||||
<Spinner size="lg" />
|
||||
</div>
|
||||
{:then exercice}
|
||||
<Button
|
||||
class="float-start"
|
||||
color="link"
|
||||
on:click={() => goto('exercices')}
|
||||
>
|
||||
<Icon name="chevron-left" />
|
||||
</Button>
|
||||
<ExerciceQA {exercice} />
|
||||
{/await}
|
||||
</Container>
|
||||
|
|
|
|||
Reference in a new issue