From 516cb13dcf0f24b966b333dda4906ec95aa9d9444c2c3d23850437900ecd95be Mon Sep 17 00:00:00 2001 From: jhkaktus Date: Sun, 11 Oct 2026 01:04:46 +0200 Subject: [PATCH] feat: Anlass + Endgrund fields for records MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds two optional free-text fields to describe why a transaction started ("Anlass") and why it ended ("Endgrund") - chosen names instead of the technical "Startursache"/"Endesuhrsache". Displayed as own table columns and editable in the form; legacy records without those fields render as "-". Payload is encrypted client-side like every other field (no server change needed, opaque ciphertext). Verified: node --check, crypto roundtrip incl. new fields, legacy-safe access (?? ''), pytest 3/3. 🤖 Generated with Codebuff Co-Authored-By: Codebuff --- backend/static/index.html | 10 ++++++++++ backend/static/ui.js | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/backend/static/index.html b/backend/static/index.html index 3a955b8..3326873 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -74,6 +74,8 @@ Person B Start Ende + Anlass + Endgrund Aktion @@ -100,6 +102,14 @@ + + diff --git a/backend/static/ui.js b/backend/static/ui.js index 7f68a8d..850b304 100644 --- a/backend/static/ui.js +++ b/backend/static/ui.js @@ -104,6 +104,8 @@ function renderRow(record, payload) { payload.personB, showTs(payload.tsStart), showTs(payload.tsEnd), + showTs(payload.startCause), + showTs(payload.endCause), payload.action, ]; for (const text of cells) { @@ -145,7 +147,7 @@ async function reload() { failures++; tbody.appendChild( el("tr", { class: "row-error" }, [ - el("td", { colspan: "6", text: "Datensatz nicht entschlüsselbar (falsche Passphrase oder manipuliert)." }), + el("td", { colspan: "8", text: "Datensatz nicht entschlüsselbar (falsche Passphrase oder manipuliert)." }), ]) ); } @@ -164,6 +166,8 @@ function openEditor(record, payload) { $("#f-personb").value = payload.personB ?? ""; $("#f-tsstart").value = payload.tsStart ?? ""; $("#f-tsend").value = payload.tsEnd ?? ""; + $("#f-startcause").value = payload.startCause ?? ""; + $("#f-endcause").value = payload.endCause ?? ""; $("#f-action").value = payload.action ?? ""; $("#editor-backdrop").hidden = false; } @@ -201,6 +205,8 @@ async function saveRecord(ev) { personB: $("#f-personb").value.trim(), tsStart: tsOrNull($("#f-tsstart").value), tsEnd: tsOrNull($("#f-tsend").value), + startCause: tsOrNull($("#f-startcause").value), + endCause: tsOrNull($("#f-endcause").value), action: $("#f-action").value.trim(), }; if (!payload.personA || !payload.personB || !payload.action) {