mirror of
https://github.com/sstent/foodplanner.git
synced 2026-01-25 11:11:36 +00:00
unit consistency changes
This commit is contained in:
@@ -166,7 +166,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="serving-info">
|
||||
{{ "%.1f"|format(meal_food.num_servings) }} × {{ meal_food.serving_size }}{{ meal_food.serving_unit }} ({{ "%.0f"|format(meal_food.total_grams) }}g)
|
||||
{{ "%.0f"|format(meal_food.total_grams) }}g ({{ "%.2f"|format(meal_food.num_servings) }} servings of {{ meal_food.serving_size }}{{ meal_food.serving_unit }})
|
||||
</div>
|
||||
</td>
|
||||
<td class="nutrient-value">{{ "%.0f"|format(meal_food.calories) }}</td>
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="serving-info">
|
||||
{{ "%.1f"|format(meal_food.num_servings) }} × {{ meal_food.serving_size }}{{ meal_food.serving_unit }} ({{ "%.0f"|format(meal_food.total_grams) }}g)
|
||||
{{ "%.0f"|format(meal_food.total_grams) }}g ({{ "%.2f"|format(meal_food.num_servings) }} servings of {{ meal_food.serving_size }}{{ meal_food.serving_unit }})
|
||||
</div>
|
||||
</td>
|
||||
<td class="nutrient-value">{{ "%.0f"|format(meal_food.calories) }}</td>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
{% if meal.meal_foods %}
|
||||
<ul class="list-unstyled">
|
||||
{% for meal_food in meal.meal_foods %}
|
||||
<li>{{ "%.2f" | format(meal_food.quantity) }}g × {{ meal_food.food.name }}</li>
|
||||
<li>{{ meal_food.quantity }}g of {{ meal_food.food.name }} ({{ (meal_food.quantity / meal_food.food.serving_size)|round(2) }} servings of {{ meal_food.food.serving_size }}{{ meal_food.food.serving_unit }})</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Quantity</label>
|
||||
<input type="number" step="0.01" class="form-control" name="quantity" value="1" required>
|
||||
<label class="form-label">Quantity (g)</label>
|
||||
<input type="number" step="0.01" class="form-control" name="quantity" value="100" placeholder="Enter weight in grams" required>
|
||||
</div>
|
||||
<button type="button" class="btn btn-success" onclick="addFoodToTrackedMeal()">Add Food</button>
|
||||
</form>
|
||||
|
||||
5
templates/test_template.html
Normal file
5
templates/test_template.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<h1>Test Template</h1>
|
||||
<p>This is a test template to check if inheritance works.</p>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user