Replace env free-variable threading with IO-primitive auto-fetch macros
Layout components now self-resolve context (cart-mini, auth-menu, nav-tree, rights, URLs) via new IO primitives (root-header-ctx, select-colours, account-nav-ctx, app-rights) and defmacro wrappers (~root-header-auto, ~auth-header-row-auto, ~root-mobile-auto). This eliminates _ctx_to_env(), HELPER_CSS_CLASSES, and verbose :key threading across all 10 services. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -122,8 +122,7 @@ async def _h_all_markets_content(**kw):
|
||||
next_url = prefix + url_for("all_markets.markets_fragment", page=page + 1)
|
||||
|
||||
cards = await _market_cards_sx(markets, page_info, page, has_more, next_url)
|
||||
content = await _markets_grid(cards)
|
||||
return "(<> " + content + " " + '(div :class "pb-8")' + ")"
|
||||
return await _markets_grid(cards)
|
||||
|
||||
|
||||
async def _h_page_markets_content(slug=None, **kw):
|
||||
@@ -146,15 +145,16 @@ async def _h_page_markets_content(slug=None, **kw):
|
||||
|
||||
cards = await _market_cards_sx(markets, {}, page, has_more, next_url,
|
||||
show_page_badge=False, post_slug=post_slug)
|
||||
content = await _markets_grid(cards)
|
||||
return "(<> " + content + " " + '(div :class "pb-8")' + ")"
|
||||
return await _markets_grid(cards)
|
||||
|
||||
|
||||
async def _h_page_admin_content(slug=None, **kw):
|
||||
from shared.sx.page import get_template_context
|
||||
from shared.sx.helpers import render_to_sx
|
||||
from shared.sx.parser import SxExpr
|
||||
ctx = await get_template_context()
|
||||
content = await _markets_admin_panel_sx(ctx)
|
||||
return '(div :id "main-panel" ' + content + ')'
|
||||
return await render_to_sx("market-admin-content-wrap", inner=SxExpr(content))
|
||||
|
||||
|
||||
async def _h_market_home_content(page_slug=None, market_slug=None, **kw):
|
||||
|
||||
Reference in New Issue
Block a user