2 Commits

Author SHA1 Message Date
Stef
573437f4cf Adjusted GUI of daily dashboard to better deal with float values (#9) 2025-10-08 11:56:20 +02:00
4bc319c32a Revert "Update requirements.txt"
This reverts commit 24a1757166.
2025-08-21 17:05:32 +02:00
2 changed files with 22 additions and 10 deletions

View File

@@ -11,14 +11,14 @@
<h5>Macros</h5> <h5>Macros</h5>
{% for macro in macros %} {% for macro in macros %}
<div class="mb-2"> <div class="mb-2">
<span class="macro-text">{{ macro.name }}: {{ macro.current }} / {{ macro.target }}</span> <span class="macro-text">{{ macro.name }}: {{ macro.current | int }} / {{ macro.target }}</span>
<div class="progress rounded" style="height: 24px;"> <div class="progress rounded" style="height: 24px;">
<div class="progress-bar bg-danger macro-bar" role="progressbar" <div class="progress-bar bg-danger macro-bar" role="progressbar"
style="width: {{ macro.bar_width_overflow }}%"> style="width: {{ macro.bar_width_overflow }}%">
{{ (macro.current - macro.target) }}{{ macro.unit }} {{ (macro.current - macro.target) | int}}{{ macro.unit }}
</div> </div>
<div class="progress-bar bg-success macro-bar" role="progressbar" style="width: {{ macro.bar_width }}%"> <div class="progress-bar bg-success macro-bar" role="progressbar" style="width: {{ macro.bar_width }}%">
{{ min(macro.current, macro.target) }}{{ macro.unit }} {{ min(macro.current, macro.target) | int }}{{ macro.unit }}
</div> </div>
</div> </div>
</div> </div>
@@ -30,15 +30,31 @@
<h5>Items Eaten Today</h5> <h5>Items Eaten Today</h5>
<div class="list-group list-group-flush"> <div class="list-group list-group-flush">
{% for log in logs %} {% for log in logs %}
<div class="list-group-item item-row d-flex justify-content-between align-items-center"> <div class="list-group-item d-flex align-items-center">
<span>({{ log.amount }}g) {{ log.food_item.name }}</span> <!-- Weight: fixed width, right-aligned -->
<span>{{ log.food_item.energy_100 * log.amount / 100 }} kcal</span> <span class="text-end" style="width: 6ch; flex-shrink: 0;">
({{ log.amount | int }}g)
</span>
<!-- Food name: flexible, truncates if too long -->
<span class="text-truncate flex-grow-1"
style="min-width: 0; margin-left: 0.5rem; margin-right: 0.5rem;">
{{ log.food_item.name }}
</span>
<!-- kcal: fixed width, right-aligned, pushed to the right -->
<span class="d-inline-block text-end ms-auto" style="width: 9ch; flex-shrink: 0;">
{{ (log.food_item.energy_100 * log.amount / 100) | int }} kcal
</span>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
</div> </div>
<!-- Bottom Navigation Buttons --> <!-- Bottom Navigation Buttons -->

View File

@@ -1,7 +1,3 @@
# For Python >=3.8, importlib-metadata backport is not needed
python_version >= "3.12.10"
# Package requirements
alembic==1.16.4 alembic==1.16.4
blinker==1.9.0 blinker==1.9.0
click==8.2.1 click==8.2.1