Files
mono/federation/sexp/profile.sexpr
giles f9d9697c67 Externalize sexp to .sexpr files + render() API
Replace all 676 inline sexp() string calls across 7 services with
render(component_name, **kwargs) calls backed by 46 external .sexpr
component definition files (587 defcomps total).

- Add render() function to shared/sexp/jinja_bridge.py
- Add load_service_components() helper and update load_sexp_dir() for *.sexpr
- Update parser keyword regex to support HTMX hx-on::event syntax
- Convert remaining inline HTML in route files to render() calls
- Add shared/sexp/templates/misc.sexp for cross-service utility components

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 16:14:58 +00:00

56 lines
2.2 KiB
Plaintext

;; Profile and actor timeline components
(defcomp ~federation-actor-profile-header (&key avatar-html display-name username domain summary-html follow-html)
(div :class "bg-white rounded-lg shadow-sm border border-stone-200 p-6 mb-6"
(div :class "flex items-center gap-4"
(raw! avatar-html)
(div :class "flex-1"
(h1 :class "text-xl font-bold" (raw! display-name))
(div :class "text-stone-500" "@" (raw! username) "@" (raw! domain))
(raw! summary-html))
(raw! follow-html))))
(defcomp ~federation-actor-timeline-layout (&key header-html timeline-html)
(raw! header-html)
(div :id "timeline" (raw! timeline-html)))
(defcomp ~federation-follow-form (&key action csrf actor-url label cls)
(div :class "flex-shrink-0"
(form :method "post" :action action
(input :type "hidden" :name "csrf_token" :value csrf)
(input :type "hidden" :name "actor_url" :value actor-url)
(button :type "submit" :class cls (raw! label)))))
(defcomp ~federation-profile-summary (&key summary)
(div :class "text-sm text-stone-600 mt-2" (raw! summary)))
;; Public profile page
(defcomp ~federation-activity-obj-type (&key obj-type)
(span :class "text-sm text-stone-500" (raw! obj-type)))
(defcomp ~federation-activity-card (&key activity-type published obj-type-html)
(div :class "bg-white rounded-lg shadow p-4"
(div :class "flex justify-between items-start"
(span :class "font-medium" (raw! activity-type))
(span :class "text-sm text-stone-400" (raw! published)))
(raw! obj-type-html)))
(defcomp ~federation-activities-list (&key items-html)
(div :class "space-y-4" (raw! items-html)))
(defcomp ~federation-activities-empty ()
(p :class "text-stone-500" "No activities yet."))
(defcomp ~federation-profile-page (&key display-name username domain summary-html activities-heading activities-html)
(div :class "py-8"
(div :class "bg-white rounded-lg shadow p-6 mb-6"
(h1 :class "text-2xl font-bold" (raw! display-name))
(p :class "text-stone-500" "@" (raw! username) "@" (raw! domain))
(raw! summary-html))
(h2 :class "text-xl font-bold mb-4" (raw! activities-heading))
(raw! activities-html)))
(defcomp ~federation-profile-summary-text (&key text)
(p :class "mt-2" (raw! text)))