From c4ca4348edc5c4fd6cc36e9833fbb9c697f3bf9d Mon Sep 17 00:00:00 2001 From: Caine Date: Thu, 2 Apr 2026 23:08:43 +0100 Subject: Phase 4: HTMX frontend with dark palette - 4 pages: Pantry, Recipes, Shopping List, Cook Log - HTMX-powered: add/delete pantry items, toggle shopping, generate smart list - Custom 13-colour palette from Lospec (dark bg, yellow accent) - Mobile-responsive - Whitenoise for static files in production - All routes under /app/ - API (/api/) stays internal, frontend (/app/) for browser use --- kitchen/templates/kitchen/base.html | 409 +++++++++++++++++++++ kitchen/templates/kitchen/log.html | 10 + kitchen/templates/kitchen/pantry.html | 43 +++ kitchen/templates/kitchen/partials/cook_log.html | 31 ++ .../templates/kitchen/partials/pantry_table.html | 82 +++++ .../templates/kitchen/partials/recipe_list.html | 63 ++++ .../templates/kitchen/partials/shopping_list.html | 25 ++ kitchen/templates/kitchen/recipes.html | 10 + kitchen/templates/kitchen/shopping.html | 26 ++ 9 files changed, 699 insertions(+) create mode 100644 kitchen/templates/kitchen/base.html create mode 100644 kitchen/templates/kitchen/log.html create mode 100644 kitchen/templates/kitchen/pantry.html create mode 100644 kitchen/templates/kitchen/partials/cook_log.html create mode 100644 kitchen/templates/kitchen/partials/pantry_table.html create mode 100644 kitchen/templates/kitchen/partials/recipe_list.html create mode 100644 kitchen/templates/kitchen/partials/shopping_list.html create mode 100644 kitchen/templates/kitchen/recipes.html create mode 100644 kitchen/templates/kitchen/shopping.html (limited to 'kitchen/templates') diff --git a/kitchen/templates/kitchen/base.html b/kitchen/templates/kitchen/base.html new file mode 100644 index 0000000..0bdc5f3 --- /dev/null +++ b/kitchen/templates/kitchen/base.html @@ -0,0 +1,409 @@ +{% load static %} + + + + + + {% block title %}Kitchen{% endblock %} + + + + + + +
+ {% block content %}{% endblock %} +
+ + diff --git a/kitchen/templates/kitchen/log.html b/kitchen/templates/kitchen/log.html new file mode 100644 index 0000000..d45defb --- /dev/null +++ b/kitchen/templates/kitchen/log.html @@ -0,0 +1,10 @@ +{% extends "kitchen/base.html" %} +{% block title %}Cook Log — Kitchen{% endblock %} + +{% block content %} +

Cook Log

+ +
+ {% include "kitchen/partials/cook_log.html" %} +
+{% endblock %} diff --git a/kitchen/templates/kitchen/pantry.html b/kitchen/templates/kitchen/pantry.html new file mode 100644 index 0000000..fac4d91 --- /dev/null +++ b/kitchen/templates/kitchen/pantry.html @@ -0,0 +1,43 @@ +{% extends "kitchen/base.html" %} +{% block title %}Pantry — Kitchen{% endblock %} + +{% block content %} +

Pantry

+ + +
+
+ {% csrf_token %} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+ + +
+ {% include "kitchen/partials/pantry_table.html" %} +
+{% endblock %} diff --git a/kitchen/templates/kitchen/partials/cook_log.html b/kitchen/templates/kitchen/partials/cook_log.html new file mode 100644 index 0000000..e0450f5 --- /dev/null +++ b/kitchen/templates/kitchen/partials/cook_log.html @@ -0,0 +1,31 @@ +{% for entry in entries %} +
+
{{ entry.date|date:"j M" }}
+
+
+ {{ entry.recipe_name }} + {% if entry.rating %} + + {% for i in "12345" %}{% if forloop.counter <= entry.rating %}★{% else %}{% endif %}{% endfor %} + + {% endif %} +
+ {% if entry.slot_choices %} +
+ {% for slot, choice in entry.slot_choices.items %} + {{ choice }} + {% endfor %} +
+ {% endif %} + {% if entry.notes %} +
{{ entry.notes }}
+ {% endif %} +
{{ entry.servings }} serving{{ entry.servings|pluralize }}
+
+
+{% empty %} +
+
📝
+

No cooks logged yet.

+
+{% endfor %} diff --git a/kitchen/templates/kitchen/partials/pantry_table.html b/kitchen/templates/kitchen/partials/pantry_table.html new file mode 100644 index 0000000..507eb17 --- /dev/null +++ b/kitchen/templates/kitchen/partials/pantry_table.html @@ -0,0 +1,82 @@ +{% if fridge_items or freezer_items or cupboard_items %} + +{% if fridge_items %} +

