From f17f1ca7ada63eb28436acf8462cec5eda0e4214 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 12 Jul 2026 13:59:17 +0200 Subject: add simple red point notice print layout --- mass-graducation/src/main.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mass-graducation/src/main.js b/mass-graducation/src/main.js index 8d009b0..4224942 100644 --- a/mass-graducation/src/main.js +++ b/mass-graducation/src/main.js @@ -278,8 +278,28 @@ function submitMassGraduation() { }); } +let prePrintBody = null; function printRedPointNote(li) { + // save the current DOM + prePrintBody = document.body; + + // prepare the printable red point notice + const printBdy = document.createElement("body"); + const reason = li.querySelector(".group-member-point-reason").value; + const dateStr = datetimeStringNow(); + + printBdy.innerHTML = ` +

Roter Punkt Dokumentation

+

Schüler*in: ${li.student.name}

+

Datum: ${dateStr}

+

Begründung

+

${reason}

+

Lehrkraft: ${name}

`; + + document.body = printBdy; print(); + // Restore the DOM after printing the red point note + document.body = prePrintBody; } async function init() { -- cgit v1.2.3