Merge branch 'worktree-sx-layout-conversion' into macros
# Conflicts: # blog/sxc/pages/layouts.py # cart/sxc/pages/layouts.py # events/sxc/pages/helpers.py # events/sxc/pages/layouts.py # market/sxc/pages/layouts.py # sx/sxc/pages/layouts.py
This commit is contained in:
@@ -1,25 +1,78 @@
|
||||
;; Cart layout defcomps — fully self-contained via IO primitives.
|
||||
;; Registered via register_sx_layout in __init__.py.
|
||||
|
||||
;; --- cart-page layout: root + cart row + page-cart row ---
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Auto-fetching cart page header macros
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defcomp ~cart-page-layout-full (&key cart-row page-cart-row)
|
||||
(defmacro ~cart-page-header-auto (oob)
|
||||
"Cart page header: cart-row + page-cart-row using (cart-page-ctx)."
|
||||
(quasiquote
|
||||
(let ((__cpctx (cart-page-ctx)))
|
||||
(<>
|
||||
(~menu-row-sx :id "cart-row" :level 1 :colour "sky"
|
||||
:link-href (get __cpctx "cart-url")
|
||||
:link-label "cart" :icon "fa fa-shopping-cart"
|
||||
:child-id "cart-header-child")
|
||||
(~header-child-sx :id "cart-header-child"
|
||||
:inner (~menu-row-sx :id "page-cart-row" :level 2 :colour "sky"
|
||||
:link-href (get __cpctx "page-cart-url")
|
||||
:link-label-content (~cart-page-label
|
||||
:feature-image (get __cpctx "feature-image")
|
||||
:title (get __cpctx "title"))
|
||||
:nav (~cart-all-carts-link :href (get __cpctx "cart-url"))
|
||||
:oob (unquote oob)))))))
|
||||
|
||||
(defmacro ~cart-page-header-oob ()
|
||||
"Cart page OOB: individual oob rows."
|
||||
(quasiquote
|
||||
(let ((__cpctx (cart-page-ctx)))
|
||||
(<>
|
||||
(~menu-row-sx :id "page-cart-row" :level 2 :colour "sky"
|
||||
:link-href (get __cpctx "page-cart-url")
|
||||
:link-label-content (~cart-page-label
|
||||
:feature-image (get __cpctx "feature-image")
|
||||
:title (get __cpctx "title"))
|
||||
:nav (~cart-all-carts-link :href (get __cpctx "cart-url"))
|
||||
:oob true)
|
||||
(~menu-row-sx :id "cart-row" :level 1 :colour "sky"
|
||||
:link-href (get __cpctx "cart-url")
|
||||
:link-label "cart" :icon "fa fa-shopping-cart"
|
||||
:child-id "cart-header-child"
|
||||
:oob true)))))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; cart-page layout: root + cart row + page-cart row
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defcomp ~cart-page-layout-full ()
|
||||
(<> (~root-header-auto)
|
||||
(~header-child-sx
|
||||
:inner (<> cart-row
|
||||
(~header-child-sx :id "cart-header-child" :inner page-cart-row)))))
|
||||
:inner (~cart-page-header-auto))))
|
||||
|
||||
(defcomp ~cart-page-layout-oob (&key root-header-oob cart-row-oob page-cart-row)
|
||||
(<> (~oob-header-sx :parent-id "cart-header-child" :row page-cart-row)
|
||||
cart-row-oob
|
||||
root-header-oob))
|
||||
(defcomp ~cart-page-layout-oob ()
|
||||
(<> (~cart-page-header-oob)
|
||||
(~root-header-auto true)))
|
||||
|
||||
;; --- cart-admin layout: root + post header + admin header ---
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; cart-admin layout: root + post header + admin header
|
||||
;; Uses (post-header-ctx) — requires :data handler to populate g._defpage_ctx
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defcomp ~cart-admin-layout-full (&key post-header admin-header)
|
||||
(defcomp ~cart-admin-layout-full (&key selected)
|
||||
(<> (~root-header-auto)
|
||||
post-header admin-header))
|
||||
(~header-child-sx
|
||||
:inner (~post-header-auto nil))))
|
||||
|
||||
;; --- orders-within-cart: root + auth-simple + orders ---
|
||||
(defcomp ~cart-admin-layout-oob (&key selected)
|
||||
(<> (~post-header-auto true)
|
||||
(~oob-header-sx :parent-id "post-header-child"
|
||||
:row (~post-admin-header-auto nil selected))
|
||||
(~root-header-auto true)))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; orders-within-cart: root + auth-simple + orders
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defcomp ~cart-orders-layout-full (&key list-url)
|
||||
(<> (~root-header-auto)
|
||||
@@ -35,7 +88,9 @@
|
||||
:row (~orders-header-row :list-url list-url))
|
||||
(~root-header-auto true)))
|
||||
|
||||
;; --- order-detail-within-cart: root + auth-simple + orders + order ---
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; order-detail-within-cart: root + auth-simple + orders + order
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defcomp ~cart-order-detail-layout-full (&key list-url detail-url order-label)
|
||||
(<> (~root-header-auto)
|
||||
|
||||
Reference in New Issue
Block a user