ui: Improve display of locked exercices
This commit is contained in:
parent
398de21793
commit
84b9e352ee
@ -48,6 +48,11 @@
|
|||||||
<CardTitle class="fw-bolder">
|
<CardTitle class="fw-bolder">
|
||||||
{#if $my && $my.team_id}
|
{#if $my && $my.team_id}
|
||||||
<div class="float-end">
|
<div class="float-end">
|
||||||
|
{#if exercice && $my && !$my.exercices[exercice.id]}
|
||||||
|
<Badge color="light">
|
||||||
|
<Icon name="lock-fill" />
|
||||||
|
</Badge>
|
||||||
|
{/if}
|
||||||
{#if theme.locked}
|
{#if theme.locked}
|
||||||
<Badge color="light">
|
<Badge color="light">
|
||||||
<Icon name="lock-fill" />
|
<Icon name="lock-fill" />
|
||||||
|
@ -42,13 +42,14 @@
|
|||||||
i += 2;
|
i += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j >= 0) {
|
if (j >= 0 || i == 1) {
|
||||||
tmpitems.push({
|
tmpitems.push({
|
||||||
id: tmpitems.length,
|
id: tmpitems.length,
|
||||||
theme: {
|
theme: {
|
||||||
...$themesStore["0"],
|
...$themesStore["0"],
|
||||||
name: "Voir les autres défis",
|
name: "Voir les autres défis",
|
||||||
headline: "Il y a " + ($themesStore["0"].exercices.length) + " défis à découvrir ! Cliquez ici pour les afficher.",
|
headline: "Il y a " + ($themesStore["0"].exercices.length) + " défis à découvrir ! Cliquez ici pour les afficher.",
|
||||||
|
locked: $themesStore["0"].locked || i == 1,
|
||||||
},
|
},
|
||||||
color: "light",
|
color: "light",
|
||||||
});
|
});
|
||||||
@ -96,7 +97,8 @@
|
|||||||
{@const theme = item.theme}
|
{@const theme = item.theme}
|
||||||
{@const exercice = item.exercice}
|
{@const exercice = item.exercice}
|
||||||
<CardTheme
|
<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}
|
{theme}
|
||||||
{exercice}
|
{exercice}
|
||||||
on:click={goto(`${theme.urlid}/${exercice.urlid}`)}
|
on:click={goto(`${theme.urlid}/${exercice.urlid}`)}
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
let:item={exercice}
|
let:item={exercice}
|
||||||
>
|
>
|
||||||
<CardTheme
|
<CardTheme
|
||||||
style="min-width: max(30vw,300px); width: max(30vw,300px)"
|
style="opacity: {$my && !$my.exercices[exercice.id] ? 0.6 : 1}"
|
||||||
class="item {$my && $my.team_id && exercice.solved?'border-light ':''}{exercice.curcoeff > 1?'border-success ':''}{$current_theme.locked || exercice.disabled?' border-secondary ':''}"
|
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}
|
theme={$current_theme}
|
||||||
{exercice}
|
{exercice}
|
||||||
on:click={goto(`${$current_theme.urlid}/${exercice.urlid}`)}
|
on:click={goto(`${$current_theme.urlid}/${exercice.urlid}`)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user