From 125fb3c7e79e3d5eb876d93827268fab8f74aff5 Mon Sep 17 00:00:00 2001 From: rene Date: Thu, 30 Apr 2026 15:08:59 +0200 Subject: [PATCH] =?UTF-8?q?Feature:=20Gr=C3=BCnder/Partner-Badge=20im=20Us?= =?UTF-8?q?er-Profil-Modal=20+=20Freunde-Suche,=20SW=20by-v555?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/routes/friends.py | 2 ++ backend/static/js/app.js | 2 +- backend/static/js/pages/friends.js | 17 ++++++++++++++++- backend/static/sw.js | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/backend/routes/friends.py b/backend/routes/friends.py index df7c96a..cac5f4b 100644 --- a/backend/routes/friends.py +++ b/backend/routes/friends.py @@ -32,6 +32,7 @@ async def list_friends(user=Depends(get_current_user)): u.name AS friend_name, u.bio, u.wohnort, u.erfahrung, u.social_link, u.profil_sichtbarkeit, u.avatar_url, + u.is_founder, u.is_partner, u.founder_number, {dogs_sq} AS dogs_json FROM friendships f JOIN users u ON u.id = CASE WHEN f.requester_id=? THEN f.addressee_id ELSE f.requester_id END @@ -92,6 +93,7 @@ async def search_users(q: str = "", user=Depends(get_current_user)): SELECT u.id, u.name, u.bio, u.wohnort, u.erfahrung, u.social_link, u.profil_sichtbarkeit, u.avatar_url, + u.is_founder, u.is_partner, u.founder_number, (SELECT json_group_array(json_object('name', d.name, 'rasse', d.rasse)) FROM dogs d WHERE d.user_id=u.id AND d.is_public=1) AS dogs_json FROM users u diff --git a/backend/static/js/app.js b/backend/static/js/app.js index a9732a2..668140f 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 = '531'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '532'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.1.1'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; diff --git a/backend/static/js/pages/friends.js b/backend/static/js/pages/friends.js index 837474c..3f2e690 100644 --- a/backend/static/js/pages/friends.js +++ b/backend/static/js/pages/friends.js @@ -610,10 +610,23 @@ window.Page_friends = (() => { margin-bottom:var(--space-4)">${parts.join('')}`; })(); + const badgesHTML = (profile.is_founder || profile.is_partner) ? ` +
+ ${profile.is_founder ? ` + + ${profile.founder_number ? `Gründer #${profile.founder_number}` : 'Gründer'} + ` : ''} + ${profile.is_partner ? ` + + Partner + ` : ''} +
` : ''; + UI.modal.open({ title: _esc(friendName), body: `
+ ${badgesHTML} ${profileInfoHTML} ${dogsHTML} @@ -667,10 +680,12 @@ window.Page_friends = (() => { ${i < results.length - 1 ? 'border-bottom:1px solid var(--c-border)' : ''}"> ${_userAvatar(u.name, null, u.avatar_url)}
-
${_esc(u.name)} + ${u.is_founder ? `${u.founder_number ? `Gründer #${u.founder_number}` : 'Gründer'}` : ''} + ${u.is_partner ? `Partner` : ''} ${_erfahrungSpan(u.erfahrung)}
${_wohnortLine(u.wohnort)} diff --git a/backend/static/sw.js b/backend/static/sw.js index f9233a2..0b1e344 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v554'; +const CACHE_VERSION = 'by-v555'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache