ui batch: admin tab, time filter, count-up, chevron sync, tidy
1. New /admin route with sub-tabs (Protokoll, Benutzer) for admins. Top nav: "Protokoll" dropped, "Admin" added right of Einstellungen. /logs and /einstellungen/benutzer issue 301 redirects to the new paths. Benutzer is no longer part of Einstellungen sub-nav. 2. User_filters.max_age_hours (migration v6) — new dropdown (1–10 h / beliebig) under Einstellungen → Filter; Wohnungen list drops flats older than the cutoff by discovered_at. 3. Header shows "aktualisiert vor X s" instead of a countdown. Template emits data-counter-up-utc with last_alert_heartbeat; app.js ticks up each second. When a scrape runs, the heartbeat updates and the HTMX swap resets the counter naturally. 4. Chevron state synced after HTMX swaps: panes preserved via hx-preserve keep the user's open/closed state, and the sibling button's .open class is re-applied by syncFlatExpandState() on afterSwap — previously a scroll-triggered poll would flip the chevron back to closed while the pane stayed open. 5. "Final absenden" footer removed from the profile page (functionality is unchanged, the switch still sits atop Wohnungen). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
83db8cd902
commit
da180bd7c7
10 changed files with 175 additions and 85 deletions
|
|
@ -202,6 +202,10 @@ MIGRATIONS: list[str] = [
|
|||
ALTER TABLE flats ADD COLUMN enrichment_updated_at TEXT;
|
||||
ALTER TABLE flats ADD COLUMN image_count INTEGER NOT NULL DEFAULT 0;
|
||||
""",
|
||||
# 0006: time filter — hide flats older than X hours (NULL = no limit)
|
||||
"""
|
||||
ALTER TABLE user_filters ADD COLUMN max_age_hours INTEGER;
|
||||
""",
|
||||
]
|
||||
|
||||
|
||||
|
|
@ -353,7 +357,8 @@ def get_filters(user_id: int) -> sqlite3.Row:
|
|||
|
||||
def update_filters(user_id: int, data: dict) -> None:
|
||||
_ensure_user_rows(user_id)
|
||||
allowed = {"rooms_min", "rooms_max", "max_rent", "min_size", "max_morning_commute", "wbs_required"}
|
||||
allowed = {"rooms_min", "rooms_max", "max_rent", "min_size",
|
||||
"max_morning_commute", "wbs_required", "max_age_hours"}
|
||||
clean = {k: data.get(k) for k in allowed if k in data}
|
||||
if not clean:
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue