Introduces a widget system where domains register UI fragments into named slots (container_nav, container_card, account_page, account_link). Host apps iterate widgets generically without naming any domain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
16 lines
447 B
Python
16 lines
447 B
Python
"""Cart-domain widgets: orders link on account page."""
|
|
from __future__ import annotations
|
|
|
|
from shared.contracts.widgets import AccountNavLink
|
|
from shared.services.widget_registry import widgets
|
|
from shared.infrastructure.urls import cart_url
|
|
|
|
|
|
def register_cart_widgets() -> None:
|
|
widgets.add_account_link(AccountNavLink(
|
|
label="orders",
|
|
order=100,
|
|
href_fn=lambda: cart_url("/orders/"),
|
|
external=True,
|
|
))
|