Replace JSON sx-headers with SX dict expressions, fix blog like component
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m6s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m6s
sx-headers attributes now use native SX dict format {:key val} instead of
JSON strings. Eliminates manual JSON string construction in both .sx files
and Python callers.
- sx.js: parse sx-headers/sx-vals as SX dict ({: prefix) with JSON fallback,
add _serializeDict for dict→attribute serialization, fix verbInfo scope in
_doFetch error handler
- html.py: serialize dict attribute values via SX serialize() not str()
- All .sx files: {:X-CSRFToken csrf} replaces (str "{\"X-CSRFToken\": ...}")
- All Python callers: {"X-CSRFToken": csrf} dict replaces f-string JSON
- Blog like: extract ~blog-like-toggle, fix POST returning wrong component,
fix emoji escapes in .sx (parser has no \U support), fix card :hx-headers
keyword mismatch, wrap sx_content in SxExpr for evaluation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -387,7 +387,7 @@ async def _h_slots_data(calendar_slug=None, **kw) -> dict:
|
||||
csrf = generate_csrf_token()
|
||||
cal_slug = getattr(calendar, "slug", "")
|
||||
hx_select = getattr(g, "hx_select_search", "#main-panel")
|
||||
csrf_hdr = f'{{"X-CSRFToken": "{csrf}"}}'
|
||||
csrf_hdr = {"X-CSRFToken": csrf}
|
||||
add_url = url_for("calendar.slots.add_form", calendar_slug=cal_slug)
|
||||
|
||||
slots_list = []
|
||||
@@ -624,7 +624,7 @@ async def _h_ticket_types_data(calendar_slug=None, entry_id=None,
|
||||
cal_slug = getattr(calendar, "slug", "")
|
||||
hx_select = getattr(g, "hx_select_search", "#main-panel")
|
||||
eid = entry.id if entry else 0
|
||||
csrf_hdr = f'{{"X-CSRFToken": "{csrf}"}}'
|
||||
csrf_hdr = {"X-CSRFToken": csrf}
|
||||
|
||||
types_list = []
|
||||
for tt in (ticket_types or []):
|
||||
@@ -964,7 +964,7 @@ async def _h_markets_data(**kw) -> dict:
|
||||
|
||||
post = ctx.get("post") or {}
|
||||
slug = post.get("slug", "")
|
||||
csrf_hdr = f'{{"X-CSRFToken":"{csrf}"}}'
|
||||
csrf_hdr = {"X-CSRFToken": csrf}
|
||||
|
||||
markets_list = []
|
||||
for m in markets_raw:
|
||||
|
||||
Reference in New Issue
Block a user