ui: Next button is back!
This commit is contained in:
parent
0c7eecf315
commit
4d7161281d
1 changed files with 11 additions and 2 deletions
|
|
@ -13,6 +13,15 @@
|
||||||
|
|
||||||
export let theme = {};
|
export let theme = {};
|
||||||
export let exercice = {};
|
export let exercice = {};
|
||||||
|
|
||||||
|
let next = null;
|
||||||
|
$: {
|
||||||
|
for (const ex of theme.exercices) {
|
||||||
|
if (ex.id == exercice.id && ex.next) {
|
||||||
|
next = ex.next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Card class="border-success mb-2">
|
<Card class="border-success mb-2">
|
||||||
|
|
@ -36,8 +45,8 @@
|
||||||
<hr>
|
<hr>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{#if theme.exercices[exercice.id] && theme.exercices[exercice.id].next}
|
{#if next}
|
||||||
<a href="{theme.urlid}/{theme.exercices[theme.exercices[exercice.id].next].urlid}" class="btn btn-success">Passer au défi suivant</a>
|
<a href="{theme.urlid}/{theme.exercices[next].urlid}" class="btn btn-success">Passer au défi suivant</a>
|
||||||
{/if}
|
{/if}
|
||||||
</CardBody>
|
</CardBody>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
|
||||||
Reference in a new issue