From b5065df4c30d9071de1debb5565977c65801a19d Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Fri, 29 Mar 2024 15:46:13 +0100 Subject: [PATCH] ui: Prepare publication --- admin/api/export.go | 3 +++ frontend/fic/src/lib/components/NavThemes.svelte | 2 +- frontend/fic/src/routes/+page.svelte | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/admin/api/export.go b/admin/api/export.go index 5a15f31d..32f43e79 100644 --- a/admin/api/export.go +++ b/admin/api/export.go @@ -31,6 +31,9 @@ func declareExportRoutes(router *gin.RouterGroup) { c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()}) return } + s.End = nil + s.NextChangeTime = nil + s.DelegatedQA = []string{} teams, err := fic.ExportTeams(false) if err != nil { diff --git a/frontend/fic/src/lib/components/NavThemes.svelte b/frontend/fic/src/lib/components/NavThemes.svelte index 919789c4..5b9b90d5 100644 --- a/frontend/fic/src/lib/components/NavThemes.svelte +++ b/frontend/fic/src/lib/components/NavThemes.svelte @@ -65,7 +65,7 @@ {#each $themesStore["0"].exercices as exercice, index} {exercice.title} - {#if exercice.solved} + {#if $my && $my.id_team && exercice.solved} diff --git a/frontend/fic/src/routes/+page.svelte b/frontend/fic/src/routes/+page.svelte index 464e5aed..c54dc5a6 100644 --- a/frontend/fic/src/routes/+page.svelte +++ b/frontend/fic/src/routes/+page.svelte @@ -26,7 +26,7 @@ document.body.style.backgroundColor = ""; let items = []; - $: { + function refresh_items() { const tmpitems = []; for (const th of $themes) { if (th.id == 0) continue; @@ -43,6 +43,8 @@ // Only apply after start if (!($time.startIn && j < nb_ex_max && j < $settings.unlockedStandaloneExercices)) continue; + } else if ($my && !$my.team_id && j >= nb_ex_max) { + continue; } tmpitems.splice(i, 0, {id: tmpitems.length, theme: $themesStore["0"], exercice: $themesStore["0"].exercices[j]}); @@ -65,6 +67,7 @@ items = tmpitems; } + $: refresh_items($themes);