shop: /orders view on market.rose-ash.com (ticket orders per event)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 07:17:41 +00:00
parent f28f960481
commit 12b4e15569

View File

@@ -3045,6 +3045,23 @@
(host/blog-relate! oid "order" "is-a") (host/blog-relate! oid "order" "is-a")
(host/blog-relate! oid event "for") (host/blog-relate! oid event "for")
(dream-response 200 {:content-type "text/plain; charset=utf-8"} (str "order:" oid))))))) (dream-response 200 {:content-type "text/plain; charset=utf-8"} (str "order:" oid)))))))
;; ── /orders — the shop domain view: ticket orders placed for events (federated from events) ──
(define host/blog-orders
(fn (req)
(host/blog--resp req 200
(host/blog--page req "Orders"
(quasiquote
(div (h1 "🛒 Orders (shop)")
(p "Ticket orders placed for events.")
(unquote
(let ((orders (host/blog-in "order" "is-a")))
(if (= (len orders) 0) (quote (p :style "color:#999" (em "No orders yet.")))
(cons (quote ul)
(map (fn (o)
(let ((ev (host/blog--out-raw o "for")))
(quasiquote (li (b (unquote (str o)))
(unquote (if (> (len ev) 0) (str " — for event: " (first ev)) ""))))))
orders)))))))))))
;; ── /calendars — the events domain view: allocated posts + scheduled events + a create form ── ;; ── /calendars — the events domain view: allocated posts + scheduled events + a create form ──
(define host/blog-calendars (define host/blog-calendars
(fn (req) (fn (req)
@@ -3124,6 +3141,7 @@
(dream-get "/flows" host/blog-flows) (dream-get "/flows" host/blog-flows)
(dream-get "/fed-tick" host/blog-fed-tick) (dream-get "/fed-tick" host/blog-fed-tick)
(dream-get "/calendars" host/blog-calendars) (dream-get "/calendars" host/blog-calendars)
(dream-get "/orders" host/blog-orders)
(dream-post "/new-event" host/blog-new-event) (dream-post "/new-event" host/blog-new-event)
(dream-post "/buy" host/blog-buy) (dream-post "/buy" host/blog-buy)
(dream-post "/order" host/blog-order) (dream-post "/order" host/blog-order)