Add tickets & bookings account sub-pages
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 46s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 46s
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 <noreply@anthropic.com>
This commit is contained in:
@@ -150,6 +150,60 @@ def register(url_prefix="/auth"):
|
|||||||
|
|
||||||
return await make_response(html)
|
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/")
|
@auth_bp.post("/start/")
|
||||||
@clear_cache(tag_scope="user", clear_user=True)
|
@clear_cache(tag_scope="user", clear_user=True)
|
||||||
async def start_login():
|
async def start_login():
|
||||||
|
|||||||
Reference in New Issue
Block a user