Merge branch 'worktree-macros-essays' into macros
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m22s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m22s
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
;; Account layout defcomps — read ctx values from env free variables.
|
;; Account layout defcomps — read ctx values from env free variables.
|
||||||
;; Registered via register_sx_layout("account", ...) in __init__.py.
|
;; Registered via register_sx_layout("account", ...) in __init__.py.
|
||||||
|
;; Free variables come from _ctx_to_env() in shared/sx/helpers.py.
|
||||||
|
|
||||||
;; Full page: root header + auth header row in header-child
|
;; Full page: root header + auth header row in header-child
|
||||||
(defcomp ~account-layout-full ()
|
(defcomp ~account-layout-full ()
|
||||||
(<> (~root-header)
|
(<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||||
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
||||||
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
|
||||||
(~header-child-sx
|
(~header-child-sx
|
||||||
:inner (~auth-header-row :account-url account-url
|
:inner (~auth-header-row :account-url account-url
|
||||||
:select-colours select-colours
|
:select-colours select-colours
|
||||||
@@ -15,7 +18,10 @@
|
|||||||
:select-colours select-colours
|
:select-colours select-colours
|
||||||
:account-nav account-nav
|
:account-nav account-nav
|
||||||
:oob true)
|
:oob true)
|
||||||
(~root-header :oob true)))
|
(~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||||
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
||||||
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin
|
||||||
|
:oob true)))
|
||||||
|
|
||||||
;; Mobile menu: auth section + root nav
|
;; Mobile menu: auth section + root nav
|
||||||
(defcomp ~account-layout-mobile ()
|
(defcomp ~account-layout-mobile ()
|
||||||
@@ -24,4 +30,4 @@
|
|||||||
:items (~auth-nav-items :account-url account-url
|
:items (~auth-nav-items :account-url account-url
|
||||||
:select-colours select-colours
|
:select-colours select-colours
|
||||||
:account-nav account-nav))
|
:account-nav account-nav))
|
||||||
(~root-mobile)))
|
(~root-mobile :nav-tree nav-tree :auth-menu auth-menu)))
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
|
|
||||||
;; Full page: root header + social header in header-child
|
;; Full page: root header + social header in header-child
|
||||||
(defcomp ~social-layout-full ()
|
(defcomp ~social-layout-full ()
|
||||||
(<> (~root-header)
|
(<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||||
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
||||||
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
|
||||||
(~header-child-sx
|
(~header-child-sx
|
||||||
:inner (~federation-social-header
|
:inner (~federation-social-header
|
||||||
:nav (~federation-social-nav :actor actor)))))
|
:nav (~federation-social-nav :actor actor)))))
|
||||||
@@ -14,4 +16,7 @@
|
|||||||
:parent-id "root-header-child"
|
:parent-id "root-header-child"
|
||||||
:row (~federation-social-header
|
:row (~federation-social-header
|
||||||
:nav (~federation-social-nav :actor actor)))
|
:nav (~federation-social-nav :actor actor)))
|
||||||
(~root-header :oob true)))
|
(~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||||
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
||||||
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin
|
||||||
|
:oob true)))
|
||||||
|
|||||||
@@ -4,7 +4,9 @@
|
|||||||
;; --- orders layout: root + auth + orders rows ---
|
;; --- orders layout: root + auth + orders rows ---
|
||||||
|
|
||||||
(defcomp ~orders-layout-full (&key list-url)
|
(defcomp ~orders-layout-full (&key list-url)
|
||||||
(<> (~root-header)
|
(<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||||
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
||||||
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
|
||||||
(~header-child-sx
|
(~header-child-sx
|
||||||
:inner (<> (~auth-header-row :account-url account-url
|
:inner (<> (~auth-header-row :account-url account-url
|
||||||
:select-colours select-colours
|
:select-colours select-colours
|
||||||
@@ -19,15 +21,20 @@
|
|||||||
(~oob-header-sx
|
(~oob-header-sx
|
||||||
:parent-id "auth-header-child"
|
:parent-id "auth-header-child"
|
||||||
:row (~orders-header-row :list-url (or list-url "/")))
|
:row (~orders-header-row :list-url (or list-url "/")))
|
||||||
(~root-header :oob true)))
|
(~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||||
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
||||||
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin
|
||||||
|
:oob true)))
|
||||||
|
|
||||||
(defcomp ~orders-layout-mobile ()
|
(defcomp ~orders-layout-mobile ()
|
||||||
(~root-mobile))
|
(~root-mobile :nav-tree nav-tree :auth-menu auth-menu))
|
||||||
|
|
||||||
;; --- order-detail layout: root + auth + orders + order rows ---
|
;; --- order-detail layout: root + auth + orders + order rows ---
|
||||||
|
|
||||||
(defcomp ~order-detail-layout-full (&key list-url detail-url)
|
(defcomp ~order-detail-layout-full (&key list-url detail-url)
|
||||||
(<> (~root-header)
|
(<> (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||||
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
||||||
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin)
|
||||||
(~order-detail-header-stack
|
(~order-detail-header-stack
|
||||||
:auth (~auth-header-row :account-url account-url
|
:auth (~auth-header-row :account-url account-url
|
||||||
:select-colours select-colours
|
:select-colours select-colours
|
||||||
@@ -43,7 +50,10 @@
|
|||||||
:row (~menu-row-sx :id "order-row" :level 3 :colour "sky"
|
:row (~menu-row-sx :id "order-row" :level 3 :colour "sky"
|
||||||
:link-href (or detail-url "/") :link-label "Order"
|
:link-href (or detail-url "/") :link-label "Order"
|
||||||
:icon "fa fa-gbp" :oob true))
|
:icon "fa fa-gbp" :oob true))
|
||||||
(~root-header :oob true)))
|
(~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||||
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
||||||
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin
|
||||||
|
:oob true)))
|
||||||
|
|
||||||
(defcomp ~order-detail-layout-mobile ()
|
(defcomp ~order-detail-layout-mobile ()
|
||||||
(~root-mobile))
|
(~root-mobile :nav-tree nav-tree :auth-menu auth-menu))
|
||||||
|
|||||||
@@ -146,24 +146,40 @@
|
|||||||
(when auth-menu
|
(when auth-menu
|
||||||
(div :class "p-3 border-t border-stone-200" auth-menu))))
|
(div :class "p-3 border-t border-stone-200" auth-menu))))
|
||||||
|
|
||||||
|
;; ---------------------------------------------------------------------------
|
||||||
|
;; Root header/mobile shorthand — pass-through to shared defcomps.
|
||||||
|
;; All values must be supplied as &key args (not free variables) because
|
||||||
|
;; nested component calls in _aser are serialized without expansion.
|
||||||
|
;; ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
(defcomp ~root-header (&key cart-mini blog-url site-title app-label
|
||||||
|
nav-tree auth-menu nav-panel settings-url is-admin oob)
|
||||||
|
(~header-row-sx :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||||
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
||||||
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin
|
||||||
|
:oob oob))
|
||||||
|
|
||||||
|
(defcomp ~root-mobile (&key nav-tree auth-menu)
|
||||||
|
(~mobile-root-nav :nav-tree nav-tree :auth-menu auth-menu))
|
||||||
|
|
||||||
;; ---------------------------------------------------------------------------
|
;; ---------------------------------------------------------------------------
|
||||||
;; Built-in layout defcomps — used by register_sx_layout("root", ...)
|
;; Built-in layout defcomps — used by register_sx_layout("root", ...)
|
||||||
;; Free variables (cart-mini, blog-url, etc.) come from _ctx_to_env().
|
;; Free variables (cart-mini, blog-url, etc.) come from _ctx_to_env().
|
||||||
;; ---------------------------------------------------------------------------
|
;; ---------------------------------------------------------------------------
|
||||||
|
|
||||||
(defcomp ~layout-root-full ()
|
(defcomp ~layout-root-full ()
|
||||||
(~header-row-sx :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
(~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||||
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
||||||
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin))
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin))
|
||||||
|
|
||||||
(defcomp ~layout-root-oob ()
|
(defcomp ~layout-root-oob ()
|
||||||
(~oob-header-sx :parent-id "root-header-child"
|
(~oob-header-sx :parent-id "root-header-child"
|
||||||
:row (~header-row-sx :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
:row (~root-header :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||||
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
||||||
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin)))
|
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin)))
|
||||||
|
|
||||||
(defcomp ~layout-root-mobile ()
|
(defcomp ~layout-root-mobile ()
|
||||||
(~mobile-root-nav :nav-tree nav-tree :auth-menu auth-menu))
|
(~root-mobile :nav-tree nav-tree :auth-menu auth-menu))
|
||||||
|
|
||||||
(defcomp ~error-content (&key errnum message image)
|
(defcomp ~error-content (&key errnum message image)
|
||||||
(div :class "text-center p-8 max-w-lg mx-auto"
|
(div :class "text-center p-8 max-w-lg mx-auto"
|
||||||
|
|||||||
Reference in New Issue
Block a user