Track presence (In/Low/Out) as the primary signal instead of exact quantities; quantity becomes an optional integer, unit optional too (migration 0003 backfills state from quantity: 0 -> out, else in). - Pantry rebuilt as a phone-first card list: colored state rail, segmented In/Low/Out switch (server-driven HTMX), greyed out-items, live summary counts. - Fast add: bottom add bar with type-ahead autocomplete, location picker, and quick-add chips for things you've run out of. - Per-item menu (move / set expiry / delete); expiry is now an optional quiet pill, never required. - New endpoints: pantry search + set-state; dropped the old edit-expiry/cancel flow and its partial. - Recipes matcher made presence-based (have-it beats have-enough); state added to admin. Tests cover state, add/restock, search, presence matching, and page rendering. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
24 lines
1.2 KiB
Python
24 lines
1.2 KiB
Python
from django.urls import path
|
|
from . import views_htmx
|
|
|
|
urlpatterns = [
|
|
# Full pages
|
|
path("", views_htmx.pantry_page, name="app-pantry"),
|
|
path("recipes/", views_htmx.recipes_page, name="app-recipes"),
|
|
path("shopping/", views_htmx.shopping_page, name="app-shopping"),
|
|
path("log/", views_htmx.log_page, name="app-log"),
|
|
|
|
# HTMX partials — pantry
|
|
path("pantry/add/", views_htmx.pantry_add, name="app-pantry-add"),
|
|
path("pantry/search/", views_htmx.pantry_search, name="app-pantry-search"),
|
|
path("pantry/<int:item_id>/state/", views_htmx.pantry_set_state, name="app-pantry-set-state"),
|
|
path("pantry/<int:item_id>/delete/", views_htmx.pantry_delete, name="app-pantry-delete"),
|
|
path("pantry/<int:item_id>/move/", views_htmx.pantry_move, name="app-pantry-move"),
|
|
path("pantry/<int:item_id>/save-expiry/", views_htmx.pantry_save_expiry, name="app-pantry-save-expiry"),
|
|
|
|
# HTMX partials — shopping
|
|
path("shopping/generate/", views_htmx.shopping_generate, name="app-shopping-generate"),
|
|
path("shopping/<int:item_id>/toggle/", views_htmx.shopping_toggle, name="app-shopping-toggle"),
|
|
path("shopping/clear/", views_htmx.shopping_clear, name="app-shopping-clear"),
|
|
]
|