Projektordner in der Nextcloud anlegen und je nach Status verschieben (P10)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
Claude
2026-10-19 19:07:03 +00:00
parent 6615acf936
commit a3bb310cea
9 changed files with 256 additions and 4 deletions

View File

@@ -118,12 +118,17 @@ function bestaetigen(frage: string): Promise<boolean> {
async function bearbeiten(pfad: string, titel: string, felder: Feld[], zeile: Zeile | null, vorgaben: Zeile = {}): Promise<boolean> {
const e = await dialog(titel, felder, zeile ?? vorgaben, !!zeile);
if (!e) return false;
let antwort: Zeile | undefined;
if (e.aktion === "loeschen") await api(`${pfad}/${zeile!.id}`, "DELETE");
else if (zeile) await api(`${pfad}/${zeile.id}`, "PATCH", e.daten);
else await api(pfad, "POST", { ...vorgaben, ...e.daten });
else if (zeile) antwort = await api(`${pfad}/${zeile.id}`, "PATCH", e.daten);
else antwort = await api(pfad, "POST", { ...vorgaben, ...e.daten });
// gespeichert, aber z. B. der Projektordner in der Nextcloud hat nicht geklappt
if (antwort?.ordner_fehler) hinweisNachLaden = antwort.ordner_fehler;
return true;
}
let hinweisNachLaden = "";
function tabelle(spalten: { titel: string; wert: (z: Zeile) => string; klasse?: string }[], zeilen: Zeile[], klick?: (z: Zeile) => void): HTMLTableElement {
const t = document.createElement("table");
t.innerHTML = `<thead><tr>${spalten.map((s) => `<th class="${s.klasse ?? ""}">${esc(s.titel)}</th>`).join("")}</tr></thead>
@@ -137,7 +142,8 @@ function tabelle(spalten: { titel: string; wert: (z: Zeile) => string; klasse?:
// Kopf wie bei Plancraft: Titel links, Hauptknopf rechts; darunter eine Leiste für Filter
function seite(titel: string, knopf?: { text: string; aktion: () => void }): HTMLElement {
inhalt.innerHTML = `<div class="kopf"><h1>${esc(titel)}</h1></div>`;
inhalt.innerHTML = `<div class="kopf"><h1>${esc(titel)}</h1></div>${hinweisNachLaden ? `<div class="warnung">${esc(hinweisNachLaden)}</div>` : ""}`;
hinweisNachLaden = "";
if (knopf) {
const b = document.createElement("button");
b.className = "haupt";