diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-09-03 20:58:48 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-09-03 20:58:48 +0200 |
| commit | fd40558a7eadfc016197fec782d9a3b2a3f84825 (patch) | |
| tree | 0dfba044af7411ed619ccd5b98e2139e0e52b594 /src/cockpit.js | |
| parent | d24e29dbff5a3daeb8df5685913406fde8a3fb69 (diff) | |
| download | bycs-sol-fd40558a7eadfc016197fec782d9a3b2a3f84825.tar.gz bycs-sol-fd40558a7eadfc016197fec782d9a3b2a3f84825.zip | |
admin-tools: remove obsolete button and add coach assignment import
Diffstat (limited to 'src/cockpit.js')
| -rw-r--r-- | src/cockpit.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cockpit.js b/src/cockpit.js index f9a44f9..6830fbb 100644 --- a/src/cockpit.js +++ b/src/cockpit.js @@ -71,7 +71,7 @@ function pointClickHandler(color) { default: throw new Error("Invalid color"); } - submitGraduationChange(student.graduation, change); + submitGraduationChange(change, student.graduation); textareaDiv.style.display = "none"; updateStudentInfo(); fetchGraduation(student).then(() => updateStudentGraduation()); @@ -133,7 +133,7 @@ function updateStudentInfo() { const icon = document.getElementById("student-level-icon"); icon.src = student.graduation.getIcon(); - document.getElementById("student-info-coach").innerHTML = student.graduation.coach; + document.getElementById("student-info-coach").innerHTML = student.graduation.coaches[0] ?? ""; } document.getElementById("student-content").style.display = "block"; @@ -144,7 +144,7 @@ async function updateStudentGraduation() { const graduation = student.graduation; // Only the coach is allowed to graduate - if (name === student.graduation.coach) { + if (student.graduation.coaches.includes(name)) { document.getElementById("graduation-level-change").style.display = "block"; const levelChangeLvl = document.getElementById("graduation-level-change-level"); levelChangeLvl.value = Math.min(graduation.level + 1, 4); @@ -152,7 +152,7 @@ async function updateStudentGraduation() { const levelChangeBtn = document.getElementById("graduation-level-change-submit"); levelChangeBtn.onclick = () => { const change = GraduationChange.newLevelChange(Number(levelChangeLvl.value), "", name); - submitGraduationChange(student.graduation, change); + submitGraduationChange(change, student.graduation); updateStudentInfo(); updateStudentGraduation(); }; |
