Add cross-service URL functions and rights to base_context
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m22s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m22s
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:
@@ -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", {}),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user