Files
mono/events/sx/layouts.sx
giles 7fda7a8027 Replace env free-variable threading with IO-primitive auto-fetch macros
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>
2026-03-04 18:20:57 +00:00

97 lines
4.5 KiB
Plaintext

;; Events layout defcomps — root header via ~root-header-auto,
;; events-specific headers passed as &key params.
;; --- Calendar admin layout: root + post + child(admin + cal + cal-admin) ---
(defcomp ~events-cal-admin-layout-full (&key post-header admin-header
calendar-header calendar-admin-header)
(<> (~root-header-auto)
post-header
(~header-child-sx :inner (<> admin-header calendar-header calendar-admin-header))))
(defcomp ~events-cal-admin-layout-oob (&key admin-oob cal-oob cal-admin-oob-wrap clear-oob)
(<> admin-oob cal-oob cal-admin-oob-wrap clear-oob))
;; --- Slots layout: same full as cal-admin ---
(defcomp ~events-slots-layout-oob (&key admin-oob cal-admin-oob clear-oob)
(<> admin-oob cal-admin-oob clear-oob))
;; --- Slot detail layout: root + post + child(admin + cal + cal-admin + slot) ---
(defcomp ~events-slot-layout-full (&key post-header admin-header
calendar-header calendar-admin-header slot-header)
(<> (~root-header-auto)
post-header
(~header-child-sx :inner (<> admin-header calendar-header calendar-admin-header slot-header))))
(defcomp ~events-slot-layout-oob (&key admin-oob cal-admin-oob slot-oob-wrap clear-oob)
(<> admin-oob cal-admin-oob slot-oob-wrap clear-oob))
;; --- Day admin layout: root + post + child(admin + cal + day + day-admin) ---
(defcomp ~events-day-admin-layout-full (&key post-header admin-header
calendar-header day-header day-admin-header)
(<> (~root-header-auto)
post-header
(~header-child-sx :inner (<> admin-header calendar-header day-header day-admin-header))))
(defcomp ~events-day-admin-layout-oob (&key admin-oob cal-oob day-admin-oob-wrap clear-oob)
(<> admin-oob cal-oob day-admin-oob-wrap clear-oob))
;; --- Entry layout: root + child(post + cal + day + entry) ---
(defcomp ~events-entry-layout-full (&key post-header calendar-header day-header entry-header)
(<> (~root-header-auto)
(~header-child-sx :inner (<> post-header calendar-header day-header entry-header))))
(defcomp ~events-entry-layout-oob (&key day-oob entry-oob-wrap clear-oob)
(<> day-oob entry-oob-wrap clear-oob))
;; --- Entry admin layout: root + post + child(admin + cal + day + entry + entry-admin) ---
(defcomp ~events-entry-admin-layout-full (&key post-header admin-header
calendar-header day-header
entry-header entry-admin-header)
(<> (~root-header-auto)
post-header
(~header-child-sx :inner (<> admin-header calendar-header day-header
entry-header entry-admin-header))))
(defcomp ~events-entry-admin-layout-oob (&key admin-oob entry-oob entry-admin-oob-wrap clear-oob)
(<> admin-oob entry-oob entry-admin-oob-wrap clear-oob))
;; --- Ticket types layout: root + child(post + cal + day + entry + entry-admin + ticket-types) ---
(defcomp ~events-ticket-types-layout-full (&key post-header calendar-header day-header
entry-header entry-admin-header
ticket-types-header)
(<> (~root-header-auto)
(~header-child-sx :inner (<> post-header calendar-header day-header
entry-header entry-admin-header ticket-types-header))))
(defcomp ~events-ticket-types-layout-oob (&key entry-admin-oob ticket-types-oob-wrap)
(<> entry-admin-oob ticket-types-oob-wrap))
;; --- Ticket type detail layout: root + child(post + cal + day + entry + entry-admin + types + type) ---
(defcomp ~events-ticket-type-layout-full (&key post-header calendar-header day-header
entry-header entry-admin-header
ticket-types-header ticket-type-header)
(<> (~root-header-auto)
(~header-child-sx :inner (<> post-header calendar-header day-header
entry-header entry-admin-header
ticket-types-header ticket-type-header))))
(defcomp ~events-ticket-type-layout-oob (&key ticket-types-oob ticket-type-oob-wrap)
(<> ticket-types-oob ticket-type-oob-wrap))
;; --- Markets layout: root + child(post + markets) ---
(defcomp ~events-markets-layout-full (&key post-header markets-header)
(<> (~root-header-auto)
(~header-child-sx :inner (<> post-header markets-header))))
(defcomp ~events-markets-layout-oob (&key post-oob markets-oob-wrap)
(<> post-oob markets-oob-wrap))