{% extends "base.html" %} {% block title %}{{ product.title | default("Crawl detail") }} — product-ui{% endblock %} {% macro price_str(p) %} {%- if p -%} {%- if p.symbol and not p.suffix -%}{{ p.symbol }}{%- endif -%} {%- if p.value is not none -%}{{ "%.2f"|format(p.value) }}{%- else -%}{{ p.raw }}{%- endif -%} {%- if p.symbol and p.suffix -%} {{ p.symbol }}{%- endif -%} {%- if p.unit and not p.symbol -%} {{ p.unit }}{%- endif -%} {%- endif -%} {% endmacro %} {% block content %} {# ── Header ────────────────────────────────────────────────────────────── #}

{{ product.title | default("(no title)") }}

{{ info.provider }} {% if info.variant %}{{ info.variant }}{% endif %} crawled {{ info.time[:19] | replace("T", " ") }}
{% if info.url %} Open original ↗ {% endif %} {# Re-crawl button #}
← List
{# ── Gallery ───────────────────────────────────────────────────────────── #} {% set gallery = product.gallery %} {% if gallery %}
Gallery
{% endif %} {# ── Info cards ────────────────────────────────────────────────────────── #}
{# Pricing #} {% set pricing = product.pricing %} {% if pricing %}
Pricing
{% if pricing.price %}
{{ price_str(pricing.price) }}
{% endif %} {% if pricing.original %}
{{ price_str(pricing.original) }}
{% endif %} {% if pricing.reduction %} {% for r in pricing.reduction %} {%- if r.type == "percentage" -%} −{{ (r.percentage * 100) | round(0) | int }}% {%- elif r.type == "price" -%} −{{ price_str(r.amount) }} {%- endif -%} {%- if r.name %} {{ r.name }}{%- endif -%} {% endfor %} {% endif %} {% if pricing.shipping %}
{% for s in pricing.shipping %}
{{ s.name }}: {{ price_str(s.price) }}
{% endfor %}
{% endif %}
{% endif %} {# Availability / Seller / Brand #}
Details
{% if product.available is not none %}
Available: {% if product.available %} Yes {% else %} No {% endif %}
{% endif %} {% if product.brand %}
Brand: {% if product.brand.url %} {{ product.brand.name }} {% else %} {{ product.brand.name }} {% endif %}
{% endif %} {% if product.seller %} {% if product.seller == "self" %}
Seller: Self (own shop)
{% elif product.seller is mapping %}
Seller: {% if product.seller.url %} {{ product.seller.name }} {% else %} {{ product.seller.name }} {% endif %} {% if product.seller.type %}{{ product.seller.type }}{% endif %}
{% endif %} {% endif %} {% if product.category %}
Category: {% set cat = product.category %} {% set parts = [] %} {% set _ = parts.append(cat.name) %} {% set parent = cat.parent %} {% for _ in range(10) %} {% if parent %} {% set _ = parts.insert(0, parent.name) %} {% set parent = parent.parent %} {% endif %} {% endfor %} {{ parts | join(" › ") }}
{% endif %} {% if product.id is not none %}
ID: {{ product.id }}
{% endif %} {% if product.website_variant %}
Website Variant: {{ product.website_variant }}
{% endif %}
{# Canonical URL #} {% if product.canonical_url or product.fetch_url %}
URLs
{% if product.canonical_url %} {% endif %} {% if product.fetch_url %}
Fetched
{{ product.fetch_url }}
{% endif %}
{% endif %}
{# ── Description ────────────────────────────────────────────────────────── #} {% if product.description %}
Description
{{ product.description }}
{% endif %} {# ── Variation types ────────────────────────────────────────────────────── #} {% if product.variation_types %}
Variations
{% for vt in product.variation_types %}
{{ vt.name }}{% if vt.type %} ({{ vt.type }}){% endif %}
{% for v in (vt.variations or []) %} {% if v.image %} {% set vsrc = v.image.file or v.image.url %} {% if vsrc %}{% endif %} {% endif %} {{ v.name }} {% if v.available is not none %} {% if not v.available %}{% endif %} {% endif %} {% endfor %}
{% endfor %}
{% endif %} {# ── Tables ─────────────────────────────────────────────────────────────── #} {% if product.tables %}
Tables
{% for table_name, rows in product.tables.items() %}
{{ table_name }}
{% for key, val in rows.items() %} {% endfor %}
{{ key }} {{ val }}
{% endfor %}
{% endif %} {# ── Availabilities ─────────────────────────────────────────────────────── #} {% if product.availabilities %}
Availabilities
{% for av in product.availabilities %} {% endfor %}
Selection Status Remaining Price
{{ av.selection | tojson }} {{ av.details or "" }} {{ av.remaining if av.remaining is not none else "—" }} {% if av.pricing and av.pricing.price %}{{ price_str(av.pricing.price) }}{% endif %}
{% endif %} {# ── Extra (provider-specific) ──────────────────────────────────────────── #} {% if product.extra %}

{% for k, v in product.extra.items() %} {% if k not in ("parser", "version") %} {% endif %} {% endfor %}
{{ k }} {% if v is mapping or v is iterable and v is not string %}{{ v | tojson }}{% else %}{{ v }}{% endif %}
{% endif %} {# ── Meta ───────────────────────────────────────────────────────────────── #} {% if product.meta %}

{{ product.meta | tojson(indent=2) }}
{% endif %} {% endblock %}