From 0a28c6895339d957d4eda6349149d6daf7992373 Mon Sep 17 00:00:00 2001 From: rene Date: Thu, 14 May 2026 10:46:55 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20P/Z-Badges=20nur=20im=20Welten-Einrichte?= =?UTF-8?q?n-Modal=20f=C3=BCr=20Admins=20(SW=20by-v922)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Normale Welt-Views (JETZT/HUND/WELT): keine P/Z-Badges auf Chips - Config-Modal: P-Badge (Pro) und Z-Badge (Züchter) nur wenn isAdmin=true - isAdmin-Variable im _openConfigModal()-Scope ergänzt --- backend/main.py | 2 +- backend/static/js/app.js | 2 +- backend/static/js/worlds.js | 8 +++++--- backend/static/sw.js | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/backend/main.py b/backend/main.py index 9f5a2c4..80db05c 100644 --- a/backend/main.py +++ b/backend/main.py @@ -406,7 +406,7 @@ async def serve_media(path: str, request: _Request): raise _HE(404, "Nicht gefunden.") return _media_response(filepath) -APP_VER = "921" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "922" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 1aa2c36..6873247 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '921'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '922'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.5.1'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; // Cache-Bust-Parameter nach Update-Reload sofort entfernen diff --git a/backend/static/js/worlds.js b/backend/static/js/worlds.js index 0c3c15d..f4997a0 100644 --- a/backend/static/js/worlds.js +++ b/backend/static/js/worlds.js @@ -673,6 +673,7 @@ window.Worlds = (() => { let cfg = JSON.parse(JSON.stringify(_getConfig())); // deep copy let _drag = null; // { page, fromWorld, ghost } + const isAdmin = _state?.user?.rolle === 'admin'; const worldColors = { jetzt:'rgba(196,132,58,0.6)', hund:'rgba(196,132,58,0.8)', welt:'rgba(99,130,220,0.6)' }; const worldLabels = { jetzt:'JETZT', hund:'HUND', welt:'WELT', pool:'Nicht verwendet' }; const allAssigned = () => new Set([...cfg.jetzt, ...cfg.hund, ...cfg.welt]); @@ -776,7 +777,8 @@ window.Worlds = (() => { `} - ${c.pro && _isRoleBasedPro() ? `P` : ''} + ${isAdmin && c.pro ? `P` : ''} + ${isAdmin && c.role === 'breeder' ? `Z` : ''} @@ -1448,7 +1450,7 @@ window.Worlds = (() => { ` : ''}
Alles über ${_esc(dog.name)}
- ${chips.map(c => _chip(c.icon, c.label, c.page, false, c.pro && _isRoleBasedPro(), c.role === 'breeder')).join('')} + ${chips.map(c => _chip(c.icon, c.label, c.page, false, false, false)).join('')}