Move events/market/blog composition from Python to .sx defcomps (Phase 9)
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 2m33s

Continues the pattern of eliminating Python sx_call tree-building in favour
of data-driven .sx defcomps. POST/PUT/DELETE routes now pass plain data
(dicts, lists, scalars) and let .sx handle iteration, conditionals, and
layout via map/let/when/if. Single response components wrap OOB swaps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 08:17:09 +00:00
parent 877e776977
commit 51ebf347ba
23 changed files with 1841 additions and 1423 deletions

View File

@@ -2,12 +2,12 @@
from __future__ import annotations
from shared.sx.helpers import (
render_to_sx_with_env,
render_to_sx_with_env, sx_call,
post_admin_header_sx, oob_header_sx,
header_child_sx, full_page_sx, oob_page_sx,
)
from .utils import _clear_deeper_oob, _ensure_container_nav
from .utils import _ensure_container_nav
from .calendar import (
_post_header_sx, _calendars_header_sx,
_calendar_header_sx, _day_header_sx,
@@ -129,7 +129,7 @@ async def render_page_summary_oob(ctx: dict, entries, has_more, pending_tickets,
)
oobs = await _post_header_sx(ctx, oob=True)
oobs += _clear_deeper_oob("post-row", "post-header-child")
oobs += sx_call("events-clear-deeper-post")
return await oob_page_sx(oobs=oobs, content=content)
@@ -172,8 +172,7 @@ async def render_calendars_oob(ctx: dict) -> str:
ctx = await _ensure_container_nav(ctx)
slug = (ctx.get("post") or {}).get("slug", "")
oobs = await post_admin_header_sx(ctx, slug, oob=True, selected="calendars")
oobs += _clear_deeper_oob("post-row", "post-header-child",
"post-admin-row", "post-admin-header-child")
oobs += sx_call("events-clear-deeper-post-admin")
return await oob_page_sx(oobs=oobs, content=content)
@@ -196,8 +195,7 @@ async def render_calendar_oob(ctx: dict) -> str:
oobs = await _post_header_sx(ctx, oob=True)
oobs += await oob_header_sx("post-header-child", "calendar-header-child",
_calendar_header_sx(ctx))
oobs += _clear_deeper_oob("post-row", "post-header-child",
"calendar-row", "calendar-header-child")
oobs += sx_call("events-clear-deeper-calendar")
return await oob_page_sx(oobs=oobs, content=content)
@@ -221,9 +219,7 @@ async def render_day_oob(ctx: dict) -> str:
oobs = _calendar_header_sx(ctx, oob=True)
oobs += await oob_header_sx("calendar-header-child", "day-header-child",
_day_header_sx(ctx))
oobs += _clear_deeper_oob("post-row", "post-header-child",
"calendar-row", "calendar-header-child",
"day-row", "day-header-child")
oobs += sx_call("events-clear-deeper-day")
return await oob_page_sx(oobs=oobs, content=content)