From 3e6db33027f47b0b8ab8c5f5ff3e2de2ba5ccb94 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Fri, 19 Jun 2026 00:38:33 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Rubrik-Dropdown=20beim=20Live-Stellen?= =?UTF-8?q?=20=E2=80=94=20freie=20Kategoriewahl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Neuer 🔴 Live + 0 markiert @@ -612,6 +629,12 @@ def build_index(articles: list[dict]) -> str: const selected = Array.from(document.querySelectorAll('.article-check:checked')).map(cb => cb.value); if (selected.length === 0) return; const live = document.getElementById('liveToggle').checked; + const rubric = document.getElementById('rubricSelect').value; + + if (live && rubric === '0') {{ + showToast('❌ Bitte eine Rubrik wählen (Dropdown rechts neben 🔴 Live)', true); + return; + }} // Readiness-Warnung (soft, blockiert nicht) const notReady = []; @@ -623,7 +646,8 @@ def build_index(articles: list[dict]) -> str: }}); let confirmMsg; if (live) {{ - confirmMsg = '🔴 LIVE: ' + selected.length + ' Artikel ÖFFENTLICH veröffentlichen?\\n\\nDies ist für 10.000+ Leser sichtbar!'; + const rubricName = document.getElementById('rubricSelect').selectedOptions[0].text; + confirmMsg = '🔴 LIVE in »' + rubricName + '«: ' + selected.length + ' Artikel ÖFFENTLICH veröffentlichen?\\n\\nDies ist für 10.000+ Leser sichtbar!'; }} else {{ confirmMsg = selected.length + ' Artikel auf KORREKTUR hochladen?\\n\\nNur Redaktion sichtbar. Sicher.'; }} @@ -640,7 +664,7 @@ def build_index(articles: list[dict]) -> str: const resp = await fetch('/publish', {{ method: 'POST', headers: {{'Content-Type': 'application/json', 'Authorization': 'Basic ' + auth}}, - body: JSON.stringify({{files: selected, live: live}}) + body: JSON.stringify({{files: selected, live: live, rubric: parseInt(rubric)}}) }}); const data = await resp.json(); if (data.ok) {{ @@ -1011,6 +1035,7 @@ h1{color:#c0392b;}p{color:#888;} data = json.loads(body) files = data.get("files", []) allow_live = data.get("live", False) # SAFETY GATE: Nur wenn explizit true + rubric = data.get("rubric", 0) # 0 = nicht gesetzt except json.JSONDecodeError: self._json_reply(400, {"ok": False, "error": "Invalid JSON"}) return @@ -1091,10 +1116,11 @@ h1{color:#c0392b;}p{color:#888;} jid_match = re.search(r' 0: + catid = rubric + elif allow_live: cat_match = re.search(r'