{% extends "base.html" %} {% block content %}
{# ═══ HEADER ═══ #}

My Pantry

Track what you have on hand. {{ total_count }} item{{ 's' if total_count != 1 else '' }}

{# ═══ EXPIRATION ALERTS ═══ #} {% if expired_items %}
{% for item in expired_items %}
{{ item.ingredient.name }} {% if item.brand %}({{ item.brand }}){% endif %} Expired {{ item.expiration_date.strftime('%b %d') }}
{% endfor %}
{% endif %} {% if expiring_soon %}
{% for item in expiring_soon %} {% set days_left = (item.expiration_date - today).days %}
{{ item.ingredient.name }} {% if item.brand %}({{ item.brand }}){% endif %} {% if days_left == 0 %}Expires today{% elif days_left == 1 %}Tomorrow{% else %}{{ days_left }} days left{% endif %}
{% endfor %}
{% endif %} {# ═══ STATS ROW ═══ #}
{{ total_count }}
Total Items
{{ grouped_pantry|length }}
Categories
{{ expiring_soon|length }}
Expiring Soon
{{ expired_items|length }}
Expired
{# ═══ SEARCH & FILTER TOOLBAR ═══ #}
{% if search or category_filter or location_filter or status_filter %} Clear {% endif %}
{# ═══ PANTRY ITEMS — grouped by category ═══ #} {% if grouped_pantry %} {% for category, items in grouped_pantry.items() %}
{{ category }} {{ items|length }} item{{ 's' if items|length != 1 }}
{% for item in items %} {% set exp_days = (item.expiration_date - today).days if item.expiration_date else None %} {% endfor %}
Ingredient Brand Qty Unit Location Opened Location Expires Actions
{{ item.ingredient.name }}
{% if item.notes %}
{{ item.notes }}
{% endif %}
{% if item.brand %} {{ item.brand }} {% else %} {% endif %} {% if item.quantity is not none and item.quantity <= 0 %} Empty {% else %} {{ item.quantity if item.quantity else '' }} {% endif %} {% if item.unit %} {{ item.unit }} {% else %} {% endif %} {% if item.opened %} Opened {% else %} Sealed {% endif %} {% if item.storage_location %} {% if item.storage_location == 'Refrigerator' %} {% elif item.storage_location == 'Freezer' %} {% elif item.storage_location == 'Pantry' %} {% elif item.storage_location == 'Counter' %} {% elif item.storage_location == 'Spice Rack' %} {% else %}{% endif %} {{ item.storage_location }} {% else %} {% endif %} {% if item.expiration_date %} {% if exp_days < 0 %} Expired
{{ item.expiration_date.strftime('%b %d, %Y') }}
{% elif exp_days == 0 %} Today! {% elif exp_days <= 3 %} {{ exp_days }}d left
{{ item.expiration_date.strftime('%b %d') }}
{% elif exp_days <= 7 %} {{ exp_days }}d
{{ item.expiration_date.strftime('%b %d') }}
{% else %} {{ item.expiration_date.strftime('%b %d, %Y') }} {% endif %} {% else %} {% endif %}
{% endfor %} {% else %} {# ═══ EMPTY STATE ═══ #}
{% if search or category_filter or location_filter or status_filter %}

No items match your filters

Try adjusting or clearing your search criteria.

Clear Filters {% else %}

Your pantry is empty

Start tracking what you have on hand to find matching recipes and build smarter shopping lists.

Browse Recipes
{% endif %}
{% endif %}
{# ═══════════════════════════════════════════════════════════ #} {# ═══ ADD ITEM MODAL ═══ #} {# ═══════════════════════════════════════════════════════════ #} {# ═══════════════════════════════════════════════════════════ #} {# ═══ EDIT ITEM MODAL ═══ #} {# ═══════════════════════════════════════════════════════════ #} {# ═══════════════════════════════════════════════════════════ #} {# ═══ CONFIRM MODAL (delete) ═══ #} {# ═══════════════════════════════════════════════════════════ #} {# ═══ MOBILE FAB ═══ #} {# ═══════════════════════════════════════════════════════════ #} {# ═══ JAVASCRIPT ═══ #} {# ═══════════════════════════════════════════════════════════ #} {# ═══════════════════════════════════════════════════════════ #} {# ═══ STYLES ═══ #} {# ═══════════════════════════════════════════════════════════ #} {% endblock %}