mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 11:19:59 +00:00
Removed old log for new log
This commit is contained in:
@@ -1,211 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
Food Nutritional Info
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<!-- Daily Overview Section -->
|
||||
<div class="container">
|
||||
|
||||
<div class="mb-4 p-3 border rounded d-flex align-items-center justify-content-between">
|
||||
<!-- Previous Day Button -->
|
||||
<form method="get" action="{{url_for('user.daily_log', offset=offset - 1)}}" class="m-0">
|
||||
<button type="submit" class="btn btn-outline-primary d-flex align-items-center justify-content-center"
|
||||
style="width: 40px; height: 40px;">
|
||||
«
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- Main Content -->
|
||||
<div class="flex-grow-1 text-center">
|
||||
<h2>Daily Overview ({{date}})</h2>
|
||||
|
||||
<!-- Row 1 -->
|
||||
<div class="row justify-content-center text-center mb-2">
|
||||
<div class="col-auto">
|
||||
<strong>Calories:</strong> {{ '%.0f' % calories }} kcal
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<strong>Protein:</strong> {{ '%.1f' % protein }} g
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Row 2 -->
|
||||
<div class="row justify-content-center text-center">
|
||||
<div class="col-auto">
|
||||
<strong>Carbs:</strong> {{ '%.1f' % carbs }} g
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<strong>Fat:</strong> {{ '%.1f' % fat }} g
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Next Day Button -->
|
||||
<form method="get" action="{{url_for('user.daily_log', offset=offset + 1)}}" class="m-0">
|
||||
<button type="submit" class="btn btn-outline-primary d-flex align-items-center justify-content-center"
|
||||
style="width: 40px; height: 40px;">
|
||||
»
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="p-3 border rounded">
|
||||
<div class="text-center">
|
||||
<h2>Eaten today</h2>
|
||||
</div>
|
||||
<div class="p-3 mb-2 border rounded">
|
||||
<!-- Header row (centered vertically for consistency) -->
|
||||
<div class="row align-items-center mb-2">
|
||||
<div class="col">
|
||||
<h4 class="mb-0">Breakfast</h4>
|
||||
</div>
|
||||
<div class="col-auto text-end" style="min-width: 80px;">
|
||||
<h4 class="mb-0">Amount</h4>
|
||||
</div>
|
||||
<div class="col-auto text-end" style="min-width: 80px;">
|
||||
<a href="{{ url_for('add_meal.step1', meal_type=0) }}"
|
||||
class="btn btn-sm btn-primary px-3 py-1">Add</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Data rows -->
|
||||
<div>
|
||||
{% for log in logs[0] %}
|
||||
<div class="row mb-2">
|
||||
<div class="col text-wrap">
|
||||
{{ log.food_item.name }}
|
||||
</div>
|
||||
<div class="col-auto text-end align-self-start" style="min-width: 80px;">
|
||||
{{ "{:g}".format(log.amount) }}
|
||||
</div>
|
||||
<div class="col-auto text-end align-self-start" style="min-width: 80px;">
|
||||
<form method="POST" action="{{url_for('user.remove_log', id=log.id)}}" class="d-inline">
|
||||
<button type="submit" class="btn btn-sm btn-danger px-3 py-1"
|
||||
title="Delete">×</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="p-3 mb-2 border rounded">
|
||||
<!-- Header row (centered vertically for consistency) -->
|
||||
<div class="row align-items-center mb-2">
|
||||
<div class="col">
|
||||
<h4 class="mb-0">Lunch</h4>
|
||||
</div>
|
||||
<div class="col-auto text-end" style="min-width: 80px;">
|
||||
<h4 class="mb-0">Amount</h4>
|
||||
</div>
|
||||
<div class="col-auto text-end" style="min-width: 80px;">
|
||||
<a href="{{ url_for('add_meal.step1', meal_type=1) }}"
|
||||
class="btn btn-sm btn-primary px-3 py-1">Add</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Data rows -->
|
||||
<div>
|
||||
{% for log in logs[1] %}
|
||||
<div class="row mb-2">
|
||||
<div class="col text-wrap">
|
||||
{{ log.food_item.name }}
|
||||
</div>
|
||||
<div class="col-auto text-end align-self-start" style="min-width: 80px;">
|
||||
{{ "{:g}".format(log.amount) }}
|
||||
</div>
|
||||
<div class="col-auto text-end align-self-start" style="min-width: 80px;">
|
||||
<form method="POST" action="{{url_for('user.remove_log', id=log.id)}}" class="d-inline">
|
||||
<button type="submit" class="btn btn-sm btn-danger px-3 py-1"
|
||||
title="Delete">×</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-3 mb-2 border rounded">
|
||||
<!-- Header row (centered vertically for consistency) -->
|
||||
<div class="row align-items-center mb-2">
|
||||
<div class="col">
|
||||
<h4 class="mb-0">Dinner</h4>
|
||||
</div>
|
||||
<div class="col-auto text-end" style="min-width: 80px;">
|
||||
<h4 class="mb-0">Amount</h4>
|
||||
</div>
|
||||
<div class="col-auto text-end" style="min-width: 80px;">
|
||||
<a href="{{ url_for('add_meal.step1', meal_type=2) }}"
|
||||
class="btn btn-sm btn-primary px-3 py-1">Add</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Data rows -->
|
||||
<div>
|
||||
{% for log in logs[2] %}
|
||||
<div class="row mb-2">
|
||||
<div class="col text-wrap">
|
||||
{{ log.food_item.name }}
|
||||
</div>
|
||||
<div class="col-auto text-end align-self-start" style="min-width: 80px;">
|
||||
{{ "{:g}".format(log.amount) }}
|
||||
</div>
|
||||
<div class="col-auto text-end align-self-start" style="min-width: 80px;">
|
||||
<form method="POST" action="{{url_for('user.remove_log', id=log.id)}}" class="d-inline">
|
||||
<button type="submit" class="btn btn-sm btn-danger px-3 py-1"
|
||||
title="Delete">×</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-3 mb-2 border rounded">
|
||||
<!-- Header row (centered vertically for consistency) -->
|
||||
<div class="row align-items-center mb-2">
|
||||
<div class="col">
|
||||
<h4 class="mb-0">Snacks</h4>
|
||||
</div>
|
||||
<div class="col-auto text-end" style="min-width: 80px;">
|
||||
<h4 class="mb-0">Amount</h4>
|
||||
</div>
|
||||
<div class="col-auto text-end" style="min-width: 80px;">
|
||||
<a href="{{ url_for('add_meal.step1', meal_type=3) }}"
|
||||
class="btn btn-sm btn-primary px-3 py-1">Add</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Data rows -->
|
||||
<div>
|
||||
{% for log in logs[3] %}
|
||||
<div class="row mb-2">
|
||||
<div class="col text-wrap">
|
||||
{{ log.food_item.name }}
|
||||
</div>
|
||||
<div class="col-auto text-end align-self-start" style="min-width: 80px;">
|
||||
{{ "{:g}".format(log.amount) }}
|
||||
</div>
|
||||
<div class="col-auto text-end align-self-start" style="min-width: 80px;">
|
||||
<form method="POST" action="{{url_for('user.remove_log', id=log.id)}}" class="d-inline"
|
||||
onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<button type="submit" class="btn btn-sm btn-danger px-3 py-1"
|
||||
title="Delete">×</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock%}
|
||||
@@ -17,10 +17,10 @@
|
||||
<div class="progress rounded" style="height: 24px;">
|
||||
<div class="progress-bar bg-danger macro-bar" role="progressbar"
|
||||
style="width: {{ macro.bar_width_overflow }}%">
|
||||
{{ macro.current - macro.target }}{{ macro.unit }}
|
||||
{{ (macro.current - macro.target) }}{{ macro.unit }}
|
||||
</div>
|
||||
<div class="progress-bar bg-success macro-bar" role="progressbar" style="width: {{ macro.bar_width }}%">
|
||||
{{ macro.current }}{{ macro.unit }}
|
||||
{{ min(macro.current, macro.target) }}{{ macro.unit }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -34,7 +34,7 @@
|
||||
{% for log in logs %}
|
||||
<div class="list-group-item item-row d-flex justify-content-between align-items-center bg-dark text-light">
|
||||
<span>({{ log.amount }}g) {{ log.food_item.name }}</span>
|
||||
<span>{{ log.food_item.energy_100 }} kcal</span>
|
||||
<span>{{ log.food_item.energy_100 * log.amount / 100 }} kcal</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -52,7 +52,7 @@
|
||||
</a>
|
||||
|
||||
<!-- Center Button (highlighted) -->
|
||||
<a id="set_link_date" href="{{ url_for('add_meal_v2.get_barcode', meal_type=0) }}"
|
||||
<a id="set_link_date" href="{{ url_for('add_meal_v2.get_barcode') }}"
|
||||
class="btn btn-success flex-fill mx-2 fw-bold rounded-pill">
|
||||
+ Add Item
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user