From 33e068157bc492c2bbcb4a5fc77d3a985f23335c Mon Sep 17 00:00:00 2001
From: Michael Bauer <michael-bauer@posteo.de>
Date: Tue, 14 May 2024 13:36:11 +0200
Subject: [PATCH] Add StatisticsForPersonCard-component and its subcomponents

---
 .../statistics/StatisticsAbsencesCard.vue     | 10 +++++
 .../statistics/StatisticsExtraMarksCard.vue   | 10 +++++
 .../statistics/StatisticsForPersonCard.vue    | 44 +++++++++++++++++++
 .../StatisticsPersonalNotesList.vue           | 10 +++++
 .../statistics/StatisticsTardinessCard.vue    | 10 +++++
 .../apps/alsijil/frontend/messages/de.json    |  8 ++++
 .../apps/alsijil/frontend/messages/en.json    | 10 ++++-
 7 files changed, 101 insertions(+), 1 deletion(-)
 create mode 100644 aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsAbsencesCard.vue
 create mode 100644 aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsExtraMarksCard.vue
 create mode 100644 aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForPersonCard.vue
 create mode 100644 aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsPersonalNotesList.vue
 create mode 100644 aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsTardinessCard.vue

diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsAbsencesCard.vue b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsAbsencesCard.vue
new file mode 100644
index 000000000..dfebecdd1
--- /dev/null
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsAbsencesCard.vue
@@ -0,0 +1,10 @@
+<template>
+  <v-card>
+  </v-card>
+</template>
+
+<script>
+export default {
+  name: "StatisticsAbsencesCard",
+};
+</script>
diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsExtraMarksCard.vue b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsExtraMarksCard.vue
new file mode 100644
index 000000000..b05a16d23
--- /dev/null
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsExtraMarksCard.vue
@@ -0,0 +1,10 @@
+<template>
+  <v-card>
+  </v-card>
+</template>
+
+<script>
+export default {
+  name: "StatisticsExtraMarksCard",
+};
+</script>
diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForPersonCard.vue b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForPersonCard.vue
new file mode 100644
index 000000000..a444b6464
--- /dev/null
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForPersonCard.vue
@@ -0,0 +1,44 @@
+<template>
+  <v-card>
+    <v-card-title v-if="compact">
+      {{ $t("alsijil.coursebook.statistics.person_compact.title") }}
+      <v-spacer />
+      <!-- TODO: Maximize button -->
+    </v-card-title>
+    <v-card-title v-else>
+      {{ $t("alsijil.coursebook.statistics.person_page.title") }}
+    </v-card-title>
+    <statistics-absences-card />
+    <statistics-tardiness-card />
+    <statistics-extra-marks-card />
+    <statistics-personal-notes-list
+      v-if="compact"
+    />
+  </v-card>
+</template>
+
+<script>
+import personOverviewCardMixin from "aleksis.core/mixins/personOverviewCardMixin.js";
+import StatisticsAbsencesCard from "./StatisticsAbsencesCard.vue";
+import StatisticsTardinessCard from "./StatisticsTardinessCard.vue";
+import StatisticsExtraMarksCard from "./StatisticsExtraMarksCard.vue";
+import StatisticsPersonalNotesList from "./StatisticsPersonalNotesList.vue";
+
+export default {
+  name: "StatisticsForPersonCard",
+  mixins: [personOverviewCardMixin],
+  components: {
+    StatisticsAbsencesCard,
+    StatisticsTardinessCard,
+    StatisticsExtraMarksCard,
+    StatisticsPersonalNotesList,
+  },
+  props: {
+    compact: {
+      type: Boolean,
+      required: false,
+      default: true,
+    },
+  },
+};
+</script>
diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsPersonalNotesList.vue b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsPersonalNotesList.vue
new file mode 100644
index 000000000..9335807fc
--- /dev/null
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsPersonalNotesList.vue
@@ -0,0 +1,10 @@
+<template>
+  <v-card>
+  </v-card>
+</template>
+
+<script>
+export default {
+  name: "StatisticsPersonalNotesList",
+};
+</script>
diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsTardinessCard.vue b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsTardinessCard.vue
new file mode 100644
index 000000000..21556d527
--- /dev/null
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsTardinessCard.vue
@@ -0,0 +1,10 @@
+<template>
+  <v-card>
+  </v-card>
+</template>
+
+<script>
+export default {
+  name: "StatisticsTardinessCard",
+};
+</script>
diff --git a/aleksis/apps/alsijil/frontend/messages/de.json b/aleksis/apps/alsijil/frontend/messages/de.json
index b19369775..2245b89ae 100644
--- a/aleksis/apps/alsijil/frontend/messages/de.json
+++ b/aleksis/apps/alsijil/frontend/messages/de.json
@@ -49,6 +49,14 @@
           }
         }
       },
+      "statistics": {
+        "person_compact": {
+          "title": "Kursbuch · Statistiken"
+        },
+        "person_page": {
+          "title": "Statistiken"
+        }
+      },
       "title_plural": "Kursbuch"
     },
     "excuse_types": {
diff --git a/aleksis/apps/alsijil/frontend/messages/en.json b/aleksis/apps/alsijil/frontend/messages/en.json
index acadfea9a..4f9570acc 100644
--- a/aleksis/apps/alsijil/frontend/messages/en.json
+++ b/aleksis/apps/alsijil/frontend/messages/en.json
@@ -75,7 +75,15 @@
         "filter_for_obj": "Filter for group and course"
       },
       "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}",
+      "statistics": {
+        "person_compact": {
+          "title": "Coursebook · Statistics"
+        },
+        "person_page": {
+          "title": "Statistics"
+        }
+      }
     }
   }
 }
-- 
GitLab