{# Shared building blocks. Import with: {% import "partials/macros.html" as ui %} #} {% macro icon(name, cls="") -%} {%- endmacro %} {# Mags is decorative everywhere: the text next to him always says the same thing. #} {% macro mags(pose, cls="", w=None) -%} {%- endmacro %} {% macro status(st, label) -%} {{ label }} {%- endmacro %} {% macro schip(s) -%} {{ s.name }} {%- endmacro %} {% macro dest_icon(kind) -%} {%- set m = {"discord": "message-circle", "telegram": "send", "ntfy": "smartphone", "browser": "monitor", "apprise": "mail", "webhook": "webhook"} -%} {{ icon(m.get(kind, "bell")) }} {%- endmacro %} {% macro field_error(errors, key) -%} {% if errors and errors.get(key) %}

{{ icon("circle-alert") }}{{ errors[key] }}

{% endif %} {%- endmacro %} {% macro invalid(errors, key) -%} {% if errors and errors.get(key) %} aria-invalid="true" aria-describedby="err-{{ key }}"{% endif %} {%- endmacro %} {# The listing card. Only id, title, price, total, url, age and search are guaranteed: Vinted's 2026 catalog often leaves out brand, size, condition, seller rating and extra photos. Every optional line simply disappears, and the card still reads as complete. #} {% macro item_card(it, extra_cls="", lazy=True, show_search=True) -%}
{% if it.photo %} {% else %}
{{ icon("shirt") }}
{% endif %}
{% if it.is_new %}New{% endif %} {% if it.deal_pct %}{{ icon("trending-down") }}{{ it.deal_pct }}% under typical−{{ it.deal_pct }}%{% endif %}

{{ it.title }}

{% if it.meta %}

{{ it.meta }}

{% endif %} {% if it.deal_pct %}{{ icon("trending-down") }}{{ it.deal_pct }}% under typical{% endif %}
{{ it.price }}{% if it.rating %}{{ icon("star") }}{{ "%.1f"|format(it.rating) }}{% if it.reviews %} ({{ it.reviews }}){% endif %}{% endif %} {{ it.total }} incl. fees{{ icon("shield-check") }}
{% if show_search %}{{ schip(it.search) }}{% else %}{% endif %}
{{ icon("external-link") }}
{%- endmacro %} {% macro spark(points, w=120, h=32, cls="") -%} {%- set lo = points|min -%}{%- set hi = points|max -%}{%- set span = (hi - lo) or 1 -%} {%- set n = points|length -%} {%- endmacro %}