Files
rose-ash/market/sxc/pages/market.sx
giles b0920a1121 Rename all 1,169 components to path-based names with namespace support
Component names now reflect filesystem location using / as path separator
and : as namespace separator for shared components:
  ~sx-header → ~layouts/header
  ~layout-app-body → ~shared:layout/app-body
  ~blog-admin-dashboard → ~admin/dashboard

209 files, 4,941 replacements across all services.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:00:12 +00:00

75 lines
2.6 KiB
Plaintext

;; Market app defpage declarations.
;; All helpers return data dicts — markup composition in SX.
;;
;; all-markets-index: / — global view across all pages
;; page-markets-index: /<slug>/ — markets for a single page
;; page-admin: /<slug>/admin/ — post-level admin for markets
;; market-home: /<page_slug>/<market_slug>/ — market landing page
;; market-admin: /<page_slug>/<market_slug>/admin/ — market admin
(defpage all-markets-index
:path "/"
:auth :public
:layout :root
:data (all-markets-data)
:content (if no-markets
(~shared:misc/empty-state :icon "fa fa-store" :message "No markets available"
:cls "px-3 py-12 text-center text-stone-400")
(~grids/markets-grid
:cards (~cards/content
:markets market-data :page market-page
:has-more has-more :next-url next-url))))
(defpage page-markets-index
:path "/<slug>/"
:auth :public
:layout :post
:data (page-markets-data)
:content (if no-markets
(~shared:misc/empty-state :message "No markets for this page"
:cls "px-3 py-12 text-center text-stone-400")
(~grids/markets-grid
:cards (~cards/content
:markets market-data :page market-page
:has-more has-more :next-url next-url))))
(defpage page-admin
:path "/<slug>/admin/"
:auth :admin
:layout (:post-admin :selected "markets")
:data (page-admin-data)
:content (~grids/admin-content-wrap
:inner (~shared:misc/crud-panel
:list-id "markets-list"
:form (when can-create
(~shared:misc/crud-create-form
:create-url create-url :csrf csrf
:errors-id "market-create-errors" :list-id "markets-list"
:placeholder "e.g. Suma, Craft Fair" :btn-label "Add market"))
:list (if admin-markets
(<> (map (fn (m)
(~shared:misc/crud-item
:href (get m "href") :name (get m "name") :slug (get m "slug")
:del-url (get m "del-url") :csrf-hdr (get m "csrf-hdr")
:list-id "markets-list"
:confirm-title "Delete market?"
:confirm-text "Products will be hidden (soft delete)"))
admin-markets))
(~shared:misc/empty-state
:message "No markets yet. Create one above."
:cls "text-gray-500 mt-4")))))
(defpage market-home
:path "/<page_slug>/<market_slug>/"
:auth :public
:layout :market
:data (market-home-data)
:content (~cards/landing-from-data
:excerpt excerpt :feature-image feature-image :html html))
(defpage market-admin
:path "/<page_slug>/<market_slug>/admin/"
:auth :admin
:layout (:market-admin :selected "markets")
:content "market admin")