diff --git a/frontend/src/i18n/locale/de.json b/frontend/src/i18n/locale/de.json index 6f20bec8..d20154a4 100644 --- a/frontend/src/i18n/locale/de.json +++ b/frontend/src/i18n/locale/de.json @@ -48,5 +48,8 @@ "enterSearchTerm": "Lernpfade suchen", "enterSearchTermDescription": "Bitte geben Sie einen Suchbegriff ein.", "noLearningPathsFound": "Nichts gefunden!", - "noLearningPathsFoundDescription": "Es gibt keine Lernpfade, die zu Ihrem Suchbegriff passen." + "noLearningPathsFoundDescription": "Es gibt keine Lernpfade, die zu Ihrem Suchbegriff passen.", + "legendNotCompletedYet": "Noch nicht fertig", + "legendCompleted": "Fertig", + "legendTeacherExclusive": "Information für Lehrkräfte" } diff --git a/frontend/src/i18n/locale/en.json b/frontend/src/i18n/locale/en.json index d563e9fc..8d7ed775 100644 --- a/frontend/src/i18n/locale/en.json +++ b/frontend/src/i18n/locale/en.json @@ -15,6 +15,9 @@ "enterSearchTermDescription": "Please enter a search term.", "noLearningPathsFound": "Nothing found!", "noLearningPathsFoundDescription": "There are no learning paths matching your search term.", + "legendNotCompletedYet": "Not completed yet", + "legendCompleted": "Completed", + "legendTeacherExclusive": "Information for teachers", "cancel": "cancel", "logoutVerification": "Are you sure you want to log out?", "homeTitle": "Our strengths", diff --git a/frontend/src/i18n/locale/fr.json b/frontend/src/i18n/locale/fr.json index c51c22c6..2dfbb949 100644 --- a/frontend/src/i18n/locale/fr.json +++ b/frontend/src/i18n/locale/fr.json @@ -8,7 +8,10 @@ "enterSearchTerm": "Rechercher des parcours d'apprentissage", "enterSearchTermDescription": "Saisissez un terme de recherche pour commencer.", "noLearningPathsFound": "Rien trouvé !", - "noLearningPathsFoundDescription": "Aucun parcours d'apprentissage ne correspond à votre recherche." + "noLearningPathsFoundDescription": "Aucun parcours d'apprentissage ne correspond à votre recherche.", + "legendNotCompletedYet": "Pas encore achevé", + "legendCompleted": "Achevé", + "legendTeacherExclusive": "Informations pour les enseignants", "student": "élève", "teacher": "enseignant", "assignments": "Travails", diff --git a/frontend/src/i18n/locale/nl.json b/frontend/src/i18n/locale/nl.json index f9cc9765..80cdd8e1 100644 --- a/frontend/src/i18n/locale/nl.json +++ b/frontend/src/i18n/locale/nl.json @@ -15,6 +15,9 @@ "enterSearchTermDescription": "Gelieve een zoekterm in te voeren.", "noLearningPathsFound": "Niets gevonden!", "noLearningPathsFoundDescription": "Er zijn geen leerpaden die overeenkomen met je zoekterm.", + "legendNotCompletedYet": "Nog niet afgewerkt", + "legendCompleted": "Afgewerkt", + "legendTeacherExclusive": "Informatie voor leerkrachten", "cancel": "annuleren", "logoutVerification": "Bent u zeker dat u wilt uitloggen?", "homeTitle": "Onze sterke punten", diff --git a/frontend/src/views/learning-paths/LearningPathPage.vue b/frontend/src/views/learning-paths/LearningPathPage.vue index 4a52a711..2a17b544 100644 --- a/frontend/src/views/learning-paths/LearningPathPage.vue +++ b/frontend/src/views/learning-paths/LearningPathPage.vue @@ -85,6 +85,7 @@ const navigationDrawerShown = ref(true); + function isLearningObjectCompleted(learningObject: LearningObject): boolean { if (learningPathResource.state.type === "success") { return learningPathResource.state.data.nodesAsList.filter(it => @@ -95,13 +96,28 @@ } return false; } - function getStatusIconForLearningObject(learningObject: LearningObject): {icon: string, color?: "success" | "info" | "warning" | "error"} { + + type NavItemState = "teacherExclusive" | "completed" | "notCompleted"; + + const ICONS: {[key: NavItemState]: string} = { + teacherExclusive: "mdi-information", + completed: "mdi-checkbox-marked-circle-outline", + notCompleted: "mdi-checkbox-blank-circle-outline" + } + + const COLORS: {[key: NavItemState]: string | undefined} = { + teacherExclusive: "info", + completed: "success", + notCompleted: undefined + } + + function getNavItemState(learningObject: LearningObject): NavItemState { if (learningObject.teacherExclusive) { - return {icon: "mdi-information", color: "info"}; + return "teacherExclusive"; } else if (isLearningObjectCompleted(learningObject)) { - return {icon: "mdi-checkbox-marked-circle-outline", color: "success"}; + return "completed"; } else { - return {icon: "mdi-checkbox-blank-circle-outline"}; + return "notCompleted"; } } @@ -116,6 +132,13 @@ :title="learningPath.data.title" :subtitle="learningPath.data.description" > + + +
@@ -132,8 +155,8 @@ >