mirror of
https://github.com/sstent/foodplanner.git
synced 2026-02-15 15:25:25 +00:00
sync - build workin
This commit is contained in:
5
main.py
5
main.py
@@ -1810,6 +1810,8 @@ async def detailed(request: Request, person: str = "Sarah", plan_date: str = Non
|
|||||||
'protein': mf.food.protein * mf.quantity,
|
'protein': mf.food.protein * mf.quantity,
|
||||||
'carbs': mf.food.carbs * mf.quantity,
|
'carbs': mf.food.carbs * mf.quantity,
|
||||||
'fat': mf.food.fat * mf.quantity,
|
'fat': mf.food.fat * mf.quantity,
|
||||||
|
'fiber': mf.food.fiber * mf.quantity,
|
||||||
|
'sodium': mf.food.sodium * mf.quantity,
|
||||||
})
|
})
|
||||||
|
|
||||||
meal_details.append({
|
meal_details.append({
|
||||||
@@ -2179,6 +2181,9 @@ async def test_route():
|
|||||||
@app.get("/templates", response_class=HTMLResponse)
|
@app.get("/templates", response_class=HTMLResponse)
|
||||||
async def templates_page(request: Request, db: Session = Depends(get_db)):
|
async def templates_page(request: Request, db: Session = Depends(get_db)):
|
||||||
templates_list = db.query(Template).all()
|
templates_list = db.query(Template).all()
|
||||||
|
logging.info(f"DEBUG: templates_list contains {len(templates_list)} templates.")
|
||||||
|
for t in templates_list:
|
||||||
|
logging.info(f"DEBUG: Template object: {t.__dict__}")
|
||||||
meals = db.query(Meal).all()
|
meals = db.query(Meal).all()
|
||||||
return templates.TemplateResponse(request, "templates.html", {"templates": templates_list, "meals": meals})
|
return templates.TemplateResponse(request, "templates.html", {"templates": templates_list, "meals": meals})
|
||||||
|
|
||||||
|
|||||||
@@ -180,8 +180,8 @@
|
|||||||
<td class="nutrient-value">{{ "%.1f"|format(meal_food.protein) }}g</td>
|
<td class="nutrient-value">{{ "%.1f"|format(meal_food.protein) }}g</td>
|
||||||
<td class="nutrient-value">{{ "%.1f"|format(meal_food.carbs) }}g</td>
|
<td class="nutrient-value">{{ "%.1f"|format(meal_food.carbs) }}g</td>
|
||||||
<td class="nutrient-value">{{ "%.1f"|format(meal_food.fat) }}g</td>
|
<td class="nutrient-value">{{ "%.1f"|format(meal_food.fat) }}g</td>
|
||||||
<td class="nutrient-value">{{ "%.1f"|format(meal_food.fiber or 0) }}g</td>
|
<td class="nutrient-value">{{ "%.1f"|format(meal_food['fiber']|float) }}g</td>
|
||||||
<td class="nutrient-value">{{ "%.0f"|format(meal_food.sodium or 0) }}mg</td>
|
<td class="nutrient-value">{{ "%.0f"|format(meal_food['sodium']|float) }}mg</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<!-- Meal Totals Row -->
|
<!-- Meal Totals Row -->
|
||||||
|
|||||||
Reference in New Issue
Block a user