Fix load_service_components path for sx, market, events
The load_service_components call used dirname twice from
sxc/pages/__init__.py, yielding {service}/sxc/ instead of
{service}/. This meant {service}/sx/*.sx files (layouts, calendar
components, etc.) were never loaded into the component env.
- sx: ~sx-layout-full not found → Unknown component on client
- events: ~events-calendar-grid not found → Unknown component
- market: also fix url_for endpoint for defpage_market_admin
(mounted on app, not blueprint — no prefix needed)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -26,8 +26,9 @@ def _load_market_page_files() -> None:
|
||||
import os
|
||||
from shared.sx.pages import load_page_dir
|
||||
from shared.sx.jinja_bridge import load_service_components
|
||||
base = os.path.dirname(os.path.dirname(__file__))
|
||||
load_service_components(base, service_name="market")
|
||||
sxc_dir = os.path.dirname(os.path.dirname(__file__)) # market/sxc/
|
||||
service_root = os.path.dirname(sxc_dir) # market/
|
||||
load_service_components(service_root, service_name="market")
|
||||
load_page_dir(os.path.dirname(__file__), "market")
|
||||
|
||||
|
||||
@@ -163,7 +164,7 @@ async def _desktop_category_nav_sx(ctx: dict, categories: dict, qs: str,
|
||||
|
||||
admin_sx = ""
|
||||
if rights and rights.get("admin"):
|
||||
admin_href = prefix + url_for("market.admin.defpage_market_admin")
|
||||
admin_href = prefix + url_for("defpage_market_admin")
|
||||
admin_sx = await render_to_sx("market-admin-link", href=admin_href, hx_select=hx_select)
|
||||
|
||||
return await render_to_sx("market-desktop-category-nav",
|
||||
|
||||
Reference in New Issue
Block a user