diff --git a/src/main/resources/static/js/bughunter.js b/src/main/resources/static/js/bughunter.js index 709f9c3..7267ca3 100644 --- a/src/main/resources/static/js/bughunter.js +++ b/src/main/resources/static/js/bughunter.js @@ -12,7 +12,12 @@ function renderCatalog() { if (!catalog.length) { error(new Error('Zurzeit sind keine Fallakten verfügbar.')); return; } selectedCase = Math.max(0, Math.min(selectedCase, catalog.length - 1)); - const selectedHunt = catalog[selectedCase], difficultyNames = {junior:'JUNIOR · GRUNDLAGEN', senior:'SENIOR · PRAXIS', principal:'PRINCIPAL · KOMPLEXFÄLLE'}, drawers = ['junior','senior','principal'].map(level => { const cases = catalog.map((hunt, i) => ({hunt, i})).filter(entry => entry.hunt.difficulty === level); if (!cases.length) return ''; return `
${difficultyNames[level]}
${cases.map(({hunt, i}) => ``).join('')}`).join(''); + const selectedHunt = catalog[selectedCase], difficultyNames = {junior:'JUNIOR · GRUNDLAGEN', senior:'SENIOR · PRAXIS', principal:'PRINCIPAL · KOMPLEXFÄLLE'}; + const drawers = ['junior','senior','principal'].map(level => { + const cases = catalog.map((hunt, i) => ({hunt, i})).filter(entry => entry.hunt.difficulty === level); + if (!cases.length) return ''; + return `
${difficultyNames[level]}
${cases.map(({hunt, i}) => ``).join('')}`; + }).join(''); view.innerHTML = `
VERTRAULICHDEBUG-FALLAKTEN

Welche Spur verfolgst du?

Öffne eine Akte, lies die Beweise und sichere deinen Befund Schritt für Schritt. Jede Akte bleibt so lange offen, wie du sie brauchst.

AKTENSCHRANK · ${catalog.length} AKTEN

Fallarchiv

Nach Schwierigkeit sortiert: Grundlagen, Praxis, Komplexfälle.

BUGHUNTER · ARCHIV
${drawers}
AUSGEWÄHLTE AKTE${esc(selectedHunt.examScope)} · ${esc(selectedHunt.difficulty).toUpperCase()} · ${esc(selectedHunt.language)}

${esc(selectedHunt.title)}

${esc(selectedHunt.description)}

${selectedHunt.fileCount} ${selectedHunt.fileCount === 1 ? 'Datei' : 'Dateien'}${selectedHunt.bugCount} Bug${selectedHunt.bugCount === 1 ? '' : 's'}
`; view.querySelectorAll('[data-select]').forEach(drawer => drawer.addEventListener('click', () => { selectedCase = Number(drawer.dataset.select); renderCatalog(); })); view.querySelector('[data-start]')?.addEventListener('click', event => begin(event.currentTarget.dataset.start)); diff --git a/src/main/resources/templates/bughunter.html b/src/main/resources/templates/bughunter.html index be34762..4444a84 100644 --- a/src/main/resources/templates/bughunter.html +++ b/src/main/resources/templates/bughunter.html @@ -1 +1 @@ -BugHunter · Mindflux
← Dashboard
BUGHUNTERDEBUG-FALLAKTEN
FALLAKTEN WERDEN GEÖFFNET …
+BugHunter · Mindflux
← Dashboard
BUGHUNTERDEBUG-FALLAKTEN
FALLAKTEN WERDEN GEÖFFNET …