diff --git a/backend/database.py b/backend/database.py index 9fe0d24..c64783a 100644 --- a/backend/database.py +++ b/backend/database.py @@ -452,6 +452,7 @@ def _migrate(conn_factory): ("users", "social_link", "TEXT"), ("users", "profil_sichtbarkeit", "TEXT NOT NULL DEFAULT 'public'"), ("users", "avatar_url", "TEXT"), + ("places", "telefon", "TEXT"), ] with conn_factory() as conn: for table, column, col_type in migrations: diff --git a/backend/routes/places.py b/backend/routes/places.py index f72355e..6e5c082 100644 --- a/backend/routes/places.py +++ b/backend/routes/places.py @@ -32,6 +32,7 @@ class PlaceCreate(BaseModel): lon: float adresse: Optional[str] = None website: Optional[str] = None + telefon: Optional[str] = None hund_rein: Optional[bool] = None leine_pflicht: Optional[bool] = None wasser_fuer_hunde: Optional[bool] = None @@ -43,6 +44,7 @@ class PlaceUpdate(BaseModel): lon: Optional[float]= None adresse: Optional[str] = None website: Optional[str] = None + telefon: Optional[str] = None hund_rein: Optional[bool] = None leine_pflicht: Optional[bool] = None wasser_fuer_hunde: Optional[bool] = None @@ -91,12 +93,12 @@ async def create_place(data: PlaceCreate, user=Depends(get_current_user)): with db() as conn: cur = conn.execute(""" INSERT INTO places - (user_id, name, typ, lat, lon, adresse, website, + (user_id, name, typ, lat, lon, adresse, website, telefon, hund_rein, leine_pflicht, wasser_fuer_hunde) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) """, ( user['id'], data.name, data.typ, data.lat, data.lon, - data.adresse, data.website, + data.adresse, data.website, data.telefon, int(data.hund_rein) if data.hund_rein is not None else None, int(data.leine_pflicht) if data.leine_pflicht is not None else None, int(data.wasser_fuer_hunde) if data.wasser_fuer_hunde is not None else None, diff --git a/backend/static/icons/phosphor.svg b/backend/static/icons/phosphor.svg index f80c186..4733778 100644 --- a/backend/static/icons/phosphor.svg +++ b/backend/static/icons/phosphor.svg @@ -33,6 +33,7 @@ + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 300207a..597a2ba 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 = '95'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '96'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const App = (() => { diff --git a/backend/static/js/pages/places.js b/backend/static/js/pages/places.js index 42b9b77..e7d6055 100644 --- a/backend/static/js/pages/places.js +++ b/backend/static/js/pages/places.js @@ -286,6 +286,7 @@ window.Page_places = (() => { ${place.adresse ? `

${UI.icon('map-pin')} ${_esc(place.adresse)}

` : ''} + ${place.telefon ? `

${UI.icon('phone')} ${_esc(place.telefon)}

` : ''} ${place.website ? `

${UI.icon('arrow-square-out')} ${_esc(place.website)}

` : ''} ${flags.length ? `
${flags.map(f => `${f}`).join('')}
` : ''}

@@ -388,6 +389,12 @@ window.Page_places = (() => { value="${_esc(place?.website || '')}" placeholder="https://…"> +

+ + +
+