Restore menu_items fallback, fix app slug URLs in nav fragment
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m6s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m6s
Keep get_navigation_tree() as fallback when nav-tree fragment fetch fails. Also map all app slugs (market, events, federation, account) to their proper cross-app URLs in the nav fragment template. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
4
app.py
4
app.py
@@ -27,12 +27,16 @@ async def blog_context() -> dict:
|
||||
- cart_mini_html / auth_menu_html / nav_tree_html: pre-fetched fragments
|
||||
"""
|
||||
from shared.infrastructure.context import base_context
|
||||
from shared.services.navigation import get_navigation_tree
|
||||
from shared.services.registry import services
|
||||
from shared.infrastructure.cart_identity import current_cart_identity
|
||||
from shared.infrastructure.fragments import fetch_fragments
|
||||
|
||||
ctx = await base_context()
|
||||
|
||||
# Fallback for _nav.html when nav-tree fragment fetch fails
|
||||
ctx["menu_items"] = await get_navigation_tree(g.s)
|
||||
|
||||
# Cart data via service (replaces cross-app HTTP API)
|
||||
ident = current_cart_identity()
|
||||
summary = await services.cart.cart_summary(
|
||||
|
||||
2
shared
2
shared
Submodule shared updated: 7e650a0ee3...ab674ada31
@@ -2,7 +2,13 @@
|
||||
Uses frag_app_name / frag_first_seg instead of request.path / app_name
|
||||
so the consuming app's context is reflected correctly.
|
||||
No hx-boost — cross-app nav links are full page navigations. #}
|
||||
{% set _app_slugs = {'cart': cart_url('/')} %}
|
||||
{% set _app_slugs = {
|
||||
'cart': cart_url('/'),
|
||||
'market': market_url('/'),
|
||||
'events': events_url('/'),
|
||||
'federation': federation_url('/'),
|
||||
'account': account_url('/'),
|
||||
} %}
|
||||
<div class="flex flex-col sm:flex-row sm:items-center gap-2 border-r border-stone-200 mr-2 sm:max-w-2xl"
|
||||
id="menu-items-nav-wrapper">
|
||||
{% from 'macros/scrolling_menu.html' import scrolling_menu with context %}
|
||||
|
||||
Reference in New Issue
Block a user