{% extends "base.html" %} {% block title %}Garments Suite — Wishlist{% endblock %} {% block styles %} {% endblock %} {% macro _render_item(item, vendors, groups, show_order_controls=true, show_up=true, show_down=true) %}
{# Thumbnail #}
{% if item.image_url %} {{ item.name }} {% else %}
?
{% endif %}
{# Body #}
{{ item.vendor }} {% if item.cost is not none %} · £{{ '%.2f' | format(item.cost | float) }} {% endif %} {% if item.group_name %} · {{ item.group_name }} {% endif %}
{% if item.notes %}
{{ item.notes }}
{% endif %}
{# Controls #}
{% if show_order_controls %}
{% endif %}
{# Inline edit form — spans full width #}
{% endmacro %} {% block content %}
{# ── Page header ── #}

Wishlist

{{ assembled | length }} item{{ 's' if assembled | length != 1 }}
{# ── Add item form ── #}
{# ── New group form ── #}
{# ── Item list ── #} {% if not assembled %}

No items on the wishlist yet.

{% else %}
{% for bucket in assembled %} {% if bucket.group_id %} {# ── Grouped bucket ── #}
{{ bucket.group_name }} {% if bucket.total_cost is not none %} £{{ '%.2f' | format(bucket.total_cost | float) }} total {% endif %} {# Group-level ordering buttons #}
{% for item in bucket.members %} {{ _render_item(item, vendors, groups, show_order_controls=false) }} {% endfor %}
{% else %} {# ── Singleton item ── #} {% set item = bucket.members[0] %} {{ _render_item(item, vendors, groups, show_order_controls=true, show_up=not loop.first, show_down=not loop.last) }} {% endif %} {% endfor %}
{% endif %} {# ── Budget section ── #}

Budget Calculator

{% if assembled %} Wishlist total: £{{ '%.2f' | format(known_total | float) }} {% if has_unknown %} +? {% endif %} {% endif %}
£
{% if budget_str %} Clear {% endif %}
{% if budget_error %}

{{ budget_error }}

{% endif %} {% if budget_result %}
{{ budget_result.selected | length }} item{{ 's' if budget_result.selected | length != 1 }} to buy £{{ '%.2f' | format(budget_result.remainder | float) }} left over
{% if budget_result.selected %}
    {% for bucket in budget_result.selected %} {% if bucket.group_id %}
  • {{ bucket.group_name }}

    {% for item in bucket.members %}
    {% if item.image_url %} {{ item.name }} {% endif %} {{ item.name }} — {{ item.vendor }} {% if item.cost is not none %} £{{ '%.2f' | format(item.cost | float) }} {% endif %}
    {% endfor %}
  • {% else %} {% set item = bucket.members[0] %}
  • {% if item.image_url %} {{ item.name }} {% endif %} {{ item.name }} — {{ item.vendor }} {% if item.cost is not none %} £{{ '%.2f' | format(item.cost | float) }} {% endif %}
  • {% endif %} {% endfor %}
{% else %}

Nothing on the wishlist fits within £{{ '%.2f' | format(budget_val | float) }}.

{% endif %} {% if budget_result.unpriceable %}

{{ budget_result.unpriceable | length }} item{{ 's' if budget_result.unpriceable | length != 1 }} excluded from calculation (no price set).

{% endif %}
{% endif %}
{% endblock %} {% block scripts %} {% endblock %}