diff --git a/backend/main.py b/backend/main.py index 9a593a0..47de28b 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 = "901" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "902" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): diff --git a/backend/static/index.html b/backend/static/index.html index 809c1f1..cb1a3cd 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -591,10 +591,10 @@
- - - - + + + + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 24d20c7..5f52530 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 = '901'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '902'; // ← 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/pages/zuchthunde.js b/backend/static/js/pages/zuchthunde.js index 4d6bb63..8807396 100644 --- a/backend/static/js/pages/zuchthunde.js +++ b/backend/static/js/pages/zuchthunde.js @@ -11,6 +11,7 @@ window.Page_zuchthunde = (() => { let _hunde = []; // geladene Hunde let _query = ''; // Suchtext let _openSections = {}; // {+ Diese Fotos erscheinen im öffentlichen Züchterprofil. Das primäre Foto wird als Logo im Hero angezeigt. +
+Lädt…
+Noch keine Fotos — lade das erste hoch.
`; + return; + } + el.innerHTML = ` +${_esc(err.message || 'Fehler')}
`; + } + } + + _loadGallery(); + + document.getElementById('bp-upload-form')?.addEventListener('submit', async e => { + e.preventDefault(); + const btn = document.getElementById('bp-upload-btn'); + const fileInput = e.target.querySelector('[name="file"]'); + const caption = e.target.querySelector('[name="caption"]')?.value?.trim() || ''; + if (!fileInput?.files?.length) { UI.toast.error('Bitte Datei auswählen.'); return; } + const fd = new FormData(); + fd.append('entity_type', 'breeder'); + fd.append('entity_id', String(breederId)); + fd.append('visibility', 'public'); + fd.append('caption', caption); + fd.append('file', fileInput.files[0]); + await UI.asyncButton(btn, async () => { + await API.breederPhotos.upload(fd); + UI.toast.success('Foto hochgeladen.'); + e.target.reset(); + await _loadGallery(); + }); + }); + } + return { init, refresh, onDogChange }; })(); diff --git a/backend/static/sw.js b/backend/static/sw.js index fd1652f..3dea315 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-v901'; +const CACHE_VERSION = 'by-v902'; 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