🧊 Fridge

+ + + + {% for item in fridge_items %} + + + + + + + {% endfor %} + +
ItemQtyExpiry
{{ item.ingredient.name }}{{ item.quantity|floatformat:0 }} {{ item.unit }} + {% if item.is_expired %} + Expired {{ item.expiry_date }} + {% elif item.expiring_soon %} + {{ item.expiry_date }} + {% elif item.expiry_date %} + {{ item.expiry_date }} + {% else %} + + {% endif %} + + +
+{% endif %} + +{% if freezer_items %} +

❄️ Freezer

+ + + + {% for item in freezer_items %} + + + + + + {% endfor %} + +
ItemQty
{{ item.ingredient.name }}{{ item.quantity|floatformat:0 }} {{ item.unit }} + +
+{% endif %} + +{% if cupboard_items %} +

🗄️ Cupboard

+ + + + {% for item in cupboard_items %} + + + + + + {% endfor %} + +
ItemQty
{{ item.ingredient.name }}{% if item.is_staple %} STAPLE{% endif %}{{ item.quantity|floatformat:0 }} {{ item.unit }} + +
+{% endif %} + +{% else %} +
+
🥡
+

Pantry's empty. Add some items above.

+
+{% endif %} diff --git a/kitchen/templates/kitchen/partials/recipe_list.html b/kitchen/templates/kitchen/partials/recipe_list.html new file mode 100644 index 0000000..6f6b777 --- /dev/null +++ b/kitchen/templates/kitchen/partials/recipe_list.html @@ -0,0 +1,63 @@ +{% for recipe in recipes %} +
+
+ + {% if recipe.status == 'ready' %} + ✅ Ready + {% elif recipe.status == 'partial' %} + ⚠️ Partial + {% else %} + ❌ Missing + {% endif %} + {{ recipe.name }} + + {% if recipe.type == 'meta_recipe' %} + {{ recipe.gear }} + {% endif %} +
+ + {% if recipe.type == 'meta_recipe' %} + {% for slot in recipe.slots %} +
+
+ {{ slot.name }} + {% if not slot.required %}(optional){% endif %} +
+
+ {% for opt in slot.available_options %} + + {{ opt.ingredient }} + + {% endfor %} + {% for opt in slot.missing_options %} + + {{ opt.ingredient }} + + {% endfor %} +
+
+ {% endfor %} + + {% if recipe.base_missing %} +
+ + Missing base: {% for b in recipe.base_missing %}{{ b.ingredient }} ({{ b.needed }}){% if not forloop.last %}, {% endif %}{% endfor %} + +
+ {% endif %} + {% endif %} + + {% if recipe.warnings %} +
+ {% for w in recipe.warnings %} + ⚠ {{ w }}
+ {% endfor %} +
+ {% endif %} +
+{% empty %} +
+
📖
+

No recipes yet.

+
+{% endfor %} diff --git a/kitchen/templates/kitchen/partials/shopping_list.html b/kitchen/templates/kitchen/partials/shopping_list.html new file mode 100644 index 0000000..67e1bfc --- /dev/null +++ b/kitchen/templates/kitchen/partials/shopping_list.html @@ -0,0 +1,25 @@ +{% regroup items by section as sections %} +{% for section in sections %} +
{{ section.grouper|default:"Other" }}
+{% for item in section.list %} +
+ + + {{ item.name }} + {% if item.quantity %}× {{ item.quantity|floatformat:0 }} {{ item.unit }}{% endif %} + + {% if item.reason %} + {{ item.reason }} + {% endif %} +
+{% endfor %} +{% empty %} +
+
🛒
+

Shopping list is empty. Hit "Generate Smart List" to get suggestions.

+
+{% endfor %} diff --git a/kitchen/templates/kitchen/recipes.html b/kitchen/templates/kitchen/recipes.html new file mode 100644 index 0000000..d77b1bb --- /dev/null +++ b/kitchen/templates/kitchen/recipes.html @@ -0,0 +1,10 @@ +{% extends "kitchen/base.html" %} +{% block title %}Recipes — Kitchen{% endblock %} + +{% block content %} +

What Can I Cook?

+ +
+ {% include "kitchen/partials/recipe_list.html" %} +
+{% endblock %} diff --git a/kitchen/templates/kitchen/shopping.html b/kitchen/templates/kitchen/shopping.html new file mode 100644 index 0000000..ba2990f --- /dev/null +++ b/kitchen/templates/kitchen/shopping.html @@ -0,0 +1,26 @@ +{% extends "kitchen/base.html" %} +{% block title %}Shopping List — Kitchen{% endblock %} + +{% block content %} +

Shopping List

+ +
+ + +
+ +
+ {% include "kitchen/partials/shopping_list.html" %} +
+{% endblock %} -- cgit v1.2.3