Feature: Gründer/Partner-Badge im User-Profil-Modal + Freunde-Suche, SW by-v555

This commit is contained in:
rene 2026-04-30 15:08:59 +02:00
parent 47c0590364
commit 125fb3c7e7
4 changed files with 20 additions and 3 deletions

View file

@ -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

View file

@ -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';

View file

@ -610,10 +610,23 @@ window.Page_friends = (() => {
margin-bottom:var(--space-4)">${parts.join('')}</div>`;
})();
const badgesHTML = (profile.is_founder || profile.is_partner) ? `
<div style="display:flex;gap:var(--space-2);margin-bottom:var(--space-3);flex-wrap:wrap">
${profile.is_founder ? `<span class="badge" style="background:#7c3aed;color:#fff">
<svg class="ph-icon" aria-hidden="true" style="width:12px;height:12px"><use href="/icons/phosphor.svg#key"></use></svg>
${profile.founder_number ? `Gründer #${profile.founder_number}` : 'Gründer'}
</span>` : ''}
${profile.is_partner ? `<span class="badge" style="background:#0ea5e9;color:#fff">
<svg class="ph-icon" aria-hidden="true" style="width:12px;height:12px"><use href="/icons/phosphor.svg#handshake"></use></svg>
Partner
</span>` : ''}
</div>` : '';
UI.modal.open({
title: _esc(friendName),
body: `
<div>
${badgesHTML}
${profileInfoHTML}
<div class="by-section-label">${dogs.length === 1 ? 'Hund' : 'Hunde'}</div>
${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)}
<div style="flex:1;min-width:0">
<div style="display:flex;align-items:center;flex-wrap:wrap;gap:2px;
<div style="display:flex;align-items:center;flex-wrap:wrap;gap:4px;
margin-bottom:2px">
<span style="font-size:var(--text-sm);font-weight:var(--weight-semibold);
color:var(--c-text)">${_esc(u.name)}</span>
${u.is_founder ? `<span style="font-size:10px;font-weight:700;background:#7c3aed;color:#fff;padding:1px 5px;border-radius:4px">${u.founder_number ? `Gründer #${u.founder_number}` : 'Gründer'}</span>` : ''}
${u.is_partner ? `<span style="font-size:10px;font-weight:700;background:#0ea5e9;color:#fff;padding:1px 5px;border-radius:4px">Partner</span>` : ''}
${_erfahrungSpan(u.erfahrung)}
</div>
${_wohnortLine(u.wohnort)}

View file

@ -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