Externalize sexp component templates and delete redundant HTML fragments

Move 24 defcomp definitions from Python string constants in components.py
to 7 grouped .sexp files under shared/sexp/templates/. Add load_sexp_dir()
to jinja_bridge.py for file-based loading. Migrate events and market
link-card fragment handlers from render_template to sexp. Delete 9
superseded Jinja HTML fragment templates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 08:55:54 +00:00
parent 9c6170ed31
commit 53c4a0a1e0
20 changed files with 506 additions and 1029 deletions

View File

@@ -1,18 +0,0 @@
<a href="{{ link }}" class="block rounded border border-stone-200 bg-white hover:bg-stone-50 transition-colors no-underline" data-fragment="link-card" data-app="federation" data-hx-disable>
<div class="flex flex-row items-center gap-3 p-3">
{% if avatar_url %}
<img src="{{ avatar_url }}" alt="" class="flex-shrink-0 w-12 h-12 rounded-full object-cover">
{% else %}
<div class="flex-shrink-0 w-12 h-12 rounded-full bg-stone-100 flex items-center justify-center text-stone-400">
<i class="fas fa-user text-lg"></i>
</div>
{% endif %}
<div class="flex-1 min-w-0">
<div class="font-medium text-stone-900 text-sm">{{ display_name or username }}</div>
<div class="text-xs text-stone-500">@{{ username }}</div>
{% if summary %}
<div class="text-xs text-stone-500 mt-1 clamp-2">{{ summary }}</div>
{% endif %}
</div>
</div>
</a>