Replace container nav/card widgets with fragment composition (Phase 4)

Templates now consume container_nav_html and card_widgets_html from
fragment fetches instead of iterating widgets.container_nav / container_cards.
OOB nav template renders entry/calendar links directly from data.
Calendar and market widget registrations removed (account widgets remain).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-24 13:32:48 +00:00
parent ab674ada31
commit d2e07e047e
7 changed files with 127 additions and 95 deletions

View File

@@ -1,24 +1,10 @@
"""Market-domain widgets: marketplace links on container pages."""
"""Market-domain widgets.
Container nav widgets have been replaced by fragments
(market app serves them at /internal/fragments/).
"""
from __future__ import annotations
from shared.contracts.widgets import NavWidget
from shared.services.widget_registry import widgets
from shared.services.registry import services
async def _nav_markets_context(
session, *, container_type, container_id, post_slug, **kw,
):
markets = await services.market.marketplaces_for_container(
session, container_type, container_id,
)
return {"markets": markets, "post_slug": post_slug}
def register_market_widgets() -> None:
widgets.add_container_nav(NavWidget(
domain="market",
order=30,
context_fn=_nav_markets_context,
template="_widgets/container_nav/market_links.html",
))
pass