Files
mono/events/sx/fragments.sx
giles c0d369eb8e Refactor SX templates: shared components, Python migration, cleanup
- Extract shared components (empty-state, delete-btn, sentinel, crud-*,
  view-toggle, img-or-placeholder, avatar, sumup-settings-form, auth
  forms, order tables/detail/checkout)
- Migrate all Python sx_call() callers to use shared components directly
- Remove 55+ thin wrapper defcomps from domain .sx files
- Remove trivial passthrough wrappers (blog-header-label, market-card-text, etc)
- Unify duplicate auth flows (account + federation) into shared/sx/templates/auth.sx
- Unify duplicate order views (cart + orders) into shared/sx/templates/orders.sx
- Disable static file caching in dev (SEND_FILE_MAX_AGE_DEFAULT=0)
- Add SX response validation and debug headers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 20:34:34 +00:00

71 lines
3.3 KiB
Plaintext

;; Events fragment components — served as HTML fragments for other apps.
;; container-cards entries, account page tickets, account page bookings.
;; ---------------------------------------------------------------------------
;; Container cards entries (fragments/container_cards_entries.html)
;; ---------------------------------------------------------------------------
(defcomp ~events-frag-entry-card (&key href name date-str time-str)
(a :href href
:class "flex flex-col gap-1 px-3 py-2 bg-stone-50 hover:bg-stone-100 rounded border border-stone-200 transition text-sm whitespace-nowrap flex-shrink-0 min-w-[180px]"
(div :class "font-medium text-stone-900 truncate" name)
(div :class "text-xs text-stone-600" date-str)
(div :class "text-xs text-stone-500" time-str)))
(defcomp ~events-frag-entries-widget (&key cards)
(div :class "mt-4 mb-2"
(h3 :class "text-sm font-semibold text-stone-700 mb-2 px-2" "Events:")
(div :class "overflow-x-auto scrollbar-hide" :style "scroll-behavior: smooth;"
(div :class "flex gap-2 px-2" cards))))
;; ---------------------------------------------------------------------------
;; Account page tickets (fragments/account_page_tickets.html)
;; ---------------------------------------------------------------------------
(defcomp ~events-frag-ticket-item (&key href entry-name date-str calendar-name type-name badge)
(div :class "py-4 first:pt-0 last:pb-0"
(div :class "flex items-start justify-between gap-4"
(div :class "min-w-0 flex-1"
(a :href href :class "text-sm font-medium text-stone-800 hover:text-emerald-700 transition"
entry-name)
(div :class "mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-stone-500"
(span date-str)
calendar-name
type-name))
(div :class "flex-shrink-0" badge))))
(defcomp ~events-frag-tickets-panel (&key items)
(div :class "w-full max-w-3xl mx-auto px-4 py-6"
(div :class "bg-white/70 backdrop-blur rounded-2xl shadow border border-stone-200 p-6 sm:p-8 space-y-6"
(h1 :class "text-xl font-semibold tracking-tight" "Tickets")
items)))
(defcomp ~events-frag-tickets-list (&key items)
(div :class "divide-y divide-stone-100" items))
;; ---------------------------------------------------------------------------
;; Account page bookings (fragments/account_page_bookings.html)
;; ---------------------------------------------------------------------------
(defcomp ~events-frag-booking-item (&key name date-str calendar-name cost-str badge)
(div :class "py-4 first:pt-0 last:pb-0"
(div :class "flex items-start justify-between gap-4"
(div :class "min-w-0 flex-1"
(p :class "text-sm font-medium text-stone-800" name)
(div :class "mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-stone-500"
(span date-str)
calendar-name
cost-str))
(div :class "flex-shrink-0" badge))))
(defcomp ~events-frag-bookings-panel (&key items)
(div :class "w-full max-w-3xl mx-auto px-4 py-6"
(div :class "bg-white/70 backdrop-blur rounded-2xl shadow border border-stone-200 p-6 sm:p-8 space-y-6"
(h1 :class "text-xl font-semibold tracking-tight" "Bookings")
items)))
(defcomp ~events-frag-bookings-list (&key items)
(div :class "divide-y divide-stone-100" items))