mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 11:19:59 +00:00
Add manual food item entry and update food item management
Introduces a new route and template for manually adding food items. Updates food item edit and delete operations to use the food item's ID instead of barcode and adds ownership checks. Adjusts form and model to make barcode optional, and updates navigation and dashboard templates to reflect these changes.
This commit is contained in:
@@ -33,10 +33,10 @@ Food Nutritional Info
|
||||
<td class="bg-body-tertiary">{{ food.protein_100 }}</td>
|
||||
<td class="bg-body-tertiary">
|
||||
<div class="d-flex gap-1">
|
||||
<form method="GET" action="{{ url_for('user.edit_food_item', barcode=food.barcode) }}">
|
||||
<form method="GET" action="{{ url_for('user.edit_food_item', id=food.id) }}">
|
||||
<button type="submit" class="btn btn-warning btn-sm">Edit</button>
|
||||
</form>
|
||||
<form method="POST" action="{{ url_for('user.delete_food_item', barcode=food.barcode) }}"
|
||||
<form method="POST" action="{{ url_for('user.delete_food_item', id=food.id) }}"
|
||||
onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<button type="submit" class="btn btn-danger btn-sm">Delete</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user