Skip to content
Snippets Groups Projects
Commit dc851092 authored by Julian's avatar Julian
Browse files

Create better stats in LessonNotes

parent 2e64db7b
No related branches found
No related tags found
1 merge request!360Resolve "Add absence management to course book student dialog"
Pipeline #189197 failed
<script setup>
import AbsenceReasonChip from "aleksis.apps.kolego/components/AbsenceReasonChip.vue";
</script>
<template> <template>
<div <div
class="d-flex align-center justify-space-between justify-md-end flex-wrap gap" class="d-flex align-center justify-space-between justify-md-end flex-wrap gap"
> >
<!-- eslint-disable @intlify/vue-i18n/no-raw-text --> <v-chip dense color="success" outlined v-if="total > 0">
<v-chip dense color="success"> {{ $t("alsijil.coursebook.present_number", { present, total })}}
<v-chip small dense class="mr-2" color="green darken-3 white--text">
{{ documentation.participations.length }}
</v-chip>
Schüler
</v-chip>
<v-chip dense color="warning">
<v-chip small dense class="mr-2" color="orange darken-3 white--text"
>3</v-chip
>
entschuldigt
</v-chip> </v-chip>
<v-chip dense color="error"> <absence-reason-chip
<v-chip small dense class="mr-2" color="red darken-3 white--text" v-for="participation in absences"
>1</v-chip :absence-reason="participation.absenceReason"
> dense
unentschuldigt >
</v-chip> <template #prepend>
<v-chip dense color="grey lighten-1"> {{ participation.person.fullName }}:
<v-chip small dense class="mr-2" color="grey darken-1 white--text" </template>
>4</v-chip </absence-reason-chip>
>
Hausaufgaben vergessen
</v-chip>
<!-- eslint-enable @intlify/vue-i18n/no-raw-text -->
<manage-students-trigger v-bind="documentationPartProps" /> <manage-students-trigger v-bind="documentationPartProps" />
</div> </div>
</template> </template>
...@@ -40,6 +31,18 @@ export default { ...@@ -40,6 +31,18 @@ export default {
name: "LessonNotes", name: "LessonNotes",
components: { ManageStudentsTrigger }, components: { ManageStudentsTrigger },
mixins: [documentationPartMixin], mixins: [documentationPartMixin],
computed: {
total() {
return this.documentation.participations.length;
},
present() {
return this.documentation.participations.filter(p => p.absenceReason === null).length;
},
absences() {
// Get all course attendants who have an absence reason
return this.documentation.participations.filter(p => p.absenceReason !== null);
},
},
}; };
</script> </script>
......
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
} }
} }
}, },
"title_plural": "Kursbuch" "title_plural": "Kursbuch",
"present_number": "{present}/{total} anwesend"
}, },
"excuse_types": { "excuse_types": {
"menu_title": "Entschuldigungsarten" "menu_title": "Entschuldigungsarten"
......
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
"courses": "Courses", "courses": "Courses",
"filter_for_obj": "Filter for group and course" "filter_for_obj": "Filter for group and course"
}, },
"present_number": "{present}/{total} present",
"no_data": "No lessons for the selected groups and courses in this period", "no_data": "No lessons for the selected groups and courses in this period",
"no_results": "No search results for {search}" "no_results": "No search results for {search}"
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment