From 478a2895b519e511e443919594d2383bdd9c1820 Mon Sep 17 00:00:00 2001 From: Dogfather Date: Tue, 15 Sep 2026 12:58:26 +0200 Subject: [PATCH] Dateifassungen: die alte Fassung sieht man ihr an Stufe 9 aus dem Plan: "Dateiversionen statt Ueberschreiben". GEMESSEN, BEVOR ETWAS GEBAUT WURDE -- DER PLAN LAG DANEBEN Ueberschrieben wurde nie: `name_datei` ist eindeutig und zufaellig, jedes Hochladen legt eine neue Zeile an. Der wirkliche Mangel ist ein anderer, und er ist gefaehrlicher als Ueberschreiben: Zwei Dateien gleichen Namens standen BEZIEHUNGSLOS nebeneinander. Die alte kann "freigegeben" sein, die neue "entwurf" -- und wer die Liste ansieht, laedt die freigegebene herunter. Also die falsche. Kein Fehler, keine Meldung, nur die alte Fassung in der Hand. WAS JETZT PASSIERT Beim Hochladen erkennt der Server die Vorgaengerin selbst: gleicher Originalname, gleicher Creator-Bezug, und sie darf nicht schon ersetzt sein. An der Datei steht danach "Fassung 2"; an der alten steht "nicht mehr aktuell". AUTOMATISCH, NICHT GEFRAGT -- eine Abwaegung: Wer die Verknuepfung vergisst, hat zwei Dateien ohne Zusammenhang, und irgendwann laedt jemand die alte herunter. Wer sie faelschlich bekommt, SIEHT das sofort und loest sie mit einem Klick. Der stille Schaden ist groesser als der sichtbare. BEI ZWEIFEL WIRD NICHT GERATEN. Gibt es zwei unersetzte Dateien gleichen Namens, bleibt die neue eigenstaendig. LOESEN GEHT NUR AN DER AKTUELLEN FASSUNG. Wer eine ueberholte loest, macht daraus eine zweite aktuelle -- und hat das Problem zurueck. DIE NUMMER IST GERECHNET, NICHT GESPEICHERT. Eine Spalte "version" muesste beim Loeschen einer mittleren Fassung nachgezogen werden, und genau das vergisst man. Faellt die erste weg, zaehlt die zweite wieder als erste -- richtig, denn mehr weiss das System dann nicht. EIN RING IN DEN DATEN HAELT DIE SEITE NICHT AN. Kann ueber die Wege hier nicht entstehen, aber ein Fehler anderswo koennte ihn erzeugen, und ein Stillstand ist schlimmer als ein Fehler. Gemessen: 1 ms. ZWEI SITZUNGEN IM SELBEN VERZEICHNIS Der vorige Commit (d2210fd, aus einer anderen Sitzung) hat mit `git add -A` meine damals noch unfertige Spalte `dateien.ersetzt_id` mitgenommen -- sie steht dort unter einer Ueberschrift, die nichts damit zu tun hat. Niemand hat etwas falsch gemacht; die Sitzungen konnten voneinander nicht wissen. Aufgefallen ist es, weil der Versionsstempel ploetzlich 347 statt 372 Verweise meldete und ich dem Rueckgang nachgegangen bin. PRUEFUNGEN: pruef-fassungen neu mit 37, davon 6 im Browser. Co-Authored-By: Claude Opus 5 --- server/pruef-fassungen.mjs | 338 +++++++++++++++++++++++++++++++ server/workspace-dateien.js | 34 ++++ workspace/app.webmanifest | 8 +- workspace/assets/css/dateien.css | 28 +++ workspace/assets/js/dateien.js | 40 ++++ workspace/aufgaben.html | 24 +-- workspace/automation.html | 26 +-- workspace/bereich.html | 34 ++-- workspace/calls.html | 28 +-- workspace/chat.html | 26 +-- workspace/content.html | 30 +-- workspace/crew-index.html | 10 +- workspace/crew.webmanifest | 8 +- workspace/dateien.html | 26 +-- workspace/entwicklung.html | 24 +-- workspace/index.html | 8 +- workspace/kalender.html | 28 +-- workspace/leistung.html | 26 +-- workspace/personen.html | 26 +-- workspace/profil.html | 28 +-- workspace/rechte.html | 24 +-- workspace/report.html | 28 +-- workspace/scouting.html | 26 +-- workspace/start.html | 24 +-- workspace/startcheck.html | 28 +-- workspace/steckbrief.html | 28 +-- workspace/talente.html | 24 +-- workspace/team.html | 26 +-- workspace/teamlage.html | 24 +-- workspace/treff-moderation.html | 24 +-- workspace/treff-regeln.html | 26 +-- workspace/uebersicht.html | 26 +-- workspace/wissen.html | 26 +-- 33 files changed, 787 insertions(+), 347 deletions(-) create mode 100644 server/pruef-fassungen.mjs diff --git a/server/pruef-fassungen.mjs b/server/pruef-fassungen.mjs new file mode 100644 index 00000000..a201c6d6 --- /dev/null +++ b/server/pruef-fassungen.mjs @@ -0,0 +1,338 @@ +/* ===================================================================== + Dateifassungen (15.09.2026) + + Stufe 9: „Dateiversionen statt Überschreiben". + + --------------------------------------------------------------------- + GEMESSEN, BEVOR ETWAS GEBAUT WURDE + + Der Plan sagt „statt Überschreiben" — überschrieben wurde aber nie: + `name_datei` ist eindeutig und zufällig, jedes Hochladen legt eine + neue Zeile an. Der wirkliche Mangel ist ein anderer, und er ist + gefährlicher: + + Zwei Dateien gleichen Namens standen BEZIEHUNGSLOS nebeneinander. + Die alte kann „freigegeben" sein, die neue „entwurf" — und wer die + Liste ansieht, lädt die freigegebene herunter. Also die falsche. + Kein Fehler, keine Meldung, nur die alte Fassung in der Hand. + + --------------------------------------------------------------------- + DIE DREI FRAGEN + + 1. Wird die richtige Vorgängerin erkannt? + 2. Wird bei Zweifel NICHT geraten? ← die wichtigere Hälfte + 3. Sieht man der alten Fassung an, dass sie alt ist? + + Die zweite ist der Grund, warum die Bedingung eng ist: Eine + Automatik, die falsch verknüpft, erfindet einen Zusammenhang zwischen + zwei Dateien, die nichts miteinander zu tun haben. + + Aufrufen mit: node server/pruef-fassungen.mjs + ===================================================================== */ + +import { mkdtempSync, rmSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { request as httpAnfrage } from "node:http"; +import { portMussFreiSein } from "./helfer-port.mjs"; + +const PORT = await portMussFreiSein(4415, "pruef-fassungen"); + +const ordner = mkdtempSync(join(tmpdir(), "ws-fass-")); +process.env.WORKSPACE_DB = join(ordner, "workspace.db"); +process.env.PORT = String(PORT); +process.env.SITE_ACCESS_SECRET = "lokaler-test"; +process.env.SITE_PUBLIC_LAUNCH_AT = "2020-01-01T00:00:00+01:00"; + +const express = (await import("express")).default; +const ec = express.response.cookie; +express.response.cookie = function (n, w, o) { return ec.call(this, n, w, { ...(o || {}), secure: false }); }; +import { notbremse } from "./helfer-notbremse.mjs"; +await import("./index.js"); +notbremse(180_000, "pruef-fassungen"); +await new Promise((r) => setTimeout(r, 700)); + +process.on("uncaughtException", (f) => { console.error("ABSTURZ:", f); process.exit(7); }); +process.on("unhandledRejection", (f) => { console.error("ABSTURZ (Versprechen):", f); process.exit(7); }); + +let fehler = 0, geprueft = 0; +const melde = (t) => console.log(t); +const ok = (b, t) => { geprueft++; console.log((b ? " ok " : " FEHL ") + t); if (!b) fehler++; }; + +const HAUS = "workspace.dogfather-universe.com"; + +const { DatabaseSync } = await import("node:sqlite"); +const { scryptSync, randomBytes, createHmac } = await import("node:crypto"); + +const oeffne = () => new DatabaseSync(process.env.WORKSPACE_DB); +const jetzt = new Date().toISOString(); + +let idDogi, idLuna, idMax; +{ + const d = oeffne(); + const schluessel = randomBytes(32).toString("hex"); + d.prepare("INSERT INTO einstellungen (schluessel, wert, geaendert, von)" + + " VALUES (?,?,?,NULL) ON CONFLICT(schluessel) DO NOTHING") + .run("code_kennung_schluessel", schluessel, jetzt); + const anlegen = (name, rolle, code) => { + const salt = randomBytes(16).toString("hex"); + const hash = scryptSync(code, salt, 64, { N: 32768, r: 8, p: 1, maxmem: 96 * 1024 * 1024 }).toString("hex"); + d.prepare("INSERT INTO personen (name, rolle, code_hash, code_salt, code_n, code_kennung, aktiv, erstellt)" + + " VALUES (?,?,?,?,?,?,1,?)") + .run(name, rolle, hash, salt, 32768, createHmac("sha256", schluessel).update(code).digest("hex"), jetzt); + return d.prepare("SELECT last_insert_rowid() AS id").get().id; + }; + idDogi = anlegen("Filipe", "admin", "CODE-DOGI-0001"); + idLuna = anlegen("Luna", "creator", "CODE-CREA-0001"); + idMax = anlegen("Max", "creator", "CODE-CREA-0002"); + d.close(); +} + +function ruf(pfad, methode, kopf = {}, koerper = null) { + return new Promise((fertig, schief) => { + const a = httpAnfrage({ host: "127.0.0.1", port: PORT, path: pfad, method: methode, + headers: { Host: HAUS, ...kopf } }, (antwort) => { + let text = ""; + antwort.on("data", (s) => { text += s; }); + antwort.on("end", () => fertig({ code: antwort.statusCode, text, kopf: antwort.headers })); + }); + a.on("error", schief); + if (koerper) a.write(koerper); + a.end(); + }); +} +const json = (a) => { try { return JSON.parse(a.text); } catch { return {}; } }; + +const anm = await ruf("/workspace/api/anmelden", "POST", + { "Content-Type": "application/json" }, + JSON.stringify({ rolle: "admin", code: "CODE-DOGI-0001" })); +const kDogi = [].concat(anm.kopf?.["set-cookie"] || []).map((c) => c.split(";")[0]).join("; "); +ok(!!kDogi, "DogFather ist angemeldet"); + +/** Laedt eine Datei hoch und gibt die Antwort zurueck. */ +async function hochladen(name, inhalt, creatorId) { + return ruf("/workspace/api/dateien", "POST", { + cookie: kDogi, + "content-type": "text/plain", + "x-dateiname": encodeURIComponent(name), + ...(creatorId ? { "x-creator": String(creatorId) } : {}), + "content-length": Buffer.byteLength(inhalt), + }, inhalt); +} +const liste = async () => json(await ruf("/workspace/api/dateien", "GET", { cookie: kDogi })).dateien || []; + +/* Erst nachsehen, wie der Weg die Angaben erwartet -- eine Pruefung, + die am Hochladen scheitert, prueft nichts. */ +{ + const probe = await hochladen("probe.txt", "eins", idLuna); + ok(probe.code === 201, `eine Datei laesst sich hochladen (${probe.code}) ${probe.code === 201 ? "" : probe.text.slice(0, 120)}`); +} + +/* ======================================================================= + 1. DIE ZWEITE FASSUNG WIRD ERKANNT + ======================================================================= */ +melde(""); +melde("=== 1. Die zweite Fassung ==="); +{ + const eins = await hochladen("vertrag.pdf", "Fassung eins", idLuna); + ok(eins.code === 201, `erste Fassung hochgeladen (${eins.code})`); + ok(json(eins).ersetzt_id === null, "sie ersetzt nichts — es gab noch nichts"); + + const zwei = await hochladen("vertrag.pdf", "Fassung zwei", idLuna); + ok(zwei.code === 201, `zweite Fassung hochgeladen (${zwei.code})`); + ok(json(zwei).ersetzt_id === json(eins).id, + `und sie zeigt auf die erste (${json(zwei).ersetzt_id} → ${json(eins).id})`); + + const drei = await hochladen("vertrag.pdf", "Fassung drei", idLuna); + ok(json(drei).ersetzt_id === json(zwei).id, + "die dritte auf die zweite — eine Kette, kein Stern"); + + const alle = await liste(); + const d3 = alle.find((x) => x.id === json(drei).id); + const d2 = alle.find((x) => x.id === json(zwei).id); + const d1 = alle.find((x) => x.id === json(eins).id); + ok(d3?.fassung === 3, `die neueste ist Fassung ${d3?.fassung}`); + ok(d2?.fassung === 2 && d1?.fassung === 1, + `die beiden davor sind ${d2?.fassung} und ${d1?.fassung}`); + ok(d1?.ersetzt_durch === d2?.id && d2?.ersetzt_durch === d3?.id, + "jede weiss, wer sie ersetzt hat"); + /* DAS IST DER GRUND FUER DAS GANZE: Der alten sieht man an, dass sie + alt ist. */ + ok(d3?.ersetzt_durch === null, "und die neueste wird von niemandem ersetzt"); +} + +/* ======================================================================= + 2. BEI ZWEIFEL WIRD NICHT GERATEN + + Die wichtigere Haelfte. Eine Automatik, die falsch verknuepft, + erfindet einen Zusammenhang zwischen zwei Dateien, die nichts + miteinander zu tun haben. + ======================================================================= */ +melde(""); +melde("=== 2. Nicht geraten ==="); +{ + /* Anderer Creator, gleicher Name -- das ist NICHT dieselbe Datei. */ + const fremd = await hochladen("vertrag.pdf", "Vertrag von Max", idMax); + ok(fremd.code === 201, `dieselbe Benennung bei einem anderen Creator (${fremd.code})`); + ok(json(fremd).ersetzt_id === null, + `wird nicht verknuepft (${json(fremd).ersetzt_id}) — es ist Max' Vertrag, nicht Lunas`); + + /* Anderer Name, gleicher Creator -- auch nicht. */ + const anders = await hochladen("konzept.pdf", "Etwas anderes", idLuna); + ok(json(anders).ersetzt_id === null, "und ein anderer Name erst recht nicht"); + + /* MEHRDEUTIG: Gibt es zwei unersetzte Dateien gleichen Namens, wird + GAR NICHT verknuepft. Hergestellt wird der Fall ueber den Weg, den + es dafuer gibt -- die Verknuepfung loesen. */ + const a = await hochladen("doppelt.txt", "A", idLuna); + const b = await hochladen("doppelt.txt", "B", idLuna); + ok(json(b).ersetzt_id === json(a).id, "zwei gleiche Namen ergeben zunaechst eine Kette"); + const geloest = await ruf(`/workspace/api/dateien/${json(b).id}/fassung`, "DELETE", { cookie: kDogi }); + ok(geloest.code === 200, `die Verknuepfung laesst sich loesen (${geloest.code})`); + + const c = await hochladen("doppelt.txt", "C", idLuna); + ok(json(c).ersetzt_id === null, + `jetzt gibt es zwei Unersetzte gleichen Namens — und es wird NICHT geraten (${json(c).ersetzt_id})`); +} + +/* ======================================================================= + 3. DIE VERKNUEPFUNG LOESEN -- UND NUR SIE + ======================================================================= */ +melde(""); +melde("=== 3. Loesen ==="); +{ + const eins = await hochladen("loesen.txt", "eins", idLuna); + const zwei = await hochladen("loesen.txt", "zwei", idLuna); + ok(json(zwei).ersetzt_id === json(eins).id, "verknuepft"); + + const vorher = (await liste()).length; + const a = await ruf(`/workspace/api/dateien/${json(zwei).id}/fassung`, "DELETE", { cookie: kDogi }); + ok(a.code === 200, `geloest (${a.code})`); + + const nachher = await liste(); + ok(nachher.length === vorher, `KEINE Datei ist dabei verschwunden (${vorher} → ${nachher.length})`); + const d2 = nachher.find((x) => x.id === json(zwei).id); + const d1 = nachher.find((x) => x.id === json(eins).id); + ok(d2?.fassung === 1 && d2?.ersetzt_id === null, "die zweite steht wieder fuer sich"); + ok(d1?.ersetzt_durch === null, "und die erste gilt nicht mehr als ueberholt"); + + /* Ein zweites Loesen ist kein Fehler des Nutzers, aber auch kein + Erfolg -- es gibt nichts mehr zu loesen. */ + const nochmal = await ruf(`/workspace/api/dateien/${json(zwei).id}/fassung`, "DELETE", { cookie: kDogi }); + ok(nochmal.code === 409, `ein zweites Loesen sagt "da war nichts" (${nochmal.code})`); + + const erfunden = await ruf("/workspace/api/dateien/999999/fassung", "DELETE", { cookie: kDogi }); + ok(erfunden.code === 404, `eine erfundene Nummer ergibt 404 (${erfunden.code})`); + + const ohne = await ruf(`/workspace/api/dateien/${json(eins).id}/fassung`, "DELETE"); + ok(ohne.code === 401 || ohne.code === 404, + `ohne Anmeldung geht es nicht (${ohne.code})`); +} + +/* ======================================================================= + 4. WIRD DIE ALTE FASSUNG GELOESCHT, BLEIBT DIE NEUE + ======================================================================= */ +melde(""); +melde("=== 4. Wenn die alte verschwindet ==="); +{ + const eins = await hochladen("weg.txt", "eins", idLuna); + const zwei = await hochladen("weg.txt", "zwei", idLuna); + ok(json(zwei).ersetzt_id === json(eins).id, "verknuepft"); + + const d = oeffne(); + d.prepare("PRAGMA foreign_keys = ON").run(); + d.prepare("DELETE FROM dateien WHERE id = ?").run(json(eins).id); + const uebrig = d.prepare("SELECT id, ersetzt_id FROM dateien WHERE id = ?").get(json(zwei).id); + d.close(); + + ok(!!uebrig, "die neue Fassung gibt es noch, obwohl die alte weg ist"); + ok(uebrig.ersetzt_id === null, + `und der Verweis steht auf null statt ins Leere (${uebrig.ersetzt_id})`); + + const nach = (await liste()).find((x) => x.id === json(zwei).id); + ok(nach?.fassung === 1, + `sie zaehlt jetzt wieder als erste Fassung (${nach?.fassung}) — die Nummer ist gerechnet, nicht gespeichert`); +} + +/* ======================================================================= + 5. EIN RING WUERDE DIE SEITE NICHT EINFRIEREN + + Kann durch die Wege oben nicht entstehen -- aber ein Fehler anderswo + koennte ihn erzeugen, und ein Stillstand ist schlimmer als ein + Fehler. Deshalb eine Schranke in der Zaehlung, und deshalb hier der + Beweis, dass sie greift. + ======================================================================= */ +melde(""); +melde("=== 5. Ein Ring haelt die Seite nicht an ==="); +{ + const a = await hochladen("ring.txt", "a", idLuna); + const b = await hochladen("ring.txt", "b", idLuna); + const d = oeffne(); + d.prepare("UPDATE dateien SET ersetzt_id = ? WHERE id = ?").run(json(b).id, json(a).id); + d.close(); + + const beginn = Date.now(); + const alle = await liste(); + const dauer = Date.now() - beginn; + ok(alle.length > 0, `die Liste kommt trotzdem (${alle.length} Dateien)`); + ok(dauer < 5000, `und zwar in ${dauer} ms statt nie`); + + /* Aufraeumen, damit die naechste Zeile nicht an diesem Ring haengt. */ + const dd = oeffne(); + dd.prepare("UPDATE dateien SET ersetzt_id = NULL WHERE id = ?").run(json(a).id); + dd.close(); +} + +/* ======================================================================= + 6. IM BROWSER + ======================================================================= */ +melde(""); +melde("=== 6. Im Browser ==="); +{ + const { chromium } = await import( + "file:///C:/Users/qciga/Documents/Obelix/Analyse/node_modules/playwright/index.mjs"); + const browser = await chromium.launch(); + const kontext = await browser.newContext({ viewport: { width: 1280, height: 900 } }); + const seite = await kontext.newPage(); + const konsole = []; + seite.on("console", (m) => { if (m.type() === "error" && !/favicon|ERR_/i.test(m.text())) konsole.push(m.text()); }); + seite.on("pageerror", (e) => konsole.push("Absturz: " + e.message)); + + await seite.goto(`http://127.0.0.1:${PORT}/workspace/`, { waitUntil: "domcontentloaded" }); + await seite.click('.rolle[data-rolle="admin"]'); + await seite.fill("#code", "CODE-DOGI-0001"); + await seite.click("button[type=submit]"); + await seite.waitForURL("**/start.html", { timeout: 20000 }); + await seite.goto(`http://127.0.0.1:${PORT}/workspace/dateien.html`, { waitUntil: "networkidle" }); + await seite.waitForTimeout(900); + + const stand = await seite.evaluate(() => ({ + nummern: document.querySelectorAll(".fassung__nummer").length, + alt: document.querySelectorAll(".fassung__alt").length, + loesen: document.querySelectorAll(".fassung__loesen").length, + text: [...document.querySelectorAll(".fassung")].map((f) => f.innerText.replace(/\s+/g, " ").trim()).slice(0, 4), + })); + ok(stand.nummern >= 2, `${stand.nummern} Dateien tragen eine Fassungsnummer`); + ok(stand.alt >= 1, `${stand.alt} sind als „nicht mehr aktuell“ gekennzeichnet`); + ok(stand.loesen >= 1, `${stand.loesen} lassen sich wieder lösen`); + ok(stand.text.some((t) => /Fassung \d/.test(t)), + `die Beschriftung steht da: ${stand.text.join(" | ").slice(0, 110)}`); + + /* GEGENPROBE: Der Loese-Knopf steht NUR an aktuellen Fassungen. Wer + eine ueberholte loest, macht daraus eine zweite aktuelle. */ + const falsch = await seite.evaluate(() => + [...document.querySelectorAll(".fassung")] + .filter((f) => f.querySelector(".fassung__alt") && f.querySelector(".fassung__loesen")).length); + ok(falsch === 0, `kein Löse-Knopf an einer überholten Fassung (${falsch})`); + + ok(konsole.length === 0, + konsole.length ? "Fehler im Browser: " + konsole[0].slice(0, 90) : "keine Fehler im Browser"); + await browser.close(); +} + +/* ------------------------------------------------------------------- */ +melde(""); +melde(`${geprueft} Pruefungen, ${fehler} Fehler`); +melde(fehler ? "NICHT IN ORDNUNG" : "ALLES IN ORDNUNG"); +try { rmSync(ordner, { recursive: true, force: true }); } catch { /* Aufraeumrest */ } +process.exit(fehler ? 1 : 0); diff --git a/server/workspace-dateien.js b/server/workspace-dateien.js index 94a7be86..3d07443a 100644 --- a/server/workspace-dateien.js +++ b/server/workspace-dateien.js @@ -259,6 +259,40 @@ function fassungenSetzen(liste) { } } +/* ===================================================================== + DIE VERKNUEPFUNG WIEDER LOESEN (15.09.2026) + + Der Server verknuepft von selbst, wenn Name und Creator gleich sind. + Meistens stimmt das; manchmal nicht -- zwei verschiedene Dateien + koennen denselben Namen tragen. + + EINE AUTOMATIK OHNE AUSWEG IST EINE BEHAUPTUNG. Deshalb dieser Weg: + ein Klick, und die Datei steht wieder fuer sich. NUR die Verknuepfung + geht, nie eine Datei -- der Weg kann also nichts anrichten, was sich + nicht in einem zweiten Klick zuruecknehmen liesse. + ===================================================================== */ +dateienRouter.delete("/workspace/api/dateien/:id(\\d+)/fassung", (req, res) => { + try { + const id = Number(req.params.id); + const { wo, werte } = sichtbar(req.sicht || req.person); + const d = db().prepare( + `SELECT d.id, d.name_original, d.ersetzt_id ${VERBUND} WHERE ${wo} AND d.id = ?`) + .get(...werte, id); + if (!d) return res.status(404).json({ fehler: "nicht_gefunden" }); + if (!d.ersetzt_id) return res.status(409).json({ fehler: "keine_fassung" }); + + db().prepare("UPDATE dateien SET ersetzt_id = NULL WHERE id = ?").run(id); + protokolliere("datei_fassung_geloest", { + personId: req.person.id, rolle: req.person.rolle, ip: echteIp(req), + detail: `#${id} ${d.name_original} war Fassung von #${d.ersetzt_id}`.slice(0, 120), + }); + res.json({ ok: true }); + } catch (fehler) { + console.error("[dateien] Fassung loesen:", fehler?.message); + res.status(503).json({ fehler: "nicht_verfuegbar" }); + } +}); + /* ---------- Liste ------------------------------------------------------- */ dateienRouter.get("/workspace/api/dateien", (req, res) => { diff --git a/workspace/app.webmanifest b/workspace/app.webmanifest index 9d97e4b3..90c317de 100644 --- a/workspace/app.webmanifest +++ b/workspace/app.webmanifest @@ -13,25 +13,25 @@ "theme_color": "#06090f", "icons": [ { - "src": "/assets/img/app-symbole/workspace-192.png?v=202609151252", + "src": "/assets/img/app-symbole/workspace-192.png?v=202609151258", "sizes": "192x192", "type": "image/png", "purpose": "any" }, { - "src": "/assets/img/app-symbole/workspace-512.png?v=202609151252", + "src": "/assets/img/app-symbole/workspace-512.png?v=202609151258", "sizes": "512x512", "type": "image/png", "purpose": "any" }, { - "src": "/assets/img/app-symbole/workspace-192-maskable.png?v=202609151252", + "src": "/assets/img/app-symbole/workspace-192-maskable.png?v=202609151258", "sizes": "192x192", "type": "image/png", "purpose": "maskable" }, { - "src": "/assets/img/app-symbole/workspace-512-maskable.png?v=202609151252", + "src": "/assets/img/app-symbole/workspace-512-maskable.png?v=202609151258", "sizes": "512x512", "type": "image/png", "purpose": "maskable" diff --git a/workspace/assets/css/dateien.css b/workspace/assets/css/dateien.css index 63df1a86..a3faab7a 100644 --- a/workspace/assets/css/dateien.css +++ b/workspace/assets/css/dateien.css @@ -176,3 +176,31 @@ .marke-person--leer { color: var(--text-still); font-weight: 400; font-style: italic; } @media (prefers-reduced-motion: reduce) { .wahl__knopf { transition: none; } } + +/* ===================================================================== + FASSUNGEN (15.09.2026) + + "Fassung 2" ist eine Nummer und bleibt ruhig. "nicht mehr aktuell" + ist eine Warnung und darf auffallen -- aber nicht schreien: Sie steht + an einer Datei, die niemand falsch gemacht hat, sie ist nur alt. + ===================================================================== */ + +.fassung { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; } +.fassung__nummer { + font-size: .78rem; font-weight: 640; color: var(--text-still); + font-variant-numeric: tabular-nums; +} +.fassung__alt { + font-size: .78rem; font-weight: 640; + padding: 2px 9px; border-radius: 999px; + color: #d8a76a; + border: 1px solid color-mix(in srgb, #cc9451 45%, transparent); +} +.fassung__loesen { + font: inherit; font-size: .76rem; + padding: 2px 9px; border-radius: 999px; cursor: pointer; + color: var(--text-still); + background: none; + border: 1px solid var(--rand); +} +.fassung__loesen:hover { color: var(--text); border-color: var(--rand-hell); } diff --git a/workspace/assets/js/dateien.js b/workspace/assets/js/dateien.js index c7a4d3f4..7ecc77cb 100644 --- a/workspace/assets/js/dateien.js +++ b/workspace/assets/js/dateien.js @@ -238,6 +238,46 @@ if (d.notiz) zeile2.append(el('span', null, '· ' + d.notiz)); k.append(zeile2); + /* ---- WELCHE FASSUNG IST DAS? (15.09.2026, Stufe 9) -------------- + + ZWEI VERSCHIEDENE AUSSAGEN, und sie duerfen nicht gleich aussehen: + + "Fassung 2" eine Nummer, ruhig + "nicht mehr aktuell" eine WARNUNG -- wer DIESE Datei + herunterlaedt, bekommt die falsche + + Die zweite ist der eigentliche Grund fuer das Ganze: Eine alte + Fassung kann "freigegeben" sein, waehrend die neue noch + "entwurf" ist. Ohne den Hinweis laedt man die freigegebene -- und + merkt nichts davon. */ + if (d.fassung > 1 || d.ersetzt_durch) { + const f = el('div', 'fassung'); + if (d.fassung > 1) f.append(el('span', 'fassung__nummer', 'Fassung ' + d.fassung)); + if (d.ersetzt_durch) { + const w = el('span', 'fassung__alt', 'nicht mehr aktuell'); + w.title = 'Es gibt eine neuere Fassung dieser Datei.'; + f.append(w); + } + /* Nur an der AKTUELLEN Fassung: Wer eine ueberholte loest, macht + daraus eine zweite aktuelle -- und hat das Problem zurueck, + das die Verknuepfung geloest hat. */ + if (d.fassung > 1 && !d.ersetzt_durch) { + const k2 = el('button', 'fassung__loesen', 'eigene Datei'); + k2.type = 'button'; + k2.title = 'Das ist keine neue Fassung, sondern eine eigenständige Datei.'; + k2.addEventListener('click', async () => { + k2.disabled = true; + try { + const a = await hole('/workspace/api/dateien/' + d.id + '/fassung', + { method: 'DELETE' }); + if (a.ok) await laden(); else melde('Ging nicht.'); + } finally { k2.disabled = false; } + }); + f.append(k2); + } + k.append(f); + } + /* Wer sie sehen darf -- sichtbar fuer alle, damit niemand raten muss, wer eine Datei schon hat. */ const frei = el('div', 'datei__freigaben'); diff --git a/workspace/aufgaben.html b/workspace/aufgaben.html index 689d73b1..740117aa 100644 --- a/workspace/aufgaben.html +++ b/workspace/aufgaben.html @@ -12,19 +12,19 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - + + + + + + - + @@ -252,10 +252,10 @@ - - - - - + + + + + diff --git a/workspace/automation.html b/workspace/automation.html index f69ac581..6f9619f3 100644 --- a/workspace/automation.html +++ b/workspace/automation.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -168,10 +168,10 @@ - - - - - + + + + + diff --git a/workspace/bereich.html b/workspace/bereich.html index b4e58fdd..dd632bcc 100644 --- a/workspace/bereich.html +++ b/workspace/bereich.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -181,14 +181,14 @@ - - - - - - - - - + + + + + + + + + diff --git a/workspace/calls.html b/workspace/calls.html index a25cb177..f70b2db4 100644 --- a/workspace/calls.html +++ b/workspace/calls.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -89,11 +89,11 @@ - - - - - - + + + + + + diff --git a/workspace/chat.html b/workspace/chat.html index c90d83ca..9a4e3b08 100644 --- a/workspace/chat.html +++ b/workspace/chat.html @@ -12,26 +12,26 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - + + + + - - - + + + - + @@ -341,10 +341,10 @@ - - - - - + + + + + diff --git a/workspace/content.html b/workspace/content.html index d4739324..454826b9 100644 --- a/workspace/content.html +++ b/workspace/content.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -179,12 +179,12 @@ - - - - - - - + + + + + + + diff --git a/workspace/crew-index.html b/workspace/crew-index.html index cfe4bdd6..37dd581d 100644 --- a/workspace/crew-index.html +++ b/workspace/crew-index.html @@ -36,15 +36,15 @@ - - - + + + - + @@ -339,6 +339,6 @@ - + diff --git a/workspace/crew.webmanifest b/workspace/crew.webmanifest index 17229128..e30ac789 100644 --- a/workspace/crew.webmanifest +++ b/workspace/crew.webmanifest @@ -13,25 +13,25 @@ "theme_color": "#06090f", "icons": [ { - "src": "/assets/img/app-symbole/crew-192.png?v=202609151252", + "src": "/assets/img/app-symbole/crew-192.png?v=202609151258", "sizes": "192x192", "type": "image/png", "purpose": "any" }, { - "src": "/assets/img/app-symbole/crew-512.png?v=202609151252", + "src": "/assets/img/app-symbole/crew-512.png?v=202609151258", "sizes": "512x512", "type": "image/png", "purpose": "any" }, { - "src": "/assets/img/app-symbole/crew-192-maskable.png?v=202609151252", + "src": "/assets/img/app-symbole/crew-192-maskable.png?v=202609151258", "sizes": "192x192", "type": "image/png", "purpose": "maskable" }, { - "src": "/assets/img/app-symbole/crew-512-maskable.png?v=202609151252", + "src": "/assets/img/app-symbole/crew-512-maskable.png?v=202609151258", "sizes": "512x512", "type": "image/png", "purpose": "maskable" diff --git a/workspace/dateien.html b/workspace/dateien.html index 7cfd6a7d..f0832333 100644 --- a/workspace/dateien.html +++ b/workspace/dateien.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -108,10 +108,10 @@ - - - - - + + + + + diff --git a/workspace/entwicklung.html b/workspace/entwicklung.html index fb48fcc5..914b092e 100644 --- a/workspace/entwicklung.html +++ b/workspace/entwicklung.html @@ -7,14 +7,14 @@ - - - - - - - - + + + + + + + + @@ -94,9 +94,9 @@ - - - - + + + + diff --git a/workspace/index.html b/workspace/index.html index 8efef6ba..05537978 100644 --- a/workspace/index.html +++ b/workspace/index.html @@ -30,9 +30,9 @@ - - - + + + @@ -401,6 +401,6 @@ - + diff --git a/workspace/kalender.html b/workspace/kalender.html index 18686426..f5a91bc3 100644 --- a/workspace/kalender.html +++ b/workspace/kalender.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -377,11 +377,11 @@ - - - - - - + + + + + + diff --git a/workspace/leistung.html b/workspace/leistung.html index bb2566ae..3ab81c51 100644 --- a/workspace/leistung.html +++ b/workspace/leistung.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -423,10 +423,10 @@ - - - - - + + + + + diff --git a/workspace/personen.html b/workspace/personen.html index 4e6d2a8f..a9a0155d 100644 --- a/workspace/personen.html +++ b/workspace/personen.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -423,10 +423,10 @@ - - - - - + + + + + diff --git a/workspace/profil.html b/workspace/profil.html index e75aa4ef..0fe7781d 100644 --- a/workspace/profil.html +++ b/workspace/profil.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -214,11 +214,11 @@ - - - - - - + + + + + + diff --git a/workspace/rechte.html b/workspace/rechte.html index 9d1f8c83..8934bf16 100644 --- a/workspace/rechte.html +++ b/workspace/rechte.html @@ -7,14 +7,14 @@ - - - - - - - - + + + + + + + + @@ -134,9 +134,9 @@ Beim ersten Anlauf fehlte die Zeile auf genau diesen beiden neuen Seiten. Gefunden hat das nicht das Auge, sondern pruef-css-klassen, die seit dem 07.09. jede Seite danach absucht. --> - - - - + + + + diff --git a/workspace/report.html b/workspace/report.html index ea6ab860..2b556cf3 100644 --- a/workspace/report.html +++ b/workspace/report.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -106,11 +106,11 @@ - - - - - - + + + + + + diff --git a/workspace/scouting.html b/workspace/scouting.html index 1af25eec..db54c227 100644 --- a/workspace/scouting.html +++ b/workspace/scouting.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -173,10 +173,10 @@ - - - - - + + + + + diff --git a/workspace/start.html b/workspace/start.html index 231a42b4..a9848d90 100644 --- a/workspace/start.html +++ b/workspace/start.html @@ -12,21 +12,21 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - + + + + - - + + - + @@ -674,10 +674,10 @@

- - - - - + + + + + diff --git a/workspace/startcheck.html b/workspace/startcheck.html index ad784c91..69f6b674 100644 --- a/workspace/startcheck.html +++ b/workspace/startcheck.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -85,11 +85,11 @@ - - - - - - + + + + + + diff --git a/workspace/steckbrief.html b/workspace/steckbrief.html index 6328d81b..5cdf8d44 100644 --- a/workspace/steckbrief.html +++ b/workspace/steckbrief.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -146,11 +146,11 @@ - - - - - - + + + + + + diff --git a/workspace/talente.html b/workspace/talente.html index 172a30e7..6cbbc921 100644 --- a/workspace/talente.html +++ b/workspace/talente.html @@ -7,14 +7,14 @@ - - - - - - - - + + + + + + + + @@ -94,9 +94,9 @@ - - - - + + + + diff --git a/workspace/team.html b/workspace/team.html index 5eac19e8..ae086854 100644 --- a/workspace/team.html +++ b/workspace/team.html @@ -7,20 +7,20 @@ - - - - - - - + + + + + + + - + @@ -110,10 +110,10 @@ - - - - - + + + + + diff --git a/workspace/teamlage.html b/workspace/teamlage.html index bafd6f5c..977ae3a2 100644 --- a/workspace/teamlage.html +++ b/workspace/teamlage.html @@ -7,20 +7,20 @@ - - - - - - - + + + + + + + - + - - - - + + + + diff --git a/workspace/treff-moderation.html b/workspace/treff-moderation.html index 2af21b6c..ce707e7d 100644 --- a/workspace/treff-moderation.html +++ b/workspace/treff-moderation.html @@ -7,14 +7,14 @@ - - - - - - - - + + + + + + + + @@ -110,9 +110,9 @@ - - - - + + + + diff --git a/workspace/treff-regeln.html b/workspace/treff-regeln.html index ab539036..1afb12cd 100644 --- a/workspace/treff-regeln.html +++ b/workspace/treff-regeln.html @@ -7,18 +7,18 @@ - - - - - - - + + + + + + + - + @@ -210,10 +210,10 @@ Beim ersten Anlauf fehlte die Zeile auf genau diesen beiden neuen Seiten. Gefunden hat das nicht das Auge, sondern pruef-css-klassen, die seit dem 07.09. jede Seite danach absucht. --> - - - - - + + + + + diff --git a/workspace/uebersicht.html b/workspace/uebersicht.html index ca1f959d..749f12de 100644 --- a/workspace/uebersicht.html +++ b/workspace/uebersicht.html @@ -12,22 +12,22 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - + + + + - - - + + + - + @@ -149,11 +149,11 @@ - + - - - - + + + + diff --git a/workspace/wissen.html b/workspace/wissen.html index c4e509e7..570dc2b4 100644 --- a/workspace/wissen.html +++ b/workspace/wissen.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -190,10 +190,10 @@ - - - - - + + + + +