banyaro/backend/static
rene 297bd22f96 Bündel 2: Zentrale Helper für DRY-Cleanup, SW by-v1114
NEUE BACKEND-MODULE:

math_utils.py
- haversine_km(lat1, lon1, lat2, lon2) — Distanz in km
- haversine_m(...) — Convenience-Wrapper in Metern
- bbox_deg_from_km(lat, radius_km) — Bounding-Box-Approximation
  für SQL-Vorfilter (statt Haversine im Python-Loop)

config.py
- DB_PATH, MEDIA_DIR, BREEDER_DOCS_DIR, SCANINPUT_DIR
- API_TIMEOUT_SHORT (5s) / DEFAULT (10s) / LONG (30s)
- HTTP_USER_AGENT, HTTP_HEADERS

errors.py
- not_found(msg), forbidden(msg), bad_request(msg), unauthorized(msg)
- conflict(msg), too_many_requests(msg, retry_after), service_unavailable(msg)
- require_or_404(row, msg) — Convenience-Helper

UI.JS ERWEITERUNGEN:

UI.time erweitert:
- formatDate(d)     → "15.03.2026"
- formatDateTime(d) → "15.03.2026, 14:30"
- weekday(d)        → "Di"
- parseISO(str)     → {year, month, day}

UI.text (neu):
- truncate(str, maxLen, ellipsis='…')
- slug(str) — URL-Slug aus String (mit DE-Umlauten)

UI.money (neu):
- format(value) → "12,34 €" (de-DE, EUR)
- formatWithSuffix(value, '/Jahr')

HAVERSINE-MIGRATION (13 Backend-Routen):
alerts.py, services.py, places.py, events.py, diary.py, playdate.py,
lost.py, poison.py, adoption.py, gassi_zeiten.py, sitting.py, routen.py,
walks.py

- Alle lokalen def _haversine/haversine_km entfernt
- Aufrufe ersetzt durch haversine_km/haversine_m je nach Einheit
- from math_utils import haversine_km|haversine_m in jeder Datei

Tests 19/19 grün.

Hinweis: Migrationen für MEDIA_DIR (19 Stellen), API-Timeouts (12),
Date-Formatter im Frontend (24) und UI.text.truncate (5) sind als
Folge-Sprints möglich. Helper sind verfügbar.
2026-05-27 11:19:06 +02:00
..
css Sprint D: Karten-Familie auf UI.map.create+svgMarker konsolidiert, SW by-v1107 2026-05-27 08:17:06 +02:00
icons Chore: Sprint32-36 Zwischenstand — alle Änderungen aus dieser Session committen 2026-05-03 11:09:39 +02:00
img Landing: Ban Yaro persönlich — Foto + Geschichte als Split-Section (SW by-v960) 2026-05-14 19:50:12 +02:00
js Bündel 2: Zentrale Helper für DRY-Cleanup, SW by-v1114 2026-05-27 11:19:06 +02:00
index.html Bündel 2: Zentrale Helper für DRY-Cleanup, SW by-v1114 2026-05-27 11:19:06 +02:00
landing.html Bündel 2: Zentrale Helper für DRY-Cleanup, SW by-v1114 2026-05-27 11:19:06 +02:00
llms.txt SEO: llms.txt v1.5.1 + sitemap /zuechter + JSON-LD Pricing (Pro 29€/Züchter 49€) 2026-05-14 09:43:21 +02:00
manifest.json Fix: theme-color dunkel im Dark-Mode (Statusleiste Samsung), manifest background_color dunkel (SW by-v810) 2026-05-09 21:59:20 +02:00
presse.html Feature: Welten-Onboarding, Wetter-Motivation, UX-Fixes (SW by-v715) 2026-05-05 17:32:03 +02:00
robots.txt Feature+Fix: Referral-Admin, Pro-Gates, Karten-Layer, onDogChange, Staging-Media (SW by-v855) 2026-05-11 17:23:29 +02:00
sitemap.xml SEO: llms.txt v1.5.1 + sitemap /zuechter + JSON-LD Pricing (Pro 29€/Züchter 49€) 2026-05-14 09:43:21 +02:00
sw.js Bündel 2: Zentrale Helper für DRY-Cleanup, SW by-v1114 2026-05-27 11:19:06 +02:00
zuechter.html Neu: AGB-Seite + Impressum/Datenschutz aktualisiert (SW by-v985) 2026-05-15 16:21:04 +02:00