From 5b63d9fb9310c60b9441c6507aa3774a06c03684 Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 24 Feb 2026 17:17:35 +0000 Subject: [PATCH] Add cross-domain template copies for shared macro dependencies - browse/desktop+mobile filter search (market domain, used by shared layout.html filter_summary) - cart/_mini.html (cart domain, used by shared _oob.html for OOB header swaps) Co-Authored-By: Claude Opus 4.6 --- .../_types/browse/desktop/_filter/search.html | 44 ++++++++++++++++++ .../_types/browse/mobile/_filter/search.html | 40 +++++++++++++++++ templates/_types/cart/_mini.html | 45 +++++++++++++++++++ 3 files changed, 129 insertions(+) create mode 100644 templates/_types/browse/desktop/_filter/search.html create mode 100644 templates/_types/browse/mobile/_filter/search.html create mode 100644 templates/_types/cart/_mini.html diff --git a/templates/_types/browse/desktop/_filter/search.html b/templates/_types/browse/desktop/_filter/search.html new file mode 100644 index 0000000..2e0ea8e --- /dev/null +++ b/templates/_types/browse/desktop/_filter/search.html @@ -0,0 +1,44 @@ + +{% macro search(current_local_href,search, search_count, hx_select) -%} + + +
+ + +
+ {% if search %} + {{search_count}} + {% endif %} + {{zap_filter}} +
+
+{% endmacro %} \ No newline at end of file diff --git a/templates/_types/browse/mobile/_filter/search.html b/templates/_types/browse/mobile/_filter/search.html new file mode 100644 index 0000000..0f39178 --- /dev/null +++ b/templates/_types/browse/mobile/_filter/search.html @@ -0,0 +1,40 @@ +{% macro search(current_local_href, search, search_count, hx_select) -%} + +
+ + +
+ {% if search %} + {{search_count}} + {% endif %} +
+
+{% endmacro %} \ No newline at end of file diff --git a/templates/_types/cart/_mini.html b/templates/_types/cart/_mini.html new file mode 100644 index 0000000..a8255e4 --- /dev/null +++ b/templates/_types/cart/_mini.html @@ -0,0 +1,45 @@ +{% macro mini(oob=False, count=None) %} +
+ {# cart_count is set by the context processor in all apps. + Cart app computes it from g.cart + calendar_cart_entries; + other apps get it from the cart internal API. + count param allows explicit override when macro is imported without context. #} + {% if count is not none %} + {% set _count = count %} + {% elif cart_count is defined and cart_count is not none %} + {% set _count = cart_count %} + {% elif cart is defined and cart is not none %} + {% set _count = (cart | sum(attribute="quantity")) + ((calendar_cart_entries | length) if calendar_cart_entries else 0) %} + {% else %} + {% set _count = 0 %} + {% endif %} + + {% if _count == 0 %} +
+ + + +
+ {% else %} + + + + + + {{ _count }} + + + {% endif %} +
+{% endmacro %}