diff --git a/events/sexp_components.py b/events/sexp_components.py index 9a0105c..0f45ef7 100644 --- a/events/sexp_components.py +++ b/events/sexp_components.py @@ -1647,12 +1647,8 @@ async def render_calendars_page(ctx: dict) -> str: """Full page: calendars listing.""" content = _calendars_main_panel_html(ctx) hdr = root_header_html(ctx) - hdr += sexp( - '(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! ch))))', - ph=_post_header_html(ctx), - pah=_post_admin_header_html(ctx), - ch=_calendars_header_html(ctx), - ) + child = _post_header_html(ctx) + _post_admin_header_html(ctx) + _calendars_header_html(ctx) + hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child) 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.""" content = _calendar_main_panel_html(ctx) hdr = root_header_html(ctx) - hdr += sexp( - '(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! ch))))', - ph=_post_header_html(ctx), - pah=_post_admin_header_html(ctx), - ch=_calendar_header_html(ctx), - ) + child = _post_header_html(ctx) + _post_admin_header_html(ctx) + _calendar_header_html(ctx) + hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child) 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.""" content = _day_main_panel_html(ctx) hdr = root_header_html(ctx) - hdr += sexp( - '(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! ch (raw! dh)))))', - ph=_post_header_html(ctx), - pah=_post_admin_header_html(ctx), - ch=_calendar_header_html(ctx), - dh=_day_header_html(ctx), - ) + child = (_post_header_html(ctx) + _post_admin_header_html(ctx) + + _calendar_header_html(ctx) + _day_header_html(ctx)) + hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child) 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.""" content = _day_admin_main_panel_html(ctx) hdr = root_header_html(ctx) - hdr += sexp( - '(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! ch (raw! dh (raw! dah))))))', - ph=_post_header_html(ctx), - pah=_post_admin_header_html(ctx), - ch=_calendar_header_html(ctx), - dh=_day_header_html(ctx), - dah=_day_admin_header_html(ctx), - ) + child = (_post_header_html(ctx) + _post_admin_header_html(ctx) + + _calendar_header_html(ctx) + _day_header_html(ctx) + + _day_admin_header_html(ctx)) + hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child) 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.""" content = _calendar_admin_main_panel_html(ctx) hdr = root_header_html(ctx) - hdr += sexp( - '(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! ch (raw! cah)))))', - ph=_post_header_html(ctx), - pah=_post_admin_header_html(ctx), - ch=_calendar_header_html(ctx), - cah=_calendar_admin_header_html(ctx), - ) + child = (_post_header_html(ctx) + _post_admin_header_html(ctx) + + _calendar_header_html(ctx) + _calendar_admin_header_html(ctx)) + hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child) 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.""" content = _markets_main_panel_html(ctx) hdr = root_header_html(ctx) - hdr += sexp( - '(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! mh))))', - ph=_post_header_html(ctx), - pah=_post_admin_header_html(ctx), - mh=_markets_header_html(ctx), - ) + child = _post_header_html(ctx) + _post_admin_header_html(ctx) + _markets_header_html(ctx) + hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child) 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.""" content = _payments_main_panel_html(ctx) hdr = root_header_html(ctx) - hdr += sexp( - '(div :id "root-header-child" :class "w-full" (raw! ph (raw! pah (raw! pyh))))', - ph=_post_header_html(ctx), - pah=_post_admin_header_html(ctx), - pyh=_payments_header_html(ctx), - ) + child = _post_header_html(ctx) + _post_admin_header_html(ctx) + _payments_header_html(ctx) + hdr += sexp('(div :id "root-header-child" :class "w-full" (raw! h))', h=child) return full_page(ctx, header_rows_html=hdr, content_html=content) diff --git a/market/app.py b/market/app.py index e318c04..a83104e 100644 --- a/market/app.py +++ b/market/app.py @@ -199,7 +199,24 @@ def create_app() -> "Quart": post_data = getattr(g, "post_data", None) if not post_data: 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 --- @app.get("/oembed") diff --git a/market/sexp_components.py b/market/sexp_components.py index 242a309..f0f90e7 100644 --- a/market/sexp_components.py +++ b/market/sexp_components.py @@ -1387,10 +1387,10 @@ async def render_market_home_page(ctx: dict) -> str: content = _market_landing_content(post) hdr = root_header_html(ctx) + child = _post_header_html(ctx) + _market_header_html(ctx) hdr += sexp( - '(div :id "root-header-child" :class "w-full" (raw! ph (raw! mh)))', - ph=_post_header_html(ctx), - mh=_market_header_html(ctx), + '(div :id "root-header-child" :class "w-full" (raw! h))', + h=child, ) menu = _mobile_nav_panel_html(ctx) 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'
{cards_html}
' hdr = root_header_html(ctx) + child = _post_header_html(ctx) + _market_header_html(ctx) hdr += sexp( - '(div :id "root-header-child" :class "w-full" (raw! ph (raw! mh)))', - ph=_post_header_html(ctx), - mh=_market_header_html(ctx), + '(div :id "root-header-child" :class "w-full" (raw! h))', + h=child, ) menu = _mobile_nav_panel_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) hdr = root_header_html(ctx) + child = _post_header_html(ctx) + _market_header_html(ctx) + _product_header_html(ctx, d) hdr += sexp( - '(div :id "root-header-child" :class "w-full" (raw! ph (raw! mh (raw! prh))))', - ph=_post_header_html(ctx), - mh=_market_header_html(ctx), - prh=_product_header_html(ctx, d), + '(div :id "root-header-child" :class "w-full" (raw! h))', + h=child, ) 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) 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( - '(div :id "root-header-child" :class "w-full" (raw! ph (raw! mh (raw! prh (raw! pah)))))', - ph=_post_header_html(ctx), - mh=_market_header_html(ctx), - prh=_product_header_html(ctx, d), - pah=_product_admin_header_html(ctx, d), + '(div :id "root-header-child" :class "w-full" (raw! h))', + h=child, ) 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" hdr = root_header_html(ctx) + child = _post_header_html(ctx) + _market_header_html(ctx) + _market_admin_header_html(ctx) hdr += sexp( - '(div :id "root-header-child" :class "w-full" (raw! ph (raw! mh (raw! mah))))', - ph=_post_header_html(ctx), - mh=_market_header_html(ctx), - mah=_market_admin_header_html(ctx), + '(div :id "root-header-child" :class "w-full" (raw! h))', + h=child, ) return full_page(ctx, header_rows_html=hdr, content_html=content)