Fix: Logo-URL /media/ korrekt; Züchter-Section im Sidebar mit Label+Trennlinie (SW by-v914)

This commit is contained in:
rene 2026-05-13 20:15:16 +02:00
parent e11efa23f0
commit 6956870827
5 changed files with 32 additions and 28 deletions

View file

@ -71,7 +71,7 @@ async def breeder_status(user=Depends(get_current_user)):
"profile": dict(profile) if profile else None,
}
if profile:
result["profile"]["logo_url"] = f"/api/media/{logo['file_path']}" if logo else None
result["profile"]["logo_url"] = f"/media/{logo['file_path']}" if logo else None
return result
@ -417,7 +417,7 @@ async def breeder_public_profile(zwingername: str):
WHERE breeder_id=? AND entity_type='breeder'
ORDER BY sort_order, id LIMIT 1
""", (breeder_id,)).fetchone()
result["logo_url"] = f"/api/media/{logo['file_path']}" if logo else None
result["logo_url"] = f"/media/{logo['file_path']}" if logo else None
# Öffentliche Fotos für die Gallery (alle entity_type='breeder', max. 12)
photos = conn.execute("""
@ -426,8 +426,8 @@ async def breeder_public_profile(zwingername: str):
ORDER BY is_primary DESC, sort_order, id LIMIT 12
""", (breeder_id,)).fetchall()
result["fotos"] = [{
"url": f"/api/media/{p['file_path']}",
"thumb": f"/api/media/{p['thumbnail_path']}" if p['thumbnail_path'] else f"/api/media/{p['file_path']}",
"url": f"/media/{p['file_path']}",
"thumb": f"/media/{p['thumbnail_path']}" if p['thumbnail_path'] else f"/media/{p['file_path']}",
"caption": p["caption"] or "",
"primary": bool(p["is_primary"]),
} for p in photos]