Replace env free-variable threading with IO-primitive auto-fetch macros
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m38s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m38s
Layout components now self-resolve context (cart-mini, auth-menu, nav-tree, rights, URLs) via new IO primitives (root-header-ctx, select-colours, account-nav-ctx, app-rights) and defmacro wrappers (~root-header-auto, ~auth-header-row-auto, ~root-mobile-auto). This eliminates _ctx_to_env(), HELPER_CSS_CLASSES, and verbose :key threading across all 10 services. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
"""Slot panels, forms, edit/add, slot picker JS."""
|
||||
from __future__ import annotations
|
||||
|
||||
from markupsafe import escape
|
||||
|
||||
from shared.sx.helpers import render_to_sx
|
||||
from shared.sx.parser import SxExpr
|
||||
@@ -156,20 +155,12 @@ async def _slot_header_html(ctx: dict, *, oob: bool = False) -> str:
|
||||
if not slot:
|
||||
return ""
|
||||
|
||||
# Label: icon + name + description
|
||||
desc = getattr(slot, "description", "") or ""
|
||||
label_inner = (
|
||||
f'<div class="flex flex-col md:flex-row md:gap-2 items-center">'
|
||||
f'<div class="flex flex-row items-center gap-2">'
|
||||
f'<i class="fa fa-clock"></i>'
|
||||
f'<div class="shrink-0">{escape(slot.name)}</div>'
|
||||
f'</div>'
|
||||
f'<p class="text-stone-500 whitespace-pre-line break-all w-full">{escape(desc)}</p>'
|
||||
f'</div>'
|
||||
)
|
||||
label_sx = await render_to_sx("events-slot-label",
|
||||
name=slot.name, description=desc)
|
||||
|
||||
return await render_to_sx("menu-row-sx", id="slot-row", level=5,
|
||||
link_label_content=SxExpr(label_inner),
|
||||
link_label_content=SxExpr(label_sx),
|
||||
child_id="slot-header-child", oob=oob)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user