feat: thema's dropdown

This commit is contained in:
Joyelle Ndagijimana 2025-03-25 22:57:20 +01:00
parent feb8b38ed1
commit ca59f8b767
8 changed files with 77 additions and 37 deletions

View file

@ -11,7 +11,7 @@
const role = auth.authState.activeRole; const role = auth.authState.activeRole;
const name: string = auth.authState.user!.profile.name!; const name: string = "";//auth.authState.user!.profile.name!;
const initials: string = name const initials: string = name
.split(" ") .split(" ")
.map((n) => n[0]) .map((n) => n[0])

View file

@ -39,5 +39,10 @@
"high-school": "16-18 jahre alt", "high-school": "16-18 jahre alt",
"older": "18 und älter" "older": "18 und älter"
}, },
"read-more": "Mehr lesen" "read-more": "Mehr lesen",
"new-assignment": "Neue Aufgabe",
"next": "nächste",
"previous": "vorherige",
"groups": "Gruppen",
"learning-path": "Lernpfad"
} }

View file

@ -40,5 +40,9 @@
"older": "18 and older" "older": "18 and older"
}, },
"read-more": "Read more", "read-more": "Read more",
"new-assignment": "New Assignment" "new-assignment": "New Assignment",
"next": "next",
"previous": "previous",
"groups": "Groups",
"learning-path": "Learning path"
} }

View file

@ -40,5 +40,9 @@
"older": "18 et plus" "older": "18 et plus"
}, },
"read-more": "En savoir plus", "read-more": "En savoir plus",
"new-assignment": "Nouveau travail" "new-assignment": "Nouveau travail",
"next": "suivant",
"previous": "précédent",
"groups": "Groupes",
"learning-path": "Parcours d'apprentissage"
} }

View file

@ -39,5 +39,10 @@
"high-school": "3e graad secundair", "high-school": "3e graad secundair",
"older": "Hoger onderwijs" "older": "Hoger onderwijs"
}, },
"read-more": "Lees meer" "read-more": "Lees meer",
"new-assignment": "Nieuwe opdracht",
"next": "volgende",
"previous": "vorige",
"groups": "Groepen",
"learning-path": "Leerpad"
} }

View file

@ -1,4 +1,4 @@
import { createRouter, createWebHistory } from "vue-router"; import {createRouter, createWebHistory} from "vue-router";
import MenuBar from "@/components/MenuBar.vue"; import MenuBar from "@/components/MenuBar.vue";
import SingleAssignment from "@/views/assignments/SingleAssignment.vue"; import SingleAssignment from "@/views/assignments/SingleAssignment.vue";
import SingleClass from "@/views/classes/SingleClass.vue"; import SingleClass from "@/views/classes/SingleClass.vue";
@ -22,24 +22,24 @@ const router = createRouter({
path: "/", path: "/",
name: "home", name: "home",
component: () => import("../views/HomePage.vue"), component: () => import("../views/HomePage.vue"),
meta: { requiresAuth: false }, meta: {requiresAuth: false},
}, },
{ {
path: "/login", path: "/login",
name: "LoginPage", name: "LoginPage",
component: () => import("../views/LoginPage.vue"), component: () => import("../views/LoginPage.vue"),
meta: { requiresAuth: false }, meta: {requiresAuth: false},
}, },
{ {
path: "/callback", path: "/callback",
component: CallbackPage, component: CallbackPage,
meta: { requiresAuth: false }, meta: {requiresAuth: false},
}, },
{ {
path: "/user", path: "/user",
component: MenuBar, component: MenuBar,
meta: { requiresAuth: true }, meta: {requiresAuth: true},
children: [ children: [
{ {
path: "", path: "",
@ -68,49 +68,55 @@ const router = createRouter({
path: "/theme/:id", path: "/theme/:id",
name: "Theme", name: "Theme",
component: SingleTheme, component: SingleTheme,
meta: { requiresAuth: true }, meta: {requiresAuth: true},
}, },
{ {
path: "/assignment/create", path: "/assignment",
name: "CreateAssigment", component: MenuBar,
component: CreateAssignment, meta: {requiresAuth: true},
meta: { requiresAuth: true }, children: [
}, {
{ path: "create",
path: "/assignment/:id", name: "CreateAssigment",
name: "SingleAssigment", component: CreateAssignment,
component: SingleAssignment, },
meta: { requiresAuth: true }, {
path: ":id",
name: "SingleAssigment",
component: SingleAssignment,
},
]
}, },
{ {
path: "/class/create", path: "/class/create",
name: "CreateClass", name: "CreateClass",
component: CreateClass, component: CreateClass,
meta: { requiresAuth: true }, meta: {requiresAuth: true},
}, },
{ {
path: "/class/:id", path: "/class/:id",
name: "SingleClass", name: "SingleClass",
component: SingleClass, component: SingleClass,
meta: { requiresAuth: true }, meta: {requiresAuth: true},
}, },
{ {
path: "/discussion/create", path: "/discussion/create",
name: "CreateDiscussion", name: "CreateDiscussion",
component: CreateDiscussion, component: CreateDiscussion,
meta: { requiresAuth: true }, meta: {requiresAuth: true},
}, },
{ {
path: "/discussion/:id", path: "/discussion/:id",
name: "SingleDiscussion", name: "SingleDiscussion",
component: SingleDiscussion, component: SingleDiscussion,
meta: { requiresAuth: true }, meta: {requiresAuth: true},
}, },
{ {
path: "/:catchAll(.*)", path: "/:catchAll(.*)",
name: "NotFound", name: "NotFound",
component: NotFound, component: NotFound,
meta: { requiresAuth: false }, meta: {requiresAuth: false},
}, },
], ],
}); });

