From 369fbaa84bdb86d91752c53824bb3b13c45b483f Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 19 Jul 2026 11:55:51 +0200 Subject: misc commit Included changes: * Cache the fetched students * Add level icons * Improve mass-graduation interface * Move utility functions from config.js to utils-ENV.js --- js/graduation-common.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'js/graduation-common.js') diff --git a/js/graduation-common.js b/js/graduation-common.js index 52c1bd4..0c28465 100644 --- a/js/graduation-common.js +++ b/js/graduation-common.js @@ -1,6 +1,18 @@ import { getSubmitDb, loadFromStudentDatabase, addEntryToStudentDatabase } from "./database.js" -const LEVEL_NAMES = ["Neuling", "Entdecker", "Pionieer"]; +import NeulingPng from "../assets/Neuling.png"; +import EntdeckerPng from "../assets/Entdecker.png"; +import NavigatorPng from "../assets/Navigator.png"; +import PioneerPng from "../assets/Pioneer.png"; + +const LEVEL_NAMES = ["Neuling", "Entdecker", "Navigator", "Pionieer"]; + +const LEVEL_IMAGES = [ + new URL(NeulingPng), + new URL(EntdeckerPng), + new URL(NavigatorPng), + new URL(PioneerPng), +]; class GraduationChange { constructor(date, change, reason, coach, context) { @@ -210,7 +222,7 @@ class Graduation { * Return the URI of the icon representing the graduation level. */ getIcon() { - return ""; + return LEVEL_IMAGES[this.level - 1]; } /** @@ -368,6 +380,7 @@ async function submitObservation(student, observation) { export { LEVEL_NAMES, + LEVEL_IMAGES, GraduationChange, Graduation, fetchGraduation, -- cgit v1.2.3