From fd87c9af7bda4076bdd1854f909b77559c0c67de Mon Sep 17 00:00:00 2001 From: rene Date: Wed, 6 May 2026 20:47:13 +0200 Subject: [PATCH] =?UTF-8?q?UX:=20Pro-Chips=20komplett=20ausgeblendet=20f?= =?UTF-8?q?=C3=BCr=20Standard-User=20(kein=2025%=20Opacity=20mehr)=20(SW?= =?UTF-8?q?=20by-v747)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/main.py | 2 +- backend/static/index.html | 2 +- backend/static/js/app.js | 2 +- backend/static/js/worlds.js | 16 +++++++++++++--- backend/static/sw.js | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/backend/main.py b/backend/main.py index 936a202..c023c04 100644 --- a/backend/main.py +++ b/backend/main.py @@ -327,7 +327,7 @@ MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media") os.makedirs(MEDIA_DIR, exist_ok=True) app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media") -APP_VER = "746" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "747" # muss mit APP_VER in app.js übereinstimmen @app.get("/api/version") async def app_version(): diff --git a/backend/static/index.html b/backend/static/index.html index 184af40..11a3536 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -578,7 +578,7 @@ - + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 5a80762..ffa1a09 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 = '746'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '747'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.5.0'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; diff --git a/backend/static/js/worlds.js b/backend/static/js/worlds.js index 0bfe6df..e451d69 100644 --- a/backend/static/js/worlds.js +++ b/backend/static/js/worlds.js @@ -569,6 +569,16 @@ window.Worlds = (() => { const u = _state?.user; const tier = u?.subscription_tier || 'standard'; const isTest = tier.endsWith('_test'); + + // Pro-Chips: komplett ausblenden wenn kein Zugriff + if (chip.pro) { + if (!u) return false; + if (isTest) return ['pro_test','breeder_test'].includes(tier); + if (u.rolle === 'admin' || u.rolle === 'moderator') return true; + if (u.is_moderator || u.is_social_media) return true; + return ['pro','breeder'].includes(tier); + } + // Role-Checks (hart — komplett ausblenden) if (!chip?.role) return true; if (chip.role === 'breeder') { @@ -1049,7 +1059,7 @@ window.Worlds = (() => {
- ${features.map(f => _chip(f.icon, f.label, f.page, !!(f.pro && !_hasProAccess()))).join('')} + ${features.map(f => _chip(f.icon, f.label, f.page)).join('')}