Can lock theme

This commit is contained in:
nemunaire 2023-03-20 15:20:20 +01:00
commit d4ce0dd474
9 changed files with 85 additions and 43 deletions

View file

@ -27,21 +27,31 @@
on:click
>
{#if theme.image}
<div class="card-img-top" style="background-image: url({ theme.image.substr(0, theme.image.length-3) }thumb.jpg)"></div>
<div
class="card-img-top"
style="background-image: url({ theme.image.substr(0, theme.image.length-3) }thumb.jpg)"
style:filter={theme.locked ? "grayscale(60%)":null}
></div>
{/if}
<CardBody class="text-indent">
<CardTitle class="fw-bolder">
{#if $my && $my.team_id}
<div class="float-end">
{#if $max_solved > 1 && theme.solved == $max_solved}
<Badge color="danger">
<Icon name="heart-fill" />
</Badge>
{/if}
{#if theme.exercice_coeff_max > 1 || (exercice && exercice.curcoeff > 1)}
<Badge color="success">
<Icon name="gift-fill" />
{#if theme.locked}
<Badge color="light">
<Icon name="lock-fill" />
</Badge>
{:else}
{#if $max_solved > 1 && theme.solved == $max_solved}
<Badge color="danger">
<Icon name="heart-fill" />
</Badge>
{/if}
{#if theme.exercice_coeff_max > 1 || (exercice && exercice.curcoeff > 1)}
<Badge color="success">
<Icon name="gift-fill" />
</Badge>
{/if}
{/if}
{#if exercice && $my && $my.exercices[exercice.id] && $my.exercices[exercice.id].solved_rank}
<Badge color="light" class="text-success fw-bold">

View file

@ -52,7 +52,7 @@
{#each $themes as th, index}
<Col class="mb-3">
<CardTheme
class="{$my && $my.team_id && $myThemes[th.id].exercice_solved > 0?'border-light ':''}{th.exercice_coeff_max > 1?'border-success ':''}"
class="{$my && $my.team_id && $myThemes[th.id].exercice_solved > 0?'border-light ':''}{th.exercice_coeff_max > 1?'border-success ':''}{th.locked?' border-secondary ':''}"
theme={th}
on:click={goto(`${th.urlid}`)}
/>