diff --git a/templates/_types/browse/_admin.html b/templates/_types/browse/_admin.html deleted file mode 100644 index 053691d..0000000 --- a/templates/_types/browse/_admin.html +++ /dev/null @@ -1,7 +0,0 @@ -{% import "macros/links.html" as links %} -{% if g.rights.admin %} - {% from 'macros/admin_nav.html' import admin_nav_item %} - {{admin_nav_item( - url_for('market.browse.product.admin', slug=slug) - )}} -{% endif %} \ No newline at end of file diff --git a/templates/_types/browse/_main_panel.html b/templates/_types/browse/_main_panel.html deleted file mode 100644 index 8640ce8..0000000 --- a/templates/_types/browse/_main_panel.html +++ /dev/null @@ -1,5 +0,0 @@ - -
- {% include "_types/browse/_product_cards.html" %} -
-
diff --git a/templates/_types/browse/_product_card.html b/templates/_types/browse/_product_card.html deleted file mode 100644 index f9bc980..0000000 --- a/templates/_types/browse/_product_card.html +++ /dev/null @@ -1,104 +0,0 @@ -{% import 'macros/stickers.html' as stick %} -{% import '_types/product/prices.html' as prices %} -{% set prices_ns = namespace() %} -{{ prices.set_prices(p, prices_ns) }} -{% set item_href = url_for('market.browse.product.product_detail', slug=p.slug)|host %} -
- {# ❤️ like button overlay - OUTSIDE the link #} - {% if g.user %} -
- {% set slug = p.slug %} - {% set liked = p.is_liked or False %} - {% include "_types/browse/like/button.html" %} -
- {% endif %} - - - - {# Make this relative so we can absolutely position children #} -
- {% if p.image %} -
-
- no image - - {% for l in p.labels %} - - {% endfor %} -
- -
- {{ p.brand }} -
-
- - {% else %} -
-
No image
-
    - {% for l in p.labels %} -
  • {{ l }}
  • - {% endfor %} -
-
- {{ p.brand }} -
-
- {% endif %} - -
- {#
{{ prices.rrp(prices_ns) }}
#} - {{ prices.card_price(p)}} - - {% import '_types/product/_cart.html' as _cart %} -
-
- {{ _cart.add(p.slug, cart)}} -
- - - -
- {% for s in p.stickers %} - {{ stick.sticker( - asset_url('stickers/' + s + '.svg'), - s, - True, - size=24, - found=s in selected_stickers - ) }} - {% endfor %} -
-
- {{ p.title | highlight(search) }} -
-
-
\ No newline at end of file diff --git a/templates/_types/browse/_product_cards.html b/templates/_types/browse/_product_cards.html deleted file mode 100644 index cc8edb3..0000000 --- a/templates/_types/browse/_product_cards.html +++ /dev/null @@ -1,107 +0,0 @@ -{% for p in products %} - {% include "_types/browse/_product_card.html" %} -{% endfor %} -{% if page < total_pages|int %} - - - - - -{% else %} -
End of results
-{% endif %} - diff --git a/templates/_types/browse/desktop/_category_selector.html b/templates/_types/browse/desktop/_category_selector.html deleted file mode 100644 index ba642b7..0000000 --- a/templates/_types/browse/desktop/_category_selector.html +++ /dev/null @@ -1,40 +0,0 @@ -{# Categories #} - diff --git a/templates/_types/browse/desktop/_filter/brand.html b/templates/_types/browse/desktop/_filter/brand.html deleted file mode 100644 index 616e36e..0000000 --- a/templates/_types/browse/desktop/_filter/brand.html +++ /dev/null @@ -1,40 +0,0 @@ -{# Brand filter (desktop, single-select) #} - -{# Brands #} - diff --git a/templates/_types/browse/desktop/_filter/labels.html b/templates/_types/browse/desktop/_filter/labels.html deleted file mode 100644 index 7a4a41e..0000000 --- a/templates/_types/browse/desktop/_filter/labels.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -{% import 'macros/stickers.html' as stick %} - - diff --git a/templates/_types/browse/desktop/_filter/like.html b/templates/_types/browse/desktop/_filter/like.html deleted file mode 100644 index c830f98..0000000 --- a/templates/_types/browse/desktop/_filter/like.html +++ /dev/null @@ -1,38 +0,0 @@ -{% import 'macros/stickers.html' as stick %} - {% set qs = {"liked": None if liked else True, "page": None}|qs %} - {% set href = (current_local_href ~ qs)|host %} - - {% if liked %} - - {% else %} - - {% endif %} - - {{ liked_count }} - - diff --git a/templates/_types/browse/desktop/_filter/search.html b/templates/_types/browse/desktop/_filter/search.html deleted file mode 100644 index 2e0ea8e..0000000 --- a/templates/_types/browse/desktop/_filter/search.html +++ /dev/null @@ -1,44 +0,0 @@ - -{% 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/desktop/_filter/sort.html b/templates/_types/browse/desktop/_filter/sort.html deleted file mode 100644 index a4b5404..0000000 --- a/templates/_types/browse/desktop/_filter/sort.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - -{% import 'macros/stickers.html' as stick %} -{% set sort_val = sort|default('az', true) %} - - diff --git a/templates/_types/browse/desktop/_filter/stickers.html b/templates/_types/browse/desktop/_filter/stickers.html deleted file mode 100644 index 46fd22b..0000000 --- a/templates/_types/browse/desktop/_filter/stickers.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - -{% import 'macros/stickers.html' as stick %} - - diff --git a/templates/_types/browse/desktop/menu.html b/templates/_types/browse/desktop/menu.html deleted file mode 100644 index 893cf2d..0000000 --- a/templates/_types/browse/desktop/menu.html +++ /dev/null @@ -1,37 +0,0 @@ - {% import '_types/browse/desktop/_filter/search.html' as s %} - {{ s.search(current_local_href, search, search_count, hx_select) }} - -
-
-
{{ category_label }}
-
- {% include "_types/browse/desktop/_filter/sort.html" %} - - - {% if stickers %} - {% include "_types/browse/desktop/_filter/stickers.html" %} - {% endif %} - - - {% if subs_local and top_local_href %} - {% include "_types/browse/desktop/_category_selector.html" %} - {% endif %} - -
- -
- - {% include "_types/browse/desktop/_filter/brand.html" %} - -
diff --git a/templates/_types/browse/index.html b/templates/_types/browse/index.html deleted file mode 100644 index 015e6b3..0000000 --- a/templates/_types/browse/index.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends '_types/market/index.html' %} - -{% block filter %} - {% include "_types/browse/mobile/_filter/summary.html" %} -{% endblock %} - -{% block aside %} - {% include "_types/browse/desktop/menu.html" %} -{% endblock %} - -{% block content %} - {% include "_types/browse/_main_panel.html" %} -{% endblock %} diff --git a/templates/_types/browse/like/button.html b/templates/_types/browse/like/button.html deleted file mode 100644 index de147a4..0000000 --- a/templates/_types/browse/like/button.html +++ /dev/null @@ -1,20 +0,0 @@ - diff --git a/templates/_types/browse/mobile/_filter/brand_ul.html b/templates/_types/browse/mobile/_filter/brand_ul.html deleted file mode 100644 index ac15400..0000000 --- a/templates/_types/browse/mobile/_filter/brand_ul.html +++ /dev/null @@ -1,40 +0,0 @@ - \ No newline at end of file diff --git a/templates/_types/browse/mobile/_filter/index.html b/templates/_types/browse/mobile/_filter/index.html deleted file mode 100644 index 7c2a615..0000000 --- a/templates/_types/browse/mobile/_filter/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - {% include "_types/browse/mobile/_filter/sort_ul.html" %} - {% if search or selected_labels|length or selected_stickers|length or selected_brands|length %} - {% set href = (current_local_href ~ {"clear_filters": True}|qs)|host %} -
- - - clear filters - - -
- {% endif %} -
- {% include "_types/browse/mobile/_filter/like.html" %} - {% include "_types/browse/mobile/_filter/labels.html" %} -
- {% include "_types/browse/mobile/_filter/stickers.html" %} - {% include "_types/browse/mobile/_filter/brand_ul.html" %} - diff --git a/templates/_types/browse/mobile/_filter/labels.html b/templates/_types/browse/mobile/_filter/labels.html deleted file mode 100644 index 3868d42..0000000 --- a/templates/_types/browse/mobile/_filter/labels.html +++ /dev/null @@ -1,47 +0,0 @@ -{% import 'macros/stickers.html' as stick %} - - -{# Optional: hide horizontal scrollbar on mobile while keeping scrollable #} - diff --git a/templates/_types/browse/mobile/_filter/like.html b/templates/_types/browse/mobile/_filter/like.html deleted file mode 100644 index 509ea92..0000000 --- a/templates/_types/browse/mobile/_filter/like.html +++ /dev/null @@ -1,40 +0,0 @@ -{% import 'macros/stickers.html' as stick %} - \ No newline at end of file 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/browse/mobile/_filter/sort_ul.html b/templates/_types/browse/mobile/_filter/sort_ul.html deleted file mode 100644 index c02de19..0000000 --- a/templates/_types/browse/mobile/_filter/sort_ul.html +++ /dev/null @@ -1,33 +0,0 @@ - - - -{% import 'macros/stickers.html' as stick %} - - - \ No newline at end of file diff --git a/templates/_types/browse/mobile/_filter/stickers.html b/templates/_types/browse/mobile/_filter/stickers.html deleted file mode 100644 index fed0927..0000000 --- a/templates/_types/browse/mobile/_filter/stickers.html +++ /dev/null @@ -1,50 +0,0 @@ -{% import 'macros/stickers.html' as stick %} - - - -{# Optional: hide horizontal scrollbar on mobile while keeping scrollable #} - diff --git a/templates/_types/browse/mobile/_filter/summary.html b/templates/_types/browse/mobile/_filter/summary.html deleted file mode 100644 index 07a86a1..0000000 --- a/templates/_types/browse/mobile/_filter/summary.html +++ /dev/null @@ -1,120 +0,0 @@ -{% import 'macros/stickers.html' as stick %} -{% import 'macros/layout.html' as layout %} - - - - -{% call layout.details('/filter', 'md:hidden') %} - {% call layout.filter_summary("filter-summary-mobile", current_local_href, search, search_count, hx_select) %} -
- - -
- {% if sort %} - - {% endif %} - {% if liked %} -
- - {% if liked_count is not none %} -
- {{ liked_count }} -
- {% endif %} -
- {% endif %} - {% if selected_labels and selected_labels|length %} - - {% endif %} - {% if selected_stickers and selected_stickers|length %} - - {% endif %} -
- - {% if selected_brands and selected_brands|length %} - - {% endif %} -
- {% endcall %} -
- {% include "_types/browse/mobile/_filter/index.html" %} -
-{% endcall %} diff --git a/templates/_types/market/_admin.html b/templates/_types/market/_admin.html deleted file mode 100644 index 0b09927..0000000 --- a/templates/_types/market/_admin.html +++ /dev/null @@ -1,7 +0,0 @@ -{% import "macros/links.html" as links %} -{% if g.rights.admin %} - {% from 'macros/admin_nav.html' import admin_nav_item %} - {{admin_nav_item( - url_for('market.admin.admin') - )}} -{% endif %} \ No newline at end of file diff --git a/templates/_types/market/_main_panel.html b/templates/_types/market/_main_panel.html deleted file mode 100644 index 87bb965..0000000 --- a/templates/_types/market/_main_panel.html +++ /dev/null @@ -1,23 +0,0 @@ -{# Main panel fragment for HTMX navigation - market landing page #} -
- {% if post.custom_excerpt %} -
- {{post.custom_excerpt|safe}} -
- {% endif %} - {% if post.feature_image %} -
- -
- {% endif %} -
- {% if post.html %} - {{post.html|safe}} - {% endif %} -
-
-
diff --git a/templates/_types/market/_title.html b/templates/_types/market/_title.html deleted file mode 100644 index 33e6c67..0000000 --- a/templates/_types/market/_title.html +++ /dev/null @@ -1,17 +0,0 @@ -
-
- - {{ coop_title }} -
-
-
- {{top_slug or ''}} -
- {% if sub_slug %} -
- {{sub_slug}} -
- {% endif %} -
-
\ No newline at end of file diff --git a/templates/_types/market/admin/_main_panel.html b/templates/_types/market/admin/_main_panel.html deleted file mode 100644 index a354325..0000000 --- a/templates/_types/market/admin/_main_panel.html +++ /dev/null @@ -1 +0,0 @@ -market admin \ No newline at end of file diff --git a/templates/_types/market/admin/_nav.html b/templates/_types/market/admin/_nav.html deleted file mode 100644 index f5c504d..0000000 --- a/templates/_types/market/admin/_nav.html +++ /dev/null @@ -1,2 +0,0 @@ -{% from 'macros/admin_nav.html' import placeholder_nav %} -{{ placeholder_nav() }} diff --git a/templates/_types/market/admin/_oob_elements.html b/templates/_types/market/admin/_oob_elements.html deleted file mode 100644 index 9b306fd..0000000 --- a/templates/_types/market/admin/_oob_elements.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends 'oob_elements.html' %} - -{# OOB elements for HTMX navigation - all elements that need updating #} - -{# Import shared OOB macros #} -{% from '_types/root/_oob_menu.html' import mobile_menu with context %} - -{# Header with app title - includes cart-mini, navigation, and market-specific header #} - -{% block oobs %} - - {% from '_types/root/_n/macros.html' import oob_header with context %} - {{oob_header('market-header-child', 'market-admin-header-child', '_types/market/admin/header/_header.html')}} - - {% from '_types/market/header/_header.html' import header_row with context %} - {{ header_row(oob=True) }} -{% endblock %} - - -{% block mobile_menu %} - {% include '_types/market/admin/_nav.html' %} -{% endblock %} - - -{% block content %} - {% include "_types/market/admin/_main_panel.html" %} -{% endblock %} - - diff --git a/templates/_types/market/admin/header/_header.html b/templates/_types/market/admin/header/_header.html deleted file mode 100644 index 950eefc..0000000 --- a/templates/_types/market/admin/header/_header.html +++ /dev/null @@ -1,11 +0,0 @@ -{% import 'macros/links.html' as links %} -{% macro header_row(oob=False) %} - {% call links.menu_row(id='market-admin-row', oob=oob) %} - {% call links.link(url_for('market.admin.admin'), hx_select_search) %} - {{ links.admin() }} - {% endcall %} - {% call links.desktop_nav() %} - {% include '_types/market/admin/_nav.html' %} - {% endcall %} - {% endcall %} -{% endmacro %} \ No newline at end of file diff --git a/templates/_types/market/admin/index.html b/templates/_types/market/admin/index.html deleted file mode 100644 index 4798c46..0000000 --- a/templates/_types/market/admin/index.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends '_types/market/index.html' %} - - -{% block market_header_child %} - {% from '_types/root/_n/macros.html' import index_row with context %} - {% call index_row('market-admin-header-child', '_types/market/admin/header/_header.html') %} - {% block market_admin_header_child %} - {% endblock %} - {% endcall %} -{% endblock %} - -{% block _main_mobile_menu %} - {% include '_types/market/admin/_nav.html' %} -{% endblock %} - - -{% block content %} - {% include '_types/market/admin/_main_panel.html' %} -{% endblock %} diff --git a/templates/_types/market/desktop/_nav.html b/templates/_types/market/desktop/_nav.html deleted file mode 100644 index d4de6e6..0000000 --- a/templates/_types/market/desktop/_nav.html +++ /dev/null @@ -1,38 +0,0 @@ - - diff --git a/templates/_types/market/header/_header.html b/templates/_types/market/header/_header.html deleted file mode 100644 index 2d92286..0000000 --- a/templates/_types/market/header/_header.html +++ /dev/null @@ -1,11 +0,0 @@ -{% import 'macros/links.html' as links %} -{% macro header_row(oob=False) %} - {% call links.menu_row(id='market-row', oob=oob) %} - {% call links.link(url_for('market.browse.home'), hx_select_search ) %} - {% include '_types/market/_title.html' %} - {% endcall %} - {% call links.desktop_nav() %} - {% include '_types/market/desktop/_nav.html' %} - {% endcall %} - {% endcall %} -{% endmacro %} \ No newline at end of file diff --git a/templates/_types/market/mobile/_nav_panel.html b/templates/_types/market/mobile/_nav_panel.html deleted file mode 100644 index 65a9685..0000000 --- a/templates/_types/market/mobile/_nav_panel.html +++ /dev/null @@ -1,110 +0,0 @@ -{% from 'macros/glyphs.html' import opener %} -
-
- {% set all_href = (url_for('market.browse.browse_all') ~ qs)|host %} - {% set all_active = (category_label == 'All Products') %} - -
- All -
-
- {% for cat, data in categories.items() %} -
- - - {% set href = (url_for('market.browse.browse_top', top_slug=data.slug) ~ qs)|host %} - - -
{{ cat }}
-
{{ data.count }}
-
- {{ opener('cat')}} - -
- -
- {% if data.subs %} - -
- -
- {% for sub in data.subs %} - {% set href = (url_for('market.browse.browse_sub', top_slug=data.slug, sub_slug=sub.slug) ~qs)|host%} - {% if top_slug==(data.slug | lower) and sub_slug == sub.slug %} - -
{{ sub.html_label or sub.name }}
-
{{ sub.count }}
-
- {% endif %} - {% endfor %} - {% for sub in data.subs %} - {% if not (top_slug==(data.slug | lower) and sub_slug == sub.slug) %} - {% set href = (url_for('market.browse.browse_sub', top_slug=data.slug, sub_slug=sub.slug) ~ qs)|host%} - -
{{ sub.name }}
-
{{ sub.count }}
-
- {% endif %} - {% endfor %} -
-
- {% else %} - {% set href = (url_for('market.browse.browse_top', top_slug=data.slug) ~ qs)|host%} - View all - {% endif %} -
-
- {% endfor %} - {% include '_types/market/_admin.html' %} -
-
diff --git a/templates/_types/market/mobile/menu.html b/templates/_types/market/mobile/menu.html deleted file mode 100644 index 145b551..0000000 --- a/templates/_types/market/mobile/menu.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends 'mobile/menu.html' %} -{% block menu %} - {% block mobile_menu %} - {% endblock %} - {% include '_types/market/mobile/_nav_panel.html' %} -{% endblock %} diff --git a/templates/_types/product/_added.html b/templates/_types/product/_added.html deleted file mode 100644 index 9ee4fed..0000000 --- a/templates/_types/product/_added.html +++ /dev/null @@ -1,25 +0,0 @@ -{% set oob='true' %} -{% import '_types/product/_cart.html' as _cart %} -{% from '_types/cart/_mini.html' import mini with context %} -{{mini()}} - -{{ _cart.add(d.slug, cart, oob='true')}} - -{% from '_types/product/_cart.html' import cart_item with context %} - -{% if cart | sum(attribute="quantity") > 0 %} - {% if item.quantity > 0 %} - {{ cart_item(oob='true')}} - {% else %} - {{ cart_item(oob='delete')}} - {% endif %} - {% from '_types/cart/_cart.html' import summary %} - - {{ summary(cart, total,calendar_total, calendar_cart_entries, oob='true')}} - -{% else %} - {% set cart=[] %} - {% from '_types/cart/_cart.html' import show_cart with context %} - {{ show_cart( oob='true') }} - -{% endif %} \ No newline at end of file diff --git a/templates/_types/product/_main_panel.html b/templates/_types/product/_main_panel.html deleted file mode 100644 index cf8df31..0000000 --- a/templates/_types/product/_main_panel.html +++ /dev/null @@ -1,131 +0,0 @@ -{# Main panel fragment for HTMX navigation - product detail content #} -{% import 'macros/stickers.html' as stick %} -{% import '_types/product/prices.html' as prices %} -{% set prices_ns = namespace() %} -{{ prices.set_prices(d, prices_ns)}} - - {# Product detail grid from content block #} -
-
- {% if d.images and d.images|length > 0 %} -
- {# --- like button overlay in top-right --- #} - {% if g.user %} -
- {% set slug = d.slug %} - {% set liked = liked_by_current_user %} - {% include "_types/browse/like/button.html" %} -
- {% endif %} - -
-
- {{ d.title }} - - {% for l in d.labels %} - - {% endfor %} -
-
- {{ d.brand }} -
-
- - {% if d.images|length > 1 %} - - - {% endif %} -
- -
-
- {% for u in d.images %} - - - {% endfor %} -
-
- {% else %} -
- {# Even if no image, still render the like button in the corner for consistency #} - {% if g.user %} -
- {% set slug = d.slug %} - {% set liked = liked_by_current_user %} - {% include "_types/browse/like/button.html" %} -
- {% endif %} - - No image -
- {% endif %} - -
- {% for s in d.stickers %} - {{ stick.sticker(asset_url('stickers/' + s + '.svg'), s, True, size=40) }} - {% endfor %} -
-
- -
- {# Optional extras shown quietly #} -
- {% if d.price_per_unit or d.price_per_unit_raw %} -
Unit price: {{ prices.price_str(d.price_per_unit, d.price_per_unit_raw, d.price_per_unit_currency) }}
- {% endif %} - {% if d.case_size_raw %} -
Case size: {{ d.case_size_raw }}
- {% endif %} - -
- - {% if d.description_short or d.description_html %} -
- {% if d.description_short %} -

{{ d.description_short }}

- {% endif %} - {% if d.description_html %} -
- {{ d.description_html | safe }} -
- {% endif %} -
- {% endif %} - - {% if d.sections and d.sections|length %} -
- {% for sec in d.sections %} -
- - {{ sec.title }} - - -
- {{ sec.html | safe }} -
-
- {% endfor %} -
- {% endif %} -
- -
-
diff --git a/templates/_types/product/_meta.html b/templates/_types/product/_meta.html deleted file mode 100644 index aebb684..0000000 --- a/templates/_types/product/_meta.html +++ /dev/null @@ -1,106 +0,0 @@ -{# --- social/meta_product.html --- #} -{# Context expected: - site, d (Product), request -#} - -{# Visibility → robots: index unless soft-deleted #} -{% set robots_here = 'noindex,nofollow' if d.deleted_at else 'index,follow' %} - -{# Compute canonical #} -{% set _site_url = site().url.rstrip('/') if site and site().url else '' %} -{% set _product_path = request.path if request else ('/products/' ~ (d.slug or '')) %} -{% set canonical = _site_url ~ _product_path if _site_url else (request.url if request else None) %} - -{# Include common base (charset, viewport, robots default, RSS, Org/WebSite JSON-LD) #} -{% set robots_override = robots_here %} -{% include 'social/meta_base.html' %} - -{# ---- Titles / descriptions ---- #} -{% set base_product_title = d.title or base_title %} -{% set og_title = base_product_title %} -{% set tw_title = base_product_title %} - -{# Description: prefer short, then HTML stripped #} -{% set desc_source = d.description_short - or (d.description_html|striptags if d.description_html else '') %} -{% set description = (desc_source|trim|replace('\n',' ')|replace('\r',' ')|striptags)|truncate(160, True, '…') %} - -{# ---- Image priority: product image, then first gallery image, then site default ---- #} -{% set image_url = d.image - or ((d.images|first).url if d.images and (d.images|first).url else None) - or (site().default_image if site and site().default_image else None) %} - -{# ---- Price / offer helpers ---- #} -{% set price = d.special_price or d.regular_price or d.rrp %} -{% set price_currency = d.special_price_currency or d.regular_price_currency or d.rrp_currency %} - -{# ---- Basic meta ---- #} -{{ base_product_title }} - -{% if canonical %}{% endif %} - -{# ---- Open Graph ---- #} - - - - -{% if canonical %}{% endif %} -{% if image_url %}{% endif %} - -{# Optional product OG price tags #} -{% if price and price_currency %} - - -{% endif %} -{% if d.brand %} - -{% endif %} -{% if d.sku %} - -{% endif %} - -{# ---- Twitter ---- #} - -{% if site and site().twitter_site %}{% endif %} - - -{% if image_url %}{% endif %} - -{# ---- JSON-LD Product ---- #} -{% set jsonld = { - "@context": "https://schema.org", - "@type": "Product", - "name": d.title, - "image": image_url, - "description": description, - "sku": d.sku, - "brand": d.brand, - "url": canonical -} %} - -{# Brand as proper object if present #} -{% if d.brand %} - {% set jsonld = jsonld | combine({ - "brand": { - "@type": "Brand", - "name": d.brand - } - }) %} -{% endif %} - -{# Offers if price available #} -{% if price and price_currency %} - {% set jsonld = jsonld | combine({ - "offers": { - "@type": "Offer", - "price": price, - "priceCurrency": price_currency, - "url": canonical, - "availability": "https://schema.org/InStock" - } - }) %} -{% endif %} - - diff --git a/templates/_types/product/_oob_elements.html b/templates/_types/product/_oob_elements.html deleted file mode 100644 index a651387..0000000 --- a/templates/_types/product/_oob_elements.html +++ /dev/null @@ -1,49 +0,0 @@ -{% extends 'oob_elements.html' %} -{# OOB elements for HTMX navigation - product extends browse so use similar structure #} -{% import 'macros/layout.html' as layout %} -{% import 'macros/stickers.html' as stick %} -{% import '_types/product/prices.html' as prices %} -{% set prices_ns = namespace() %} -{{ prices.set_prices(d, prices_ns)}} - -{# Import shared OOB macros #} -{% from '_types/root/header/_oob.html' import root_header_start, root_header_end with context %} -{% from '_types/root/_oob_menu.html' import mobile_menu with context %} - - - -{% block oobs %} - {% from '_types/market/header/_header.html' import header_row with context %} - {{ header_row(oob=True) }} - - {% from '_types/root/_n/macros.html' import oob_header with context %} - {{oob_header('market-header-child', 'product-header-child', '_types/product/header/_header.html')}} - -{% endblock %} - - - -{% block mobile_menu %} - {% include '_types/market/mobile/_nav_panel.html' %} - {% include '_types/browse/_admin.html' %} -{% endblock %} - -{% block filter %} - {% call layout.details() %} - {% call layout.summary('coop-child-header') %} - {% endcall %} - {% call layout.menu('blog-child-menu') %} - {% endcall %} - {% endcall %} - - {% call layout.details() %} - {% call layout.summary('product-child-header') %} - {% endcall %} - {% call layout.menu('item-child-menu') %} - {% endcall %} - {% endcall %} -{% endblock %} - -{% block content %} - {% include '_types/product/_main_panel.html' %} -{% endblock %} diff --git a/templates/_types/product/_prices.html b/templates/_types/product/_prices.html deleted file mode 100644 index e56339f..0000000 --- a/templates/_types/product/_prices.html +++ /dev/null @@ -1,33 +0,0 @@ -{% import '_types/product/_cart.html' as _cart %} - {# ---- Price block ---- #} - {% import '_types/product/prices.html' as prices %} - {% set prices_ns = namespace() %} - {{ prices.set_prices(d, prices_ns)}} - -
- {{ _cart.add(d.slug, cart)}} - - {% if prices_ns.sp_val %} -
- Special price -
-
- {{ prices.price_str(prices_ns.sp_val, prices_ns.sp_raw, prices_ns.sp_cur) }} -
- {% if prices_ns.sp_val and prices_ns.rp_val %} -
- {{ prices.price_str(prices_ns.rp_val, prices_ns.rp_raw, prices_ns.rp_cur) }} -
- {% endif %} - {% elif prices_ns.rp_val %} - -
- {{ prices.price_str(prices_ns.rp_val, prices_ns.rp_raw, prices_ns.rp_cur) }} -
- {% endif %} - {{ prices.rrp(prices_ns) }} - -
- diff --git a/templates/_types/product/_title.html b/templates/_types/product/_title.html deleted file mode 100644 index 0b3be43..0000000 --- a/templates/_types/product/_title.html +++ /dev/null @@ -1,2 +0,0 @@ - -
{{ d.title }}
diff --git a/templates/_types/product/admin/_nav.html b/templates/_types/product/admin/_nav.html deleted file mode 100644 index f5c504d..0000000 --- a/templates/_types/product/admin/_nav.html +++ /dev/null @@ -1,2 +0,0 @@ -{% from 'macros/admin_nav.html' import placeholder_nav %} -{{ placeholder_nav() }} diff --git a/templates/_types/product/admin/_oob_elements.html b/templates/_types/product/admin/_oob_elements.html deleted file mode 100644 index 84acac6..0000000 --- a/templates/_types/product/admin/_oob_elements.html +++ /dev/null @@ -1,40 +0,0 @@ -{% extends 'oob_elements.html' %} - - -{# OOB elements for HTMX navigation - all elements that need updating #} -{# Import shared OOB macros #} -{% from '_types/root/header/_oob.html' import root_header_start, root_header_end with context %} -{% from '_types/root/_oob_menu.html' import mobile_menu with context %} - - - -{% block oobs %} - - {% from '_types/root/_n/macros.html' import oob_header with context %} - {{oob_header('product-header-child', 'product-admin-header-child', '_types/product/admin/header/_header.html')}} - - {% from '_types/product/header/_header.html' import header_row with context %} - {{ header_row(oob=True) }} -{% endblock %} - - -{% from '_types/root/_n/macros.html' import header with context %} -{% call header(id='product-header-child', oob=True) %} - {% call header() %} - {% from '_types/product/admin/header/_header.html' import header_row with context %} - {{header_row()}} -
- -
- {% endcall %} -{% endcall %} - - -{% block mobile_menu %} - {% include '_types/product/admin/_nav.html' %} -{% endblock %} - - -{% block content %} - {% include '_types/product/_main_panel.html' %} -{% endblock %} diff --git a/templates/_types/product/admin/header/_header.html b/templates/_types/product/admin/header/_header.html deleted file mode 100644 index 2a6993a..0000000 --- a/templates/_types/product/admin/header/_header.html +++ /dev/null @@ -1,11 +0,0 @@ -{% import 'macros/links.html' as links %} -{% macro header_row(oob=False) %} - {% call links.menu_row(id='product-admin-row', oob=oob) %} - {% call links.link(url_for('market.browse.product.admin', slug=d.slug), hx_select_search ) %} - admin!! - {% endcall %} - {% call links.desktop_nav() %} - {% include '_types/product/admin/_nav.html' %} - {% endcall %} - {% endcall %} -{% endmacro %} \ No newline at end of file diff --git a/templates/_types/product/admin/index.html b/templates/_types/product/admin/index.html deleted file mode 100644 index 3afe352..0000000 --- a/templates/_types/product/admin/index.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends '_types/product/index.html' %} - -{% import 'macros/layout.html' as layout %} - -{% block product_header_child %} - {% from '_types/root/_n/macros.html' import index_row with context %} - {% call index_row('market-header-child', '_types/product/admin/header/_header.html') %} - {% block product_admin_header_child %} - {% endblock %} - {% endcall %} -{% endblock %} - - - -{% block ___app_title %} - {% import 'macros/links.html' as links %} - {% call links.menu_row() %} - {% call links.link(url_for('market.browse.product.admin', slug=slug), hx_select_search) %} - {{ links.admin() }} - {% endcall %} - {% call links.desktop_nav() %} - {% include '_types/product/admin/_nav.html' %} - {% endcall %} - {% endcall %} -{% endblock %} - - - -{% block _main_mobile_menu %} - {% include '_types/product/admin/_nav.html' %} -{% endblock %} - -{% block aside %} -{% endblock %} - - -{% block content %} -{% include '_types/product/_main_panel.html' %} -{% endblock %} diff --git a/templates/_types/product/header/_header.html b/templates/_types/product/header/_header.html deleted file mode 100644 index 3a8daa6..0000000 --- a/templates/_types/product/header/_header.html +++ /dev/null @@ -1,15 +0,0 @@ -{% import 'macros/links.html' as links %} -{% macro header_row(oob=False) %} - {% call links.menu_row(id='product-row', oob=oob) %} - {% call links.link(url_for('market.browse.product.product_detail', slug=d.slug), hx_select_search ) %} - {% include '_types/product/_title.html' %} - {% endcall %} - {% include '_types/product/_prices.html' %} - {% call links.desktop_nav() %} - {% include '_types/browse/_admin.html' %} - {% endcall %} - {% endcall %} -{% endmacro %} - - - diff --git a/templates/_types/product/index.html b/templates/_types/product/index.html deleted file mode 100644 index bdbe8cc..0000000 --- a/templates/_types/product/index.html +++ /dev/null @@ -1,61 +0,0 @@ -{% extends '_types/browse/index.html' %} - -{% block meta %} - {% include '_types/product/_meta.html' %} -{% endblock %} - - -{% import 'macros/stickers.html' as stick %} -{% import '_types/product/prices.html' as prices %} -{% set prices_ns = namespace() %} -{{ prices.set_prices(d, prices_ns)}} - - - -{% block market_header_child %} - {% from '_types/root/_n/macros.html' import index_row with context %} - {% call index_row('market-header-child', '_types/product/header/_header.html') %} - {% block product_header_child %} - {% endblock %} - {% endcall %} -{% endblock %} - - -{% block _main_mobile_menu %} - {% include '_types/browse/_admin.html' %} -{% endblock %} - - - -{% block filter %} - -{% call layout.details() %} - {% call layout.summary('coop-child-header') %} - {% block coop_child_summary %} - {% endblock %} - {% endcall %} - {% call layout.menu('blog-child-menu') %} - {% block post_child_menu %} - {% endblock %} - {% endcall %} - {% endcall %} - - {% call layout.details() %} - {% call layout.summary('product-child-header') %} - {% block item_child_summary %} - {% endblock %} - {% endcall %} - {% call layout.menu('item-child-menu') %} - {% block item_child_menu %} - {% endblock %} - {% endcall %} - {% endcall %} - -{% endblock %} - -{% block aside %} -{% endblock %} - -{% block content %} - {% include '_types/product/_main_panel.html' %} -{% endblock %} diff --git a/templates/_types/product/prices.html b/templates/_types/product/prices.html deleted file mode 100644 index be9cc4c..0000000 --- a/templates/_types/product/prices.html +++ /dev/null @@ -1,66 +0,0 @@ -{# ---- Price formatting helpers ---- #} -{% set _sym = {'GBP':'£','EUR':'€','USD':'$'} %} -{% macro price_str(val, raw, cur) -%} - {%- if raw -%} - {{ raw }} - {%- elif val is number -%} - {{ (_sym.get(cur) or '') ~ ('%.2f'|format(val)) }} - {%- else -%} - {{ val or '' }} - {%- endif -%} -{%- endmacro %} - - -{% macro set_prices(item, ns) -%} - -{% set ns.sp_val = item.special_price or (item.oe_list_price and item.oe_list_price.special) %} -{% set ns.sp_raw = item.special_price_raw or (item.oe_list_price and item.oe_list_price.special_raw) %} -{% set ns.sp_cur = item.special_price_currency or (item.oe_list_price and item.oe_list_price.special_currency) %} - -{% set ns.rp_val = item.regular_price or item.rrp or (item.oe_list_price and item.oe_list_price.rrp) %} -{% set ns.rp_raw = item.regular_price_raw or item.rrp_raw or (item.oe_list_price and item.oe_list_price.rrp_raw) %} -{% set ns.rp_cur = item.regular_price_currency or item.rrp_currency or (item.oe_list_price and item.oe_list_price.rrp_currency) %} - -{% set ns.case_size_count = (item.case_size_count or 1) %} -{% set ns.rrp = item.rrp_raw[0] ~ "%.2f"|format(item.rrp * (ns.case_size_count)) %} -{% set ns.rrp_raw = item.rrp_raw %} - -{%- endmacro %} - - -{% macro rrp(ns) -%} - {% if ns.rrp %} -
- rrp: - - {{ ns.rrp }} - -
- {% endif %} -{%- endmacro %} - - -{% macro card_price(item) %} - - -{# price block unchanged #} - {% set _sym = {'GBP':'£','EUR':'€','USD':'$'} %} - {% set sp_val = item.special_price or (item.oe_list_price and item.oe_list_price.special) %} - {% set sp_raw = item.special_price_raw or (item.oe_list_price and item.oe_list_price.special_raw) %} - {% set sp_cur = item.special_price_currency or (item.oe_list_price and item.oe_list_price.special_currency) %} - {% set rp_val = item.regular_price or item.rrp or (item.oe_list_price and item.oe_list_price.rrp) %} - {% set rp_raw = item.regular_price_raw or item.rrp_raw or (item.oe_list_price and item.oe_list_price.rrp_raw) %} - {% set rp_cur = item.regular_price_currency or item.rrp_currency or (item.oe_list_price and item.oe_list_price.rrp_currency) %} - {% set sp_str = sp_raw if sp_raw else ( (_sym.get(sp_cur, '') ~ ('%.2f'|format(sp_val))) if sp_val is number else (sp_val or '')) %} - {% set rp_str = rp_raw if rp_raw else ( (_sym.get(rp_cur, '') ~ ('%.2f'|format(rp_val))) if rp_val is number else (rp_val or '')) %} -
- {% if sp_val %} -
{{ sp_str }}
- {% if rp_val %} -
{{ rp_str }}
- {% endif %} - {% elif rp_val %} -
{{ rp_str }}
- {% endif %} -
-{% endmacro %}