summaryrefslogtreecommitdiff
path: root/kitchen/templates/kitchen/partials/pantry_expiry_edit.html
diff options
context:
space:
mode:
Diffstat (limited to 'kitchen/templates/kitchen/partials/pantry_expiry_edit.html')
-rw-r--r--kitchen/templates/kitchen/partials/pantry_expiry_edit.html17
1 files changed, 17 insertions, 0 deletions
diff --git a/kitchen/templates/kitchen/partials/pantry_expiry_edit.html b/kitchen/templates/kitchen/partials/pantry_expiry_edit.html
new file mode 100644
index 0000000..ca24716
--- /dev/null
+++ b/kitchen/templates/kitchen/partials/pantry_expiry_edit.html
@@ -0,0 +1,17 @@
+<tr id="pantry-row-{{ item.id }}">
+ <td>{{ item.ingredient.name }}</td>
+ <td>{{ item.quantity|floatformat:0 }} {{ item.unit }}</td>
+ <td colspan="2">
+ <form style="display: flex; gap: 0.4rem; align-items: center;"
+ hx-post="{% url 'app-pantry-save-expiry' item.id %}"
+ hx-target="#pantry-items"
+ hx-swap="innerHTML">
+ <input type="date" name="expiry_date" value="{{ item.expiry_date|date:'Y-m-d' }}" style="font-size: 0.8rem;">
+ <button type="submit" class="btn btn-primary btn-sm">Save</button>
+ <button type="button" class="btn btn-secondary btn-sm"
+ hx-get="{% url 'app-pantry-cancel-edit' %}"
+ hx-target="#pantry-items"
+ hx-swap="innerHTML">Cancel</button>
+ </form>
+ </td>
+</tr>