Fix nested raw! sexp errors and missing container nav in market pages
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m6s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m6s
- Fix invalid nested (raw! a (raw! b)) patterns in market and events sexp_components — concatenate HTML strings in Python, pass single var to (raw! h) instead - Add container_nav_html fetch to market inject_post context processor so page-scoped market pages show calendar/market nav links - Add qs_filter to base_context for sexp filter URL building Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1647,12 +1647,8 @@ async def render_calendars_page(ctx: dict) -> str:
|
|||||||
"""Full page: calendars listing."""
|
"""Full page: calendars listing."""
|
||||||
content = _calendars_main_panel_html(ctx)
|
content = _calendars_main_panel_html(ctx)
|
||||||
hdr = root_header_html(ctx)
|
hdr = root_header_html(ctx)
|
||||||
hdr += sexp(
|
child = _post_header_html(ctx) + _post_admin_header_html(ctx) + _calendars_header_html(ctx)
|
||||||
'(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! ch))))',
|
hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child)
|
||||||
ph=_post_header_html(ctx),
|
|
||||||
pah=_post_admin_header_html(ctx),
|
|
||||||
ch=_calendars_header_html(ctx),
|
|
||||||
)
|
|
||||||
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
||||||
|
|
||||||
|
|
||||||
@@ -1673,12 +1669,8 @@ async def render_calendar_page(ctx: dict) -> str:
|
|||||||
"""Full page: calendar month view."""
|
"""Full page: calendar month view."""
|
||||||
content = _calendar_main_panel_html(ctx)
|
content = _calendar_main_panel_html(ctx)
|
||||||
hdr = root_header_html(ctx)
|
hdr = root_header_html(ctx)
|
||||||
hdr += sexp(
|
child = _post_header_html(ctx) + _post_admin_header_html(ctx) + _calendar_header_html(ctx)
|
||||||
'(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! ch))))',
|
hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child)
|
||||||
ph=_post_header_html(ctx),
|
|
||||||
pah=_post_admin_header_html(ctx),
|
|
||||||
ch=_calendar_header_html(ctx),
|
|
||||||
)
|
|
||||||
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
||||||
|
|
||||||
|
|
||||||
@@ -1699,13 +1691,9 @@ async def render_day_page(ctx: dict) -> str:
|
|||||||
"""Full page: day detail."""
|
"""Full page: day detail."""
|
||||||
content = _day_main_panel_html(ctx)
|
content = _day_main_panel_html(ctx)
|
||||||
hdr = root_header_html(ctx)
|
hdr = root_header_html(ctx)
|
||||||
hdr += sexp(
|
child = (_post_header_html(ctx) + _post_admin_header_html(ctx)
|
||||||
'(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! ch (raw! dh)))))',
|
+ _calendar_header_html(ctx) + _day_header_html(ctx))
|
||||||
ph=_post_header_html(ctx),
|
hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child)
|
||||||
pah=_post_admin_header_html(ctx),
|
|
||||||
ch=_calendar_header_html(ctx),
|
|
||||||
dh=_day_header_html(ctx),
|
|
||||||
)
|
|
||||||
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
||||||
|
|
||||||
|
|
||||||
@@ -1726,14 +1714,10 @@ async def render_day_admin_page(ctx: dict) -> str:
|
|||||||
"""Full page: day admin."""
|
"""Full page: day admin."""
|
||||||
content = _day_admin_main_panel_html(ctx)
|
content = _day_admin_main_panel_html(ctx)
|
||||||
hdr = root_header_html(ctx)
|
hdr = root_header_html(ctx)
|
||||||
hdr += sexp(
|
child = (_post_header_html(ctx) + _post_admin_header_html(ctx)
|
||||||
'(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! ch (raw! dh (raw! dah))))))',
|
+ _calendar_header_html(ctx) + _day_header_html(ctx)
|
||||||
ph=_post_header_html(ctx),
|
+ _day_admin_header_html(ctx))
|
||||||
pah=_post_admin_header_html(ctx),
|
hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child)
|
||||||
ch=_calendar_header_html(ctx),
|
|
||||||
dh=_day_header_html(ctx),
|
|
||||||
dah=_day_admin_header_html(ctx),
|
|
||||||
)
|
|
||||||
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
||||||
|
|
||||||
|
|
||||||
@@ -1754,13 +1738,9 @@ async def render_calendar_admin_page(ctx: dict) -> str:
|
|||||||
"""Full page: calendar admin."""
|
"""Full page: calendar admin."""
|
||||||
content = _calendar_admin_main_panel_html(ctx)
|
content = _calendar_admin_main_panel_html(ctx)
|
||||||
hdr = root_header_html(ctx)
|
hdr = root_header_html(ctx)
|
||||||
hdr += sexp(
|
child = (_post_header_html(ctx) + _post_admin_header_html(ctx)
|
||||||
'(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! ch (raw! cah)))))',
|
+ _calendar_header_html(ctx) + _calendar_admin_header_html(ctx))
|
||||||
ph=_post_header_html(ctx),
|
hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child)
|
||||||
pah=_post_admin_header_html(ctx),
|
|
||||||
ch=_calendar_header_html(ctx),
|
|
||||||
cah=_calendar_admin_header_html(ctx),
|
|
||||||
)
|
|
||||||
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
||||||
|
|
||||||
|
|
||||||
@@ -1828,12 +1808,8 @@ async def render_markets_page(ctx: dict) -> str:
|
|||||||
"""Full page: markets listing."""
|
"""Full page: markets listing."""
|
||||||
content = _markets_main_panel_html(ctx)
|
content = _markets_main_panel_html(ctx)
|
||||||
hdr = root_header_html(ctx)
|
hdr = root_header_html(ctx)
|
||||||
hdr += sexp(
|
child = _post_header_html(ctx) + _post_admin_header_html(ctx) + _markets_header_html(ctx)
|
||||||
'(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! mh))))',
|
hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child)
|
||||||
ph=_post_header_html(ctx),
|
|
||||||
pah=_post_admin_header_html(ctx),
|
|
||||||
mh=_markets_header_html(ctx),
|
|
||||||
)
|
|
||||||
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
||||||
|
|
||||||
|
|
||||||
@@ -1854,12 +1830,8 @@ async def render_payments_page(ctx: dict) -> str:
|
|||||||
"""Full page: payments admin."""
|
"""Full page: payments admin."""
|
||||||
content = _payments_main_panel_html(ctx)
|
content = _payments_main_panel_html(ctx)
|
||||||
hdr = root_header_html(ctx)
|
hdr = root_header_html(ctx)
|
||||||
hdr += sexp(
|
child = _post_header_html(ctx) + _post_admin_header_html(ctx) + _payments_header_html(ctx)
|
||||||
'(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! pyh))))',
|
hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child)
|
||||||
ph=_post_header_html(ctx),
|
|
||||||
pah=_post_admin_header_html(ctx),
|
|
||||||
pyh=_payments_header_html(ctx),
|
|
||||||
)
|
|
||||||
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,24 @@ def create_app() -> "Quart":
|
|||||||
post_data = getattr(g, "post_data", None)
|
post_data = getattr(g, "post_data", None)
|
||||||
if not post_data:
|
if not post_data:
|
||||||
return {}
|
return {}
|
||||||
return {**post_data}
|
ctx = {**post_data}
|
||||||
|
# Fetch container nav fragments (calendar + market links for this page)
|
||||||
|
post_dict = post_data.get("post") or {}
|
||||||
|
db_post_id = post_dict.get("id")
|
||||||
|
post_slug = post_dict.get("slug", "")
|
||||||
|
if db_post_id:
|
||||||
|
from shared.infrastructure.fragments import fetch_fragments
|
||||||
|
nav_params = {
|
||||||
|
"container_type": "page",
|
||||||
|
"container_id": str(db_post_id),
|
||||||
|
"post_slug": post_slug,
|
||||||
|
}
|
||||||
|
events_nav, market_nav = await fetch_fragments([
|
||||||
|
("events", "container-nav", nav_params),
|
||||||
|
("market", "container-nav", nav_params),
|
||||||
|
], required=False)
|
||||||
|
ctx["container_nav_html"] = events_nav + market_nav
|
||||||
|
return ctx
|
||||||
|
|
||||||
# --- oEmbed endpoint ---
|
# --- oEmbed endpoint ---
|
||||||
@app.get("/oembed")
|
@app.get("/oembed")
|
||||||
|
|||||||
@@ -1387,10 +1387,10 @@ async def render_market_home_page(ctx: dict) -> str:
|
|||||||
content = _market_landing_content(post)
|
content = _market_landing_content(post)
|
||||||
|
|
||||||
hdr = root_header_html(ctx)
|
hdr = root_header_html(ctx)
|
||||||
|
child = _post_header_html(ctx) + _market_header_html(ctx)
|
||||||
hdr += sexp(
|
hdr += sexp(
|
||||||
'(div :id "root-header-child" :class "w-full" (raw! ph (raw! mh)))',
|
'(div :id "root-header-child" :class "w-full" (raw! h))',
|
||||||
ph=_post_header_html(ctx),
|
h=child,
|
||||||
mh=_market_header_html(ctx),
|
|
||||||
)
|
)
|
||||||
menu = _mobile_nav_panel_html(ctx)
|
menu = _mobile_nav_panel_html(ctx)
|
||||||
return full_page(ctx, header_rows_html=hdr, content_html=content, menu_html=menu)
|
return full_page(ctx, header_rows_html=hdr, content_html=content, menu_html=menu)
|
||||||
@@ -1434,10 +1434,10 @@ async def render_browse_page(ctx: dict) -> str:
|
|||||||
content = f'<div class="grid grid-cols-1 sm:grid-cols-3 md:grid-cols-6 gap-3">{cards_html}</div><div class="pb-8"></div>'
|
content = f'<div class="grid grid-cols-1 sm:grid-cols-3 md:grid-cols-6 gap-3">{cards_html}</div><div class="pb-8"></div>'
|
||||||
|
|
||||||
hdr = root_header_html(ctx)
|
hdr = root_header_html(ctx)
|
||||||
|
child = _post_header_html(ctx) + _market_header_html(ctx)
|
||||||
hdr += sexp(
|
hdr += sexp(
|
||||||
'(div :id "root-header-child" :class "w-full" (raw! ph (raw! mh)))',
|
'(div :id "root-header-child" :class "w-full" (raw! h))',
|
||||||
ph=_post_header_html(ctx),
|
h=child,
|
||||||
mh=_market_header_html(ctx),
|
|
||||||
)
|
)
|
||||||
menu = _mobile_nav_panel_html(ctx)
|
menu = _mobile_nav_panel_html(ctx)
|
||||||
filter_html = _mobile_filter_summary_html(ctx)
|
filter_html = _mobile_filter_summary_html(ctx)
|
||||||
@@ -1478,11 +1478,10 @@ async def render_product_page(ctx: dict, d: dict) -> str:
|
|||||||
meta = _product_meta_html(d, ctx)
|
meta = _product_meta_html(d, ctx)
|
||||||
|
|
||||||
hdr = root_header_html(ctx)
|
hdr = root_header_html(ctx)
|
||||||
|
child = _post_header_html(ctx) + _market_header_html(ctx) + _product_header_html(ctx, d)
|
||||||
hdr += sexp(
|
hdr += sexp(
|
||||||
'(div :id "root-header-child" :class "w-full" (raw! ph (raw! mh (raw! prh))))',
|
'(div :id "root-header-child" :class "w-full" (raw! h))',
|
||||||
ph=_post_header_html(ctx),
|
h=child,
|
||||||
mh=_market_header_html(ctx),
|
|
||||||
prh=_product_header_html(ctx, d),
|
|
||||||
)
|
)
|
||||||
return full_page(ctx, header_rows_html=hdr, content_html=content, meta_html=meta)
|
return full_page(ctx, header_rows_html=hdr, content_html=content, meta_html=meta)
|
||||||
|
|
||||||
@@ -1507,12 +1506,11 @@ async def render_product_admin_page(ctx: dict, d: dict) -> str:
|
|||||||
content = _product_detail_html(d, ctx)
|
content = _product_detail_html(d, ctx)
|
||||||
|
|
||||||
hdr = root_header_html(ctx)
|
hdr = root_header_html(ctx)
|
||||||
|
child = (_post_header_html(ctx) + _market_header_html(ctx)
|
||||||
|
+ _product_header_html(ctx, d) + _product_admin_header_html(ctx, d))
|
||||||
hdr += sexp(
|
hdr += sexp(
|
||||||
'(div :id "root-header-child" :class "w-full" (raw! ph (raw! mh (raw! prh (raw! pah)))))',
|
'(div :id "root-header-child" :class "w-full" (raw! h))',
|
||||||
ph=_post_header_html(ctx),
|
h=child,
|
||||||
mh=_market_header_html(ctx),
|
|
||||||
prh=_product_header_html(ctx, d),
|
|
||||||
pah=_product_admin_header_html(ctx, d),
|
|
||||||
)
|
)
|
||||||
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
||||||
|
|
||||||
@@ -1551,11 +1549,10 @@ async def render_market_admin_page(ctx: dict) -> str:
|
|||||||
content = "market admin"
|
content = "market admin"
|
||||||
|
|
||||||
hdr = root_header_html(ctx)
|
hdr = root_header_html(ctx)
|
||||||
|
child = _post_header_html(ctx) + _market_header_html(ctx) + _market_admin_header_html(ctx)
|
||||||
hdr += sexp(
|
hdr += sexp(
|
||||||
'(div :id "root-header-child" :class "w-full" (raw! ph (raw! mh (raw! mah))))',
|
'(div :id "root-header-child" :class "w-full" (raw! h))',
|
||||||
ph=_post_header_html(ctx),
|
h=child,
|
||||||
mh=_market_header_html(ctx),
|
|
||||||
mah=_market_admin_header_html(ctx),
|
|
||||||
)
|
)
|
||||||
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
return full_page(ctx, header_rows_html=hdr, content_html=content)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user