mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 03:10:00 +00:00
Renamed FoodItems to FoodItem and Units to Unit in models.py, updated related imports and usage throughout the codebase. Added a barcode scanner test page using ZXing in the admin section. Improved food_items.html to display nutritional information in a table. Registered the admin blueprint in app.py and cleaned up blueprint registration in __init__.py. Updated seed.py to use the new FoodItem model.
40 lines
1.2 KiB
HTML
40 lines
1.2 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}
|
|
Food Nutritional Info
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container mt-5">
|
|
<h1 class="mb-4">Food Nutritional Information (per 100g)</h1>
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered table-hover align-middle">
|
|
<thead class="table-dark">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Energy (kcal)</th>
|
|
<th>Fats (g)</th>
|
|
<th>Saturated Fats (g)</th>
|
|
<th>Sugars (g)</th>
|
|
<th>Carbs (g)</th>
|
|
<th>Protein (g)</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for food in items %}
|
|
<tr>
|
|
<td>{{ food.name }}</td>
|
|
<td>{{ food.energy_100g }}</td>
|
|
<td>{{ food.fats_100g }}</td>
|
|
<td>{{ food.saturated_fats_100g }}</td>
|
|
<td>{{ food.sugar_100g }}</td>
|
|
<td>{{ food.carbs_100g }}</td>
|
|
<td>{{ food.protein_100g }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock%} |