diff --git a/app.py b/app.py index 9be13bd..0c27e12 100644 --- a/app.py +++ b/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 diff --git a/templates/_types/federation/index.html b/templates/_types/federation/index.html new file mode 100644 index 0000000..e2caacb --- /dev/null +++ b/templates/_types/federation/index.html @@ -0,0 +1,3 @@ +{% extends '_types/root/_index.html' %} +{% block meta %}{% endblock %} +{% block content %}{% endblock %} diff --git a/templates/_types/social/header/_header.html b/templates/_types/social/header/_header.html new file mode 100644 index 0000000..df6aedb --- /dev/null +++ b/templates/_types/social/header/_header.html @@ -0,0 +1,52 @@ +{% import 'macros/links.html' as links %} +{% macro header_row(oob=False) %} + {% call links.menu_row(id='social-row', oob=oob) %} +
diff --git a/templates/federation/compose.html b/templates/federation/compose.html index 3fdfd05..d82a031 100644 --- a/templates/federation/compose.html +++ b/templates/federation/compose.html @@ -1,8 +1,8 @@ -{% extends "federation/base.html" %} +{% extends "_types/social/index.html" %} {% block title %}Compose — Rose Ash{% endblock %} -{% block content %} +{% block social_content %}