Phase 1: Wire 16 events routes to existing sx render functions - slot, slots, ticket_types, ticket_type, calendar_entries, calendar_entry, calendar_entry/admin Phase 2: Orders checkout return (2 calls) - New orders/sx/checkout.sx with return page components - New render_checkout_return_page() in orders/sx/sx_components.py Phase 3: Blog menu items (3 calls) - New blog/sx/menu_items.sx with search result components - New render_menu_item_form() and render_page_search_results() in blog/sx/sx_components.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
55 lines
2.9 KiB
Plaintext
55 lines
2.9 KiB
Plaintext
;; Checkout return page components
|
|
|
|
(defcomp ~checkout-return-header (&key status)
|
|
(header :class "mb-1 sm:mb-2 flex flex-col sm:flex-row sm:items-center justify-between gap-3 sm:gap-4"
|
|
(div :class "space-y-1"
|
|
(h1 :class "text-xl sm:text-2xl md:text-3xl font-semibold tracking-tight"
|
|
(cond
|
|
((= status "paid") "Payment received")
|
|
((= status "failed") "Payment failed")
|
|
((= status "missing") "Order not found")
|
|
(t (str "Payment status: " (capitalize status)))))
|
|
(p :class "text-xs sm:text-sm text-stone-600"
|
|
(cond
|
|
((= status "paid") "Thanks for your order.")
|
|
((= status "failed") "Something went wrong while processing your payment. You can try again below.")
|
|
((= status "missing") "We couldn\u2019t find that order \u2013 it may have expired or never been created.")
|
|
(t "We\u2019re still waiting for a final confirmation from SumUp."))))))
|
|
|
|
(defcomp ~checkout-return-missing ()
|
|
(div :class "max-w-full px-1 py-1"
|
|
(div :class "rounded-2xl border border-dashed border-rose-300 bg-rose-50/80 p-4 sm:p-6 text-sm text-rose-800"
|
|
"We couldn\u2019t find that order. If you reached this page from an old link, please start a new order.")))
|
|
|
|
(defcomp ~checkout-return-failed (&key order-id)
|
|
(div :class "rounded-2xl border border-rose-200 bg-rose-50/80 p-4 sm:p-6 text-sm text-rose-900 space-y-2"
|
|
(p :class "font-medium" "Your payment was not completed.")
|
|
(p "You can go back to your cart and try checkout again. If the problem persists, please contact us and mention order "
|
|
(span :class "font-mono" (str "#" order-id)) ".")))
|
|
|
|
(defcomp ~checkout-return-paid ()
|
|
(div :class "rounded-2xl border border-emerald-200 bg-emerald-50/80 p-4 sm:p-6 text-sm text-emerald-900 space-y-2"
|
|
(p :class "font-medium" "All done!")
|
|
(p "We\u2019ll start processing your order shortly.")))
|
|
|
|
(defcomp ~checkout-return-ticket (&key name pill state type-name date-str code price)
|
|
(li :class "px-4 py-3 flex items-start justify-between text-sm"
|
|
(div
|
|
(div :class "font-medium flex items-center gap-2"
|
|
name (span :class pill state))
|
|
(when type-name (div :class "text-xs text-stone-500" type-name))
|
|
(div :class "text-xs text-stone-500" date-str)
|
|
(div :class "text-xs text-stone-400 font-mono mt-0.5" code))
|
|
(div :class "ml-4 font-medium" price)))
|
|
|
|
(defcomp ~checkout-return-tickets (&key items)
|
|
(section :class "mt-6 space-y-3"
|
|
(h2 :class "text-base sm:text-lg font-semibold" "Event tickets in this order")
|
|
(ul :class "divide-y divide-stone-200 rounded-2xl border border-stone-200 bg-white/80" items)))
|
|
|
|
(defcomp ~checkout-return-content (&key summary items calendar tickets status-message)
|
|
(div :class "max-w-full px-1 py-1"
|
|
(when summary
|
|
(div :class "rounded-2xl border border-stone-200 bg-white/80 p-4 sm:p-6 space-y-2" summary))
|
|
items calendar tickets status-message))
|