ui: Working flags
This commit is contained in:
parent
ef899ee99b
commit
1def2c97c1
8 changed files with 340 additions and 15 deletions
|
|
@ -18,6 +18,8 @@
|
|||
props: {
|
||||
theme: context.theme,
|
||||
exercice: exercice,
|
||||
refresh_my: context.refresh_my,
|
||||
refresh_teams: context.refresh_teams,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -45,6 +47,9 @@
|
|||
|
||||
export let theme;
|
||||
export let exercice;
|
||||
|
||||
export let refresh_my;
|
||||
export let refresh_teams;
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
|
@ -147,8 +152,13 @@
|
|||
</Col>
|
||||
{/if}
|
||||
<Col lg class="mb-5">
|
||||
{#if !$my.exercices[exercice.id].solved}
|
||||
<ExerciceFlags {exercice} flags={$my.exercices[exercice.id].flags} />
|
||||
{#if !$my.exercices[exercice.id].solved_rank}
|
||||
<ExerciceFlags
|
||||
{refresh_my}
|
||||
{refresh_teams}
|
||||
exercice={$my.exercices[exercice.id]}
|
||||
flags={$my.exercices[exercice.id].flags}
|
||||
/>
|
||||
{:else}
|
||||
<ExerciceSolved theme={theme} exercice={$my.exercices[exercice.id]} />
|
||||
{/if}
|
||||
|
|
|
|||
|
|
@ -38,19 +38,19 @@
|
|||
on:click={goto(`/${theme.urlid}/${theme.exercices[k].urlid}`)}
|
||||
>
|
||||
<div class="row">
|
||||
<div class="col-1" style="margin-top: -0.5rem; margin-bottom: -0.5rem; text-align: right; border-right: 5px solid #{$my && $my.exercices[k] && $my.exercices[k].solved ? '62c462' : 'aaa'}">
|
||||
<div class="col-1" style="margin-top: -0.5rem; margin-bottom: -0.5rem; text-align: right; border-right: 5px solid #{$my && $my.exercices[k] && $my.exercices[k].solved_rank ? '62c462' : 'aaa'}">
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<div style="position: absolute; margin-left: calc(var(--bs-gutter-x) * -.5 - 15px); margin-top: -0.5rem;">
|
||||
<svg style="height: 50px; width: 23px;">
|
||||
<rect
|
||||
style="fill:#{$my && $my.exercices[k] && (index < 1 || $my.exercices[Object.keys(theme.exercices)[index-1]].solved) ? '62c462' : 'aaa'}"
|
||||
style="fill:#{$my && $my.exercices[k] && (index < 1 || $my.exercices[Object.keys(theme.exercices)[index-1]].solved_rank) ? '62c462' : 'aaa'}"
|
||||
width="5"
|
||||
height="30"
|
||||
x="10"
|
||||
y="0" />
|
||||
<path
|
||||
style="fill:#{$my && $my.exercices[k] ? ($my.exercices[k].solved ? '62c462' : (theme.exercices[k].curcoeff > 1.0 ? 'f89406' : '5bc0de')) : '555'}"
|
||||
style="fill:#{$my && $my.exercices[k] ? ($my.exercices[k].solved_rank ? '62c462' : (theme.exercices[k].curcoeff > 1.0 ? 'f89406' : '5bc0de')) : '555'}"
|
||||
d="m 22,20 a 9.5700617,9.5700617 0 0 1 -9.5690181,9.57006 9.5700617,9.5700617 0 0 1 -9.57110534,-9.56797 9.5700617,9.5700617 0 0 1 9.56692984,-9.57215 9.5700617,9.5700617 0 0 1 9.5731926,9.56588" />
|
||||
</svg>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
refresh_my((my) => {
|
||||
if (my && my.team_id) {
|
||||
goto('/');
|
||||
} else {
|
||||
} else if (i > 0) {
|
||||
setTimeout(gotoHomeOnDiff, 650, i-1);
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Reference in a new issue