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

@ -15,6 +15,7 @@
export let hints = [];
export let exercice = {};
export let locked_theme = false;
let hints_submitted = {};
@ -117,7 +118,7 @@
{#if !(hint.content || hint.file) || (!hint.file && hint.hidden)}
<div>
{#if !(hint.content || hint.file)}
<button type="button" on:click={openHint(hint)} class="btn btn-info" class:disabled={hints_submitted[hint.id]} disabled={$settings.disablesubmitbutton}>
<button type="button" on:click={openHint(hint)} class="btn btn-info" class:disabled={hints_submitted[hint.id]} disabled={$settings.disablesubmitbutton || locked_theme}>
{#if hints_submitted[hint.id]}
<Spinner size="sm" class="me-2" />
{:else}

View file

@ -33,6 +33,11 @@
<Icon name="gift-fill" />
</Badge>
{/if}
{#if th.locked}
<Badge color="light">
<Icon name="lock-fill" />
</Badge>
{/if}
<Badge>
{#if $my && $my.team_id}{$myThemes[th.id].exercice_solved}/{/if}{th.exercice_count}
</Badge>