mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 03:10:00 +00:00
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.
44 lines
1.5 KiB
HTML
44 lines
1.5 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div class="card mb-4" style="max-width: 600px;">
|
|
<div class="card-header">
|
|
<h5 class="card-title mb-0">{{ item.name }}</h5>
|
|
<small class="text-muted">Barcode: {{ item.barcode }}</small>
|
|
</div>
|
|
<div class="card-body">
|
|
<dl class="row">
|
|
<dt class="col-sm-5">Energy per 100g</dt>
|
|
<dd class="col-sm-7">{{ item.energy_100 }} kcal</dd>
|
|
|
|
<dt class="col-sm-5">Protein per 100g</dt>
|
|
<dd class="col-sm-7">{{ "%.1f"|format(item.protein_100) }} g</dd>
|
|
|
|
<dt class="col-sm-5">Carbohydrates per 100g</dt>
|
|
<dd class="col-sm-7">{{ "%.1f"|format(item.carbs_100) }} g</dd>
|
|
|
|
<dt class="col-sm-5">Sugar per 100g</dt>
|
|
<dd class="col-sm-7">
|
|
{% if item.sugar_100 is not none %}
|
|
{{ "%.1f"|format(item.sugar_100) }} g
|
|
{% else %}
|
|
<span class="text-muted">N/A</span>
|
|
{% endif %}
|
|
</dd>
|
|
|
|
<dt class="col-sm-5">fat per 100g</dt>
|
|
<dd class="col-sm-7">{{ "%.1f"|format(item.fat_100) }} g</dd>
|
|
|
|
<dt class="col-sm-5">Saturated fat per 100g</dt>
|
|
<dd class="col-sm-7">
|
|
{% if item.saturated_fat_100 is not none %}
|
|
{{ "%.1f"|format(item.saturated_fat_100) }} g
|
|
{% else %}
|
|
<span class="text-muted">N/A</span>
|
|
{% endif %}
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock%} |