Fix events: use cart-mini fragment instead of local cart template

Events was trying to render _types/cart/_mini.html locally, which only
exists in the cart service. Replace with fetch_fragment("cart", "cart-mini")
calls and add oob param support to the cart-mini fragment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 10:22:37 +00:00
parent e1b47e5b62
commit bcac8e5adc
5 changed files with 24 additions and 49 deletions

View File

@@ -32,7 +32,8 @@ def register():
g.s, user_id=user_id, session_id=session_id,
)
count = summary.count + summary.calendar_count + summary.ticket_count
return await render_template("fragments/cart_mini.html", cart_count=count)
oob = request.args.get("oob", "")
return await render_template("fragments/cart_mini.html", cart_count=count, oob=oob)
async def _account_nav_item():
from shared.infrastructure.urls import cart_url

View File

@@ -1,4 +1,4 @@
<div id="cart-mini">
<div id="cart-mini" {% if oob %}hx-swap-oob="true"{% endif %}>
{% if cart_count == 0 %}
<div class="h-12 w-12 rounded-full overflow-hidden border border-stone-300 flex-shrink-0">
<a