ui: Improve display of locked exercices

This commit is contained in:
nemunaire 2024-03-16 11:31:14 +01:00
parent 398de21793
commit 84b9e352ee
3 changed files with 11 additions and 4 deletions

View File

@ -48,6 +48,11 @@
<CardTitle class="fw-bolder">
{#if $my && $my.team_id}
<div class="float-end">
{#if exercice && $my && !$my.exercices[exercice.id]}
<Badge color="light">
<Icon name="lock-fill" />
</Badge>
{/if}
{#if theme.locked}
<Badge color="light">
<Icon name="lock-fill" />

View File

@ -42,13 +42,14 @@
i += 2;
}
if (j >= 0) {
if (j >= 0 || i == 1) {
tmpitems.push({
id: tmpitems.length,
theme: {
...$themesStore["0"],
name: "Voir les autres défis",
headline: "Il y a " + ($themesStore["0"].exercices.length) + " défis à découvrir&nbsp;! Cliquez ici pour les afficher.",
locked: $themesStore["0"].locked || i == 1,
},
color: "light",
});
@ -96,7 +97,8 @@
{@const theme = item.theme}
{@const exercice = item.exercice}
<CardTheme
class="{$my && $my.team_id && exercice.solved?'border-light ':''}{exercice.curcoeff > 1?'border-success ':''}{theme.locked || exercice.disabled?' border-secondary ':''}"
style="opacity: {$my && !$my.exercices[exercice.id] ? 0.6 : 1}"
class="{$my && $my.team_id && exercice.solved?'border-light ':''}{exercice.curcoeff > 1?'border-success ':''}{theme.locked || exercice.disabled || ($my && !$my.exercices[exercice.id])?' border-secondary ':''}"
{theme}
{exercice}
on:click={goto(`${theme.urlid}/${exercice.urlid}`)}

View File

@ -29,8 +29,8 @@
let:item={exercice}
>
<CardTheme
style="min-width: max(30vw,300px); width: max(30vw,300px)"
class="item {$my && $my.team_id && exercice.solved?'border-light ':''}{exercice.curcoeff > 1?'border-success ':''}{$current_theme.locked || exercice.disabled?' border-secondary ':''}"
style="opacity: {$my && !$my.exercices[exercice.id] ? 0.6 : 1}"
class="{$my && $my.team_id && exercice.solved?'border-light ':''}{exercice.curcoeff > 1?'border-success ':''}{$current_theme.locked || exercice.disabled || ($my && !$my.exercices[exercice.id])?' border-secondary ':''}"
theme={$current_theme}
{exercice}
on:click={goto(`${$current_theme.urlid}/${exercice.urlid}`)}