Integrate federation app with shared menu/header system
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 44s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 44s
Replace standalone base.html with the shared _types/root layout. Social pages get a second nav row via _types/social/index.html. Root / becomes a blank page with shared chrome. Auth pages use the shared layout without the social nav bar. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
17
app.py
17
app.py
@@ -20,10 +20,22 @@ from bp import (
|
||||
async def federation_context() -> dict:
|
||||
"""Federation app context processor."""
|
||||
from shared.infrastructure.context import base_context
|
||||
from shared.services.navigation import get_navigation_tree
|
||||
from shared.infrastructure.cart_identity import current_cart_identity
|
||||
|
||||
ctx = await base_context()
|
||||
|
||||
# If user is logged in, check for ActorProfile
|
||||
ctx["menu_items"] = await get_navigation_tree(g.s)
|
||||
|
||||
# Cart data (consistent with all other apps)
|
||||
ident = current_cart_identity()
|
||||
summary = await services.cart.cart_summary(
|
||||
g.s, user_id=ident["user_id"], session_id=ident["session_id"],
|
||||
)
|
||||
ctx["cart_count"] = summary.count + summary.calendar_count + summary.ticket_count
|
||||
ctx["cart_total"] = float(summary.total + summary.calendar_total + summary.ticket_total)
|
||||
|
||||
# Actor profile for logged-in users
|
||||
if g.get("user"):
|
||||
actor = await services.federation.get_actor_by_user_id(g.s, g.user.id)
|
||||
ctx["actor"] = actor
|
||||
@@ -60,8 +72,7 @@ def create_app() -> "Quart":
|
||||
@app.get("/")
|
||||
async def home():
|
||||
from quart import render_template
|
||||
stats = await services.federation.get_stats(g.s)
|
||||
return await render_template("federation/home.html", stats=stats)
|
||||
return await render_template("_types/federation/index.html")
|
||||
|
||||
return app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user