View file

@ -16,10 +16,6 @@ export const THEMESITEMS: Record<string, string[]> = {
"algorithms": ["math_with_python", "python_programming", "stem", "algorithms", "basics_ai"], "algorithms": ["math_with_python", "python_programming", "stem", "algorithms", "basics_ai"],
}; };
export const AGEITEMS = [
"all", "primary-school", "lower-secondary", "upper-secondary", "high-school", "older"
];
export const AGE_TO_THEMES: Record<string, string[]> = { export const AGE_TO_THEMES: Record<string, string[]> = {
"all": THEMES_KEYS, "all": THEMES_KEYS,
"primary-school": ["wegostem", "computational_thinking", "physical_computing"], "primary-school": ["wegostem", "computational_thinking", "physical_computing"],

View file

@ -1,25 +1,43 @@
<script setup lang="ts"> <script setup lang="ts">
import { useI18n } from "vue-i18n"; import {useI18n} from "vue-i18n";
import { ref } from "vue"; import {ref, shallowRef} from "vue";
const { t } = useI18n(); import {THEMESITEMS} from "@/utils/constants.ts";
const {t} = useI18n();
const step = ref(1); const step = ref(1);
// Use a list with all themes so learning-paths can be filtered by theme
const themeItems = ref(Object.keys(THEMESITEMS).slice(1));
const value = shallowRef([]);
</script> </script>
<template> <template>
<div class="main-container"> <div class="main-container">
<h1 class="title">{{ t("new-assignment") }}</h1> <h1 class="title">{{ t("new-assignment") }}</h1>
<v-card class="form-card"> <v-card class="form-card">
<v-stepper class="stepper-container" alt-labels :items="['Learning path', 'Classes', 'Groups']" v-model="step" show-actions> <v-stepper class="stepper-container" alt-labels :items="[t('learning-path'), t('classes'), t('groups')]"
v-model="step" show-actions>
<template v-slot:item.1> <template v-slot:item.1>
<v-card title="Step One" flat> <v-card title="Select a learning path" flat>
<v-container class="step-container">
<v-select
v-model="value"
:items="themeItems.map(theme => ({ title: t(`theme-options.${theme}`), value: theme }))"
label="Filter by themes"
chips
multiple
deletable-chips
clearable
></v-select>
</v-container>
</v-card> </v-card>
</template> </template>
<template> <template>
<v-card title="Step Two" flat> <v-card title="Select one or more classes" flat>
<v-container class="step-container"> <v-container class="step-container">
<!-- Content for Step Two --> <!-- Content for Step Two -->
</v-container> </v-container>
@ -63,6 +81,8 @@
.stepper-container { .stepper-container {
width: 100%; width: 100%;
display: flex;
flex-direction: column;
} }
.step-container { .step-container {
@ -73,7 +93,7 @@
} }
/* Responsive adjustments */ /* Responsive adjustments */
@media (max-width: 600px) { @media (max-width: 650px) {
.form-card { .form-card {
width: 95%; width: 95%;
padding: 1%; padding: 1%;