qa: Add spinners and rework

This commit is contained in:
nemunaire 2022-11-07 01:56:06 +01:00
parent 1aa82bb2ef
commit 8758effc99
8 changed files with 199 additions and 133 deletions

View file

@ -37,8 +37,18 @@
</h2> </h2>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6">{@html exercice.statement}</div> <div
<div class="col-md-6">{@html exercice.overview}</div> class="col-md-6"
style="overflow-y: auto; max-height: 50vh;"
>
{@html exercice.statement}
</div>
<div
class="col-md-6"
style="overflow-y: auto; max-height: 50vh;"
>
{@html exercice.overview}
</div>
</div> </div>
<div class="mb-5"> <div class="mb-5">

View file

@ -18,9 +18,7 @@
<Styles /> <Styles />
<Header /> <Header />
<Container class="mt-2 mb-5">
<slot></slot> <slot></slot>
</Container>
<style> <style>
:global(body) { :global(body) {

View file

@ -17,7 +17,9 @@
} }
</script> </script>
<Container class="mt-2 mb-5">
<Row> <Row>
<MyTodo class="col-6" /> <MyTodo class="col-6" />
<MyExercices class="col-6" /> <MyExercices class="col-6" />
</Row> </Row>
</Container>

View file

@ -2,7 +2,9 @@
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import { import {
Container,
Icon, Icon,
Spinner,
Table, Table,
} from 'sveltestrap'; } from 'sveltestrap';
@ -15,11 +17,15 @@
} }
</script> </script>
<Container class="mt-2 mb-5">
<h2> <h2>
Étapes Étapes
</h2> </h2>
{#await getExercices()} {#await getExercices()}
<div class="d-flex justify-content-center">
<Spinner size="lg" />
</div>
{:then exercices} {:then exercices}
<p> <p>
<input type="search" class="form-control form-control-sm" placeholder="Search" bind:value={query} autofocus> <input type="search" class="form-control form-control-sm" placeholder="Search" bind:value={query} autofocus>
@ -49,3 +55,4 @@
</tbody> </tbody>
</Table> </Table>
{/await} {/await}
</Container>

View file

@ -1,13 +1,33 @@
<script> <script>
import { goto } from '$app/navigation';
import { page } from '$app/stores'; import { page } from '$app/stores';
import {
Button,
Container,
Icon,
Spinner,
} from 'sveltestrap';
import { getExercice } from '$lib/exercices'; import { getExercice } from '$lib/exercices';
import ExerciceQA from '$lib/components/ExerciceQA.svelte'; import ExerciceQA from '$lib/components/ExerciceQA.svelte';
let exerciceP = getExercice($page.params.eid); let exerciceP = getExercice($page.params.eid);
</script> </script>
<Container class="mt-2 mb-5">
{#await exerciceP} {#await exerciceP}
<div class="d-flex justify-content-center">
<Spinner size="lg" />
</div>
{:then exercice} {:then exercice}
<Button
class="float-start"
color="link"
on:click={() => goto('exercices')}
>
<Icon name="chevron-left" />
</Button>
<ExerciceQA {exercice} /> <ExerciceQA {exercice} />
{/await} {/await}
</Container>

View file

@ -4,6 +4,7 @@
import { themes } from '$lib/stores/themes'; import { themes } from '$lib/stores/themes';
import { import {
Container,
Table, Table,
} from 'sveltestrap'; } from 'sveltestrap';
@ -17,6 +18,7 @@
} }
</script> </script>
<Container class="mt-2 mb-5">
<h2> <h2>
Scénarios Scénarios
</h2> </h2>
@ -52,3 +54,4 @@
{/each} {/each}
</tbody> </tbody>
</Table> </Table>
</Container>

View file

@ -7,6 +7,7 @@
Container, Container,
Icon, Icon,
Table, Table,
Spinner,
} from 'sveltestrap'; } from 'sveltestrap';
import { getTheme } from '$lib/themes'; import { getTheme } from '$lib/themes';
@ -19,7 +20,11 @@
} }
</script> </script>
<Container class="mt-2 mb-5">
{#await getTheme($page.params.tid)} {#await getTheme($page.params.tid)}
<div class="d-flex justify-content-center">
<Spinner size="lg" />
</div>
{:then theme} {:then theme}
<div class="d-flex align-items-end"> <div class="d-flex align-items-end">
<Button <Button
@ -74,3 +79,4 @@
</Table> </Table>
{/await} {/await}
{/await} {/await}
</Container>

View file

@ -1,13 +1,33 @@
<script> <script>
import { goto } from '$app/navigation';
import { page } from '$app/stores'; import { page } from '$app/stores';
import {
Button,
Container,
Icon,
Spinner,
} from 'sveltestrap';
import { getThemedExercice } from '$lib/exercices'; import { getThemedExercice } from '$lib/exercices';
import ExerciceQA from '$lib/components/ExerciceQA.svelte'; import ExerciceQA from '$lib/components/ExerciceQA.svelte';
let exerciceP = getThemedExercice($page.params.tid, $page.params.eid); let exerciceP = getThemedExercice($page.params.tid, $page.params.eid);
</script> </script>
<Container class="mt-2 mb-5">
{#await exerciceP} {#await exerciceP}
<div class="d-flex justify-content-center">
<Spinner size="lg" />
</div>
{:then exercice} {:then exercice}
<Button
class="float-start"
color="link"
on:click={() => goto('themes/' + $page.params.tid)}
>
<Icon name="chevron-left" />
</Button>
<ExerciceQA {exercice} /> <ExerciceQA {exercice} />
{/await} {/await}
</Container>