Files
mono/events/bp/day/admin/routes.py
giles e8bc228c7f Rebrand sexp → sx across web platform (173 files)
Rename all sexp directories, files, identifiers, and references to sx.
artdag/ excluded (separate media processing DSL).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:06:57 +00:00

32 lines
917 B
Python

from __future__ import annotations
from quart import (
render_template, make_response, Blueprint
)
from shared.browser.app.authz import require_admin
from shared.sx.helpers import sx_response
def register():
bp = Blueprint("admin", __name__, url_prefix='/admin')
# ---------- Pages ----------
@bp.get("/")
@require_admin
async def admin(year: int, month: int, day: int, **kwargs):
from shared.browser.app.utils.htmx import is_htmx_request
from shared.sx.page import get_template_context
from sx.sx_components import render_day_admin_page, render_day_admin_oob
tctx = await get_template_context()
if not is_htmx_request():
html = await render_day_admin_page(tctx)
return await make_response(html)
else:
sx_src = await render_day_admin_oob(tctx)
return sx_response(sx_src)
return bp