Add cross-service URL functions and rights to base_context

blog_url, market_url, cart_url, events_url and g.rights were only
available as Jinja globals, not in the ctx dict passed to sexp
helper functions. This caused all cross-service links in the header
system (post title, cart badge, admin cog, admin nav items) to
produce relative URLs resolving to the current service domain.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 23:19:42 +00:00
parent 8e4c2c139e
commit bc7a4a5128

View File

@@ -14,6 +14,7 @@ from quart import request, g, current_app
from shared.config import config
from shared.utils import host_url
from shared.browser.app.utils import current_route_relative_path
from shared.infrastructure.urls import blog_url, market_url, cart_url, events_url
def _qs_filter_fn():
@@ -102,4 +103,9 @@ async def base_context() -> dict:
"base_title": config()["title"],
"hx_select": hx_select,
"hx_select_search": hx_select_search,
"blog_url": blog_url,
"market_url": market_url,
"cart_url": cart_url,
"events_url": events_url,
"rights": getattr(g, "rights", {}),
}