From 909ae0e2d6027278b6285e2e08192309c613bbb2 Mon Sep 17 00:00:00 2001 From: giles Date: Thu, 19 Feb 2026 16:06:30 +0000 Subject: [PATCH] Add tickets & bookings account sub-pages New GET /auth/tickets/ and /auth/bookings/ routes with HTMX support. Update shared submodule with TicketDTO, service methods, nav links, and panel templates. Co-Authored-By: Claude Opus 4.6 --- bp/auth/routes.py | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/bp/auth/routes.py b/bp/auth/routes.py index d58a55a..a8a1566 100644 --- a/bp/auth/routes.py +++ b/bp/auth/routes.py @@ -150,6 +150,60 @@ def register(url_prefix="/auth"): return await make_response(html) + @auth_bp.get("/tickets/") + async def tickets(): + from shared.browser.app.utils.htmx import is_htmx_request + from shared.services.registry import services + + if not g.get("user"): + return redirect(host_url(url_for("auth.login_form"))) + + user_tickets = await services.calendar.user_tickets(g.s, user_id=g.user.id) + + tk_oob = {**oob, "main": "_types/auth/_tickets_panel.html"} + + if not is_htmx_request(): + html = await render_template( + "_types/auth/index.html", + oob=tk_oob, + tickets=user_tickets, + ) + else: + html = await render_template( + "_types/auth/_oob_elements.html", + oob=tk_oob, + tickets=user_tickets, + ) + + return await make_response(html) + + @auth_bp.get("/bookings/") + async def bookings(): + from shared.browser.app.utils.htmx import is_htmx_request + from shared.services.registry import services + + if not g.get("user"): + return redirect(host_url(url_for("auth.login_form"))) + + user_bookings = await services.calendar.user_bookings(g.s, user_id=g.user.id) + + bk_oob = {**oob, "main": "_types/auth/_bookings_panel.html"} + + if not is_htmx_request(): + html = await render_template( + "_types/auth/index.html", + oob=bk_oob, + bookings=user_bookings, + ) + else: + html = await render_template( + "_types/auth/_oob_elements.html", + oob=bk_oob, + bookings=user_bookings, + ) + + return await make_response(html) + @auth_bp.post("/start/") @clear_cache(tag_scope="user", clear_user=True) async def start_login():