qa: Handle standalones exercices
This commit is contained in:
parent
a630075116
commit
c293b58a94
@ -44,6 +44,7 @@ export const exercicesByTheme = derived(
|
||||
const exercices_idx = { };
|
||||
|
||||
for (const e of $exercices) {
|
||||
if (!e.id_theme) e.id_theme = 0;
|
||||
if (!exercices_idx[e.id_theme]) {
|
||||
exercices_idx[e.id_theme] = []
|
||||
}
|
||||
|
@ -141,7 +141,7 @@
|
||||
bind:value={newTodo}
|
||||
>
|
||||
{#each Object.keys($exercicesByTheme) as thid}
|
||||
<optgroup label={$themesIdx[thid].name}>
|
||||
<optgroup label={(thid != "0" ? $themesIdx[thid].name : "Exercices indépendants")}>
|
||||
{#each $exercicesByTheme[thid] as exercice (exercice.id)}
|
||||
<option value={exercice.id}>{exercice.title}</option>
|
||||
{/each}
|
||||
@ -171,7 +171,9 @@
|
||||
bind:value={newThemeTodo}
|
||||
>
|
||||
{#each Object.keys($exercicesByTheme) as thid}
|
||||
{#if thid != "0"}
|
||||
<option value={$themesIdx[thid].id}>{$themesIdx[thid].name}</option>
|
||||
{/if}
|
||||
{/each}
|
||||
</select>
|
||||
<Button
|
||||
|
Loading…
Reference in New Issue
Block a user