9 lines
2.4 KiB
HTML
9 lines
2.4 KiB
HTML
{% extends 'planner/base.html' %}{% load static %}
|
|
{% block title %}Groceries · Tasknest{% endblock %}
|
|
{% block content %}
|
|
<link rel="stylesheet" href="{% static 'groceries/groceries.css' %}?v=2">
|
|
<div class="grocery-page"><header class="grocery-page-header"><div><p class="grocery-kicker">Food</p><h1>Grocery list</h1><p>Plan what to buy. Marking an item purchased does not add it to Kitchen Inventory.</p></div>{% if ha_grocery_sync_available %}<div class="grocery-sync-action"><a class="grocery-sync-button" href="{% url 'home_assistant:preview' %}">Sync with Home Assistant</a><small>Review changes before confirming.</small></div>{% endif %}</header>
|
|
<section class="grocery-panel" aria-labelledby="quick-add"><h2 id="quick-add">Quick add</h2><form class="grocery-add" method="post" action="{% url 'groceries:add' %}">{% csrf_token %}<label>Name<input name="name" maxlength="180" required autocomplete="off"></label><label>Quantity<input name="quantity" type="number" min="0.001" step="0.001" value="1" required></label><label>Unit<select name="unit"><option value="pieces">pieces</option><option value="g">g</option><option value="kg">kg</option><option value="ml">ml</option><option value="L">L</option><option value="packs">packs</option><option value="portions">portions</option><option value="tsp">tsp</option><option value="tbsp">tbsp</option></select></label><label>Category<input name="category" maxlength="80"></label><button type="submit">Add item</button></form></section>
|
|
<section class="grocery-panel" aria-labelledby="grocery-items"><div class="grocery-panel-head"><h2 id="grocery-items">Items</h2><form method="post" action="{% url 'groceries:clear-purchased' %}">{% csrf_token %}<button type="submit" class="grocery-text-button">Clear purchased</button></form></div><form method="get" class="grocery-filter" hx-get="{% url 'groceries:index' %}" hx-target="#grocery-list" hx-push-url="true"><label>Search<input type="search" name="q" value="{{ query }}"></label><label>Status<select name="status"><option value="needed"{% if selected_status == 'needed' %} selected{% endif %}>Needed</option><option value="purchased"{% if selected_status == 'purchased' %} selected{% endif %}>Purchased</option><option value="all"{% if selected_status == 'all' %} selected{% endif %}>All</option></select></label><button type="submit">Filter</button></form><div id="grocery-list" aria-live="polite">{% include 'groceries/partials/list.html' %}</div></section></div>
|
|
{% endblock %}
|