diff --git a/frontend/src/components/home/cards/AnnouncementsCard.vue b/frontend/src/components/home/cards/AnnouncementsCard.vue deleted file mode 100644 index 7bd23daf..00000000 --- a/frontend/src/components/home/cards/AnnouncementsCard.vue +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/frontend/src/components/home/cards/SubjectsCard.vue b/frontend/src/components/home/cards/SubjectsCard.vue index 7ff5516b..4de370a5 100644 --- a/frontend/src/components/home/cards/SubjectsCard.vue +++ b/frontend/src/components/home/cards/SubjectsCard.vue @@ -1,7 +1,7 @@ - Error loading subjects + {{ $t("subject.error") }} {{ subject.name }} - - {{ instructors![0].given_name }} + + {{ sortedInstructors[0].given_name + " " + sortedInstructors[0].surname }} @@ -23,10 +23,18 @@ const props = defineProps<{ const { subject } = toRefs(props); -const { data: instructors, isLoading: isInstructorsLoading } = useSubjectInstructorsQuery( +const { data: instructorsData, isLoading: isInstructorsLoading } = useSubjectInstructorsQuery( computed(() => subject.value.id) ); +//sorteer zodat teachers voor assistenten tevoorschijn komen +const sortedInstructors = computed(() => { + if (!instructorsData.value) return []; + return instructorsData.value.slice().sort((a, b) => { + return b.is_teacher - a.is_teacher; + }); +}); + const navigateToCourse = () => { router.push(`/subjects/${subject.value.id}`); }; diff --git a/frontend/src/i18n/locales/en.ts b/frontend/src/i18n/locales/en.ts index 1c9c4c55..534e43e9 100644 --- a/frontend/src/i18n/locales/en.ts +++ b/frontend/src/i18n/locales/en.ts @@ -42,7 +42,7 @@ export default { files: "Files", download_info: "Click on filename to download", after_deadline: "After deadline", - submissions_title: "Submissions:", + submissions_title: "Submissions for project {project}", no_submissions: "No submissions yet", teacher_submissions_info: "This page contains a list of the latest submission of each group for this project.", @@ -115,6 +115,7 @@ export default { group: "Group", submissions: "Submissions", }, + error: "Error when loading subjects", create_project: "Create project", register_link_button: { title: "Register link", diff --git a/frontend/src/i18n/locales/nl.ts b/frontend/src/i18n/locales/nl.ts index 37693491..9b7259c5 100644 --- a/frontend/src/i18n/locales/nl.ts +++ b/frontend/src/i18n/locales/nl.ts @@ -2,7 +2,6 @@ export default { default: { error: { "not-found": "Pagina niet gevonden", - "something-went-wrong": "Er is iets misgegaan", }, loading: { loading_page: "Aan het laden...", @@ -42,7 +41,7 @@ export default { files: "Bestanden", download_info: "Klik op bestandsnaam om te downloaden", after_deadline: "Na deadline", - submissions_title: "Indieningen:", + submissions_title: "Indieningen voor project {project}", no_submissions: "Nog geen indieningen", teacher_submissions_info: "Deze pagina bevat een lijst van de laatste indiening van elke groep voor dit project.", @@ -122,6 +121,7 @@ export default { tooltip: "Kopieer de registratie link voor dit vak, deze kan gedeeld worden met studenten om zich te registreren voor het vak.", }, + error: "Fout bij het inladen van vakken", }, subjects: { diff --git a/frontend/src/views/HomeScreenView.vue b/frontend/src/views/HomeScreenView.vue index 5013ad5f..de629bd6 100644 --- a/frontend/src/views/HomeScreenView.vue +++ b/frontend/src/views/HomeScreenView.vue @@ -10,9 +10,6 @@ - - - Loading... @@ -26,9 +23,6 @@ - - - @@ -36,7 +30,6 @@
- {{ instructors![0].given_name }} +
+ {{ sortedInstructors[0].given_name + " " + sortedInstructors[0].surname }}