diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-06-13 13:23:57 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-06-13 13:23:57 +0200 |
| commit | 95e8b31e7438adf68d0af9993088700513929dbb (patch) | |
| tree | dab6abbe0f1171256be4c17eb23582e327cf8f65 | |
| parent | ef636993d0119d61b25d85cc843b786989c0dce3 (diff) | |
| download | bycs-sol-95e8b31e7438adf68d0af9993088700513929dbb.tar.gz bycs-sol-95e8b31e7438adf68d0af9993088700513929dbb.zip | |
cockpit: only show real groups
| -rw-r--r-- | cockpit/js/cockpit.js | 2 | ||||
| -rw-r--r-- | js/student-common.js | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/cockpit/js/cockpit.js b/cockpit/js/cockpit.js index 1f092b1..b773f5c 100644 --- a/cockpit/js/cockpit.js +++ b/cockpit/js/cockpit.js @@ -46,7 +46,7 @@ function initStudentSelection() { initSelection( "student-selection", fetchStudents, - (student) => `${student.name} ${student.group}`, + (student) => `${student.name} ${student.getRealGroups().join(", ")}`, loadStudent ); } diff --git a/js/student-common.js b/js/student-common.js index 930c373..a238965 100644 --- a/js/student-common.js +++ b/js/student-common.js @@ -16,6 +16,13 @@ class Student { getGroupName() { return `g${this.id}${this.name.replace(' ', '')}`; } + + getRealGroups() { + if(typeof this.groups === "string") { + return [this.groups]; + } + return this.groups.filter((g) => g !== this.getGroupName()); + } } async function fetchStudent(idFilter, nameFilter, groupFilter) { |
