diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-07-19 11:55:51 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-07-19 12:07:12 +0200 |
| commit | 369fbaa84bdb86d91752c53824bb3b13c45b483f (patch) | |
| tree | 5c1dca9eb4581a1de8c0862ba776528a4bedcf41 /js/graduation-common.js | |
| parent | dd52c913c454b9a6cf9ab7e7b102f9e7ede31754 (diff) | |
| download | bycs-sol-369fbaa84bdb86d91752c53824bb3b13c45b483f.tar.gz bycs-sol-369fbaa84bdb86d91752c53824bb3b13c45b483f.zip | |
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
Diffstat (limited to 'js/graduation-common.js')
| -rw-r--r-- | js/graduation-common.js | 17 |
1 files changed, 15 insertions, 2 deletions
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, |
