From 01a499b740b9516f2796a5f1ba42aec9ba7825be Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 19 Apr 2026 11:56:47 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Pills=20mit=20Inline-Styles=20(CSS-Cache?= =?UTF-8?q?-unabh=C3=A4ngig)=20+=20CSS-Version=20gebumpt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/static/index.html | 4 ++-- backend/static/js/app.js | 2 +- backend/static/js/pages/routes.js | 32 +++++++++++++++++++++---------- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/backend/static/index.html b/backend/static/index.html index 9abf2cb..5fd4ac2 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -32,8 +32,8 @@ - - + + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 930495f..0fe95ee 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 = '232'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '233'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const App = (() => { diff --git a/backend/static/js/pages/routes.js b/backend/static/js/pages/routes.js index a3cb210..bdd176e 100644 --- a/backend/static/js/pages/routes.js +++ b/backend/static/js/pages/routes.js @@ -692,6 +692,14 @@ window.Page_routes = (() => { `; } + // Pill-Hilfsfunktionen (inline styles — unabhängig vom CSS-Cache) + const _pillStyle = (bg, color, border) => + `display:inline-flex;align-items:center;font-size:10px;font-weight:600;` + + `padding:2px 8px;border-radius:999px;white-space:nowrap;` + + `background:${bg};color:${color};border:1px solid ${border};`; + const _pill = (text, bg, color, border) => + `${text}`; + // ---------------------------------------------------------- // Detail-Modal // ---------------------------------------------------------- @@ -723,18 +731,19 @@ window.Page_routes = (() => { margin-bottom:var(--space-3);background:var(--c-surface-2)"> ${photoGallery}
- ${route.distanz_km ? `${route.distanz_km.toFixed(1)} km` : ''} - ${route.dauer_min ? `${_fmtDur(route.dauer_min)}` : ''} - ${route.schwierigkeit ? `${DIFFICULTY_LABEL[route.schwierigkeit]||route.schwierigkeit}` : ''} - ${route.hunde_tauglichkeit ? `${HUNDE_TEXT[route.hunde_tauglichkeit]||route.hunde_tauglichkeit}` : ''} + ${route.distanz_km ? _pill(route.distanz_km.toFixed(1)+' km', '#f1f5f9','#475569','#e2e8f0') : ''} + ${route.dauer_min ? _pill(_fmtDur(route.dauer_min), '#f1f5f9','#475569','#e2e8f0') : ''} + ${route.schwierigkeit ? _pill(DIFFICULTY_LABEL[route.schwierigkeit]||route.schwierigkeit, + ({leicht:'#dcfce7',mittel:'#fef9c3',anspruchsvoll:'#fee2e2'})[route.schwierigkeit]||'#f1f5f9', + ({leicht:'#15803d',mittel:'#92400e',anspruchsvoll:'#991b1b'})[route.schwierigkeit]||'#475569', + ({leicht:'#bbf7d0',mittel:'#fde68a',anspruchsvoll:'#fecaca'})[route.schwierigkeit]||'#e2e8f0') : ''} + ${route.hunde_tauglichkeit ? _pill(HUNDE_TEXT[route.hunde_tauglichkeit]||route.hunde_tauglichkeit,'#fef3c7','#92400e','#fde68a') : ''} ${isOwn - ? `` - : (!route.is_public ? `Privat` : `Öffentlich`) + : _pill(route.is_public?'Öffentlich':'Privat', route.is_public?'#dcfce7':'#dbeafe', route.is_public?'#15803d':'#1d4ed8', route.is_public?'#bbf7d0':'#bfdbfe') }
${route.beschreibung ? `

${UI.escape(route.beschreibung)}

` : ''} @@ -825,7 +834,10 @@ window.Page_routes = (() => { await API.routes.update(route.id, { is_public: !route.is_public }); route.is_public = !route.is_public; if (pill) { - pill.className = `rk-pill ${route.is_public ? 'rk-pill--public' : 'rk-pill--private'}`; + pill.style.cssText = _pillStyle( + route.is_public ? '#dcfce7' : '#dbeafe', + route.is_public ? '#15803d' : '#1d4ed8', + route.is_public ? '#bbf7d0' : '#bfdbfe') + 'cursor:pointer;'; pill.innerHTML = route.is_public ? 'Öffentlich' : 'Privat'; pill.title = route.is_public ? 'Auf Privat setzen' : 'Auf Öffentlich setzen'; }