ui: Ensure a message is shown when theme is disabled

This commit is contained in:
nemunaire 2023-04-03 23:23:42 +02:00
commit 1a21115503
3 changed files with 39 additions and 6 deletions

View file

@ -30,6 +30,15 @@
{#if $current_exercice}
<Card body class="niceborder text-indent my-3">
{#if $current_theme.locked}
<div style="position: absolute; z-index: 0; top: 0; bottom: 0; left: 0; right: 0;" class="d-flex justify-content-center align-items-center">
<div style="transform: rotate(-25deg)">
<div class="display-3 font-weight-bolder border border-danger text-danger px-3 py-1" style="opacity: 0.5; border-radius: 20px; border-width: 5px !important; font-family: 'Courier New'">
CONFIDENTIEL
</div>
</div>
</div>
{/if}
<h3 class="display-4">{$current_exercice.title}</h3>
<div>
{#each $current_exercice.tags as tag, index}
@ -181,6 +190,7 @@
{/if}
{#if $my.exercices[$current_exercice.id].hints}
<ExerciceHints
locked_theme={$current_theme.locked}
exercice={$my.exercices[$current_exercice.id]}
hints={$my.exercices[$current_exercice.id].hints}
/>
@ -188,11 +198,28 @@
</Col>
<Col lg="6" class="mb-5">
{#if $my.exercices[$current_exercice.id].flags && $my.exercices[$current_exercice.id].non_found_flags > 0 && !solved[$current_exercice.id]}
<ExerciceFlags
exercice={$my.exercices[$current_exercice.id]}
bind:forcesolved={solved[$current_exercice.id]}
flags={$my.exercices[$current_exercice.id].flags}
/>
{#if $current_theme.locked}
<Card class="border-danger mb-2">
<CardHeader class="bg-black text-light">
<Icon name="lock-fill" />
Faire son rapport
</CardHeader>
<CardBody>
<p>
Ce scénario n'est pas accessible&nbsp;!
</p>
<p>
Vous ne pouvez pas compléter son rapport.
</p>
</CardBody>
</Card>
{:else}
<ExerciceFlags
exercice={$my.exercices[$current_exercice.id]}
bind:forcesolved={solved[$current_exercice.id]}
flags={$my.exercices[$current_exercice.id].flags}
/>
{/if}
{/if}
{#if $my.exercices[$current_exercice.id].solved_rank || solved[$current_exercice.id]}
<ExerciceSolved