From 06dea73557bf97415cae7acf1c6f02018cef6264 Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 24 Feb 2026 17:33:08 +0000 Subject: [PATCH] Remove cross-domain template copies, use shared macros - Desktop/mobile search: use macros/search.html instead of browse copies - Cart mini: removed (shared _oob.html now uses fragment slot) - Browse like button: removed (no longer referenced) Co-Authored-By: Claude Opus 4.6 --- shared | 2 +- templates/_types/blog/desktop/menu.html | 4 +- .../_types/browse/desktop/_filter/search.html | 44 ------------------ templates/_types/browse/like/button.html | 20 --------- .../_types/browse/mobile/_filter/search.html | 40 ----------------- templates/_types/cart/_mini.html | 45 ------------------- 6 files changed, 3 insertions(+), 152 deletions(-) delete mode 100644 templates/_types/browse/desktop/_filter/search.html delete mode 100644 templates/_types/browse/like/button.html delete mode 100644 templates/_types/browse/mobile/_filter/search.html delete mode 100644 templates/_types/cart/_mini.html diff --git a/shared b/shared index 5518c95..cf2e2ba 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit 5518c9523729e5c1f6cdb8dd1892ded8d0ed8c71 +Subproject commit cf2e2ba1db3011f686de7b8f11dfaa7d928c0d1e diff --git a/templates/_types/blog/desktop/menu.html b/templates/_types/blog/desktop/menu.html index 57dba58..2c1afc4 100644 --- a/templates/_types/blog/desktop/menu.html +++ b/templates/_types/blog/desktop/menu.html @@ -1,5 +1,5 @@ -{% import '_types/browse/desktop/_filter/search.html' as s %} -{{ s.search(current_local_href, search, search_count, hx_select) }} +{% from 'macros/search.html' import search_desktop %} +{{ search_desktop(current_local_href, search, search_count, hx_select) }} {% include '_types/blog/_action_buttons.html' %}
- -
- - -
- {% if search %} - {{search_count}} - {% endif %} - {{zap_filter}} -
-
-{% endmacro %} \ No newline at end of file diff --git a/templates/_types/browse/like/button.html b/templates/_types/browse/like/button.html deleted file mode 100644 index 426bdc1..0000000 --- a/templates/_types/browse/like/button.html +++ /dev/null @@ -1,20 +0,0 @@ - diff --git a/templates/_types/browse/mobile/_filter/search.html b/templates/_types/browse/mobile/_filter/search.html deleted file mode 100644 index 0f39178..0000000 --- a/templates/_types/browse/mobile/_filter/search.html +++ /dev/null @@ -1,40 +0,0 @@ -{% 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 deleted file mode 100644 index a8255e4..0000000 --- a/templates/_types/cart/_mini.html +++ /dev/null @@ -1,45 +0,0 @@ -{% 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 %}