Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Simplify the nutrition tables

Roland Geider6f44e8c4ed7a
diff --git a/wger/nutrition/templates/log/detail.html b/wger/nutrition/templates/log/detail.html
index 529ae96b4..9b85857dc 100644
--- a/wger/nutrition/templates/log/detail.html
+++ b/wger/nutrition/templates/log/detail.html
@@ -36,33 +36,33 @@
<tbody>
<tr>
<td>{% trans "Energy" %}</td>
- <td class="align-right">{{ nutritional_data.total.energy|floatformat }} {% trans "kcal" %}</td>
- <td class="align-right">{{ log_summary.energy|floatformat }} {% trans "kcal" %}</td>
+ <td class="align-right">{{ nutritional_data.total.energy|floatformat:0 }} {% trans "kcal" %}</td>
+ <td class="align-right">{{ log_summary.energy|floatformat:0 }} {% trans "kcal" %}</td>
</tr>
<tr>
<td>{% trans "Protein" %}</td>
- <td class="align-right">{{ nutritional_data.total.protein|floatformat }} {% trans_weight_unit 'g' owner_user %}</td>
- <td class="align-right">{{ log_summary.protein|floatformat }} {% trans_weight_unit 'g' owner_user %}</td>
+ <td class="align-right">{{ nutritional_data.total.protein|floatformat:1 }} {% trans_weight_unit 'g' owner_user %}</td>
+ <td class="align-right">{{ log_summary.protein|floatformat:1 }} {% trans_weight_unit 'g' owner_user %}</td>
</tr>
<tr>
<td>{% trans "Carbohydrates" %}</td>
- <td class="align-right">{{ nutritional_data.total.carbohydrates|floatformat }} {% trans_weight_unit 'g' owner_user %}</td>
- <td class="align-right">{{ log_summary.carbohydrates|floatformat }} {% trans_weight_unit 'g' owner_user %}</td>
+ <td class="align-right">{{ nutritional_data.total.carbohydrates|floatformat:1 }} {% trans_weight_unit 'g' owner_user %}</td>
+ <td class="align-right">{{ log_summary.carbohydrates|floatformat:1 }} {% trans_weight_unit 'g' owner_user %}</td>
</tr>
<tr>
<td class="pl-4">{% trans "Sugar content in carbohydrates" %}</td>
- <td class="align-right">{{ nutritional_data.total.carbohydrates_sugar|floatformat }} {% trans_weight_unit 'g' owner_user %}</td>
- <td class="align-right">{{ log_summary.carbohydrates_sugar|floatformat }} {% trans_weight_unit 'g' owner_user %}</td>
+ <td class="align-right">{{ nutritional_data.total.carbohydrates_sugar|floatformat:1 }} {% trans_weight_unit 'g' owner_user %}</td>
+ <td class="align-right">{{ log_summary.carbohydrates_sugar|floatformat:1 }} {% trans_weight_unit 'g' owner_user %}</td>
</tr>
<tr>
<td>{% trans "Fat" %}</td>
- <td class="align-right">{{ nutritional_data.total.fat|floatformat }} {% trans_weight_unit 'g' owner_user %}</td>
- <td class="align-right">{{ log_summary.fat|floatformat }} {% trans_weight_unit 'g' owner_user %}</td>
+ <td class="align-right">{{ nutritional_data.total.fat|floatformat:1 }} {% trans_weight_unit 'g' owner_user %}</td>
+ <td class="align-right">{{ log_summary.fat|floatformat:1 }} {% trans_weight_unit 'g' owner_user %}</td>
</tr>
<tr>
<td class="pl-4">{% trans "Saturated fat content in fats" %}</td>
- <td class="align-right">{{ nutritional_data.total.fat_saturated|floatformat }} {% trans_weight_unit 'g' owner_user %}</td>
- <td class="align-right">{{ log_summary.fat_saturated|floatformat }} {% trans_weight_unit 'g' owner_user %}</td>
+ <td class="align-right">{{ nutritional_data.total.fat_saturated|floatformat:1 }} {% trans_weight_unit 'g' owner_user %}</td>
+ <td class="align-right">{{ log_summary.fat_saturated|floatformat:1 }} {% trans_weight_unit 'g' owner_user %}</td>
</tr>
@@ -108,7 +108,7 @@
</td>
<td class="align-right">
- {{ entry.get_nutritional_values.energy }} {% trans "kcal" %}
+ {{ entry.get_nutritional_values.energy|floatformat:0 }} {% trans "kcal" %}
</td>
{% if is_owner %}
<td>
diff --git a/wger/nutrition/templates/log/overview.html b/wger/nutrition/templates/log/overview.html
index 486c2ca1a..1c38128ed 100644
--- a/wger/nutrition/templates/log/overview.html
+++ b/wger/nutrition/templates/log/overview.html
@@ -4,7 +4,7 @@
{# #}
{# Title #}
{# #}
-{% block title %}{% trans "Nutrition diary" %}{% endblock %}
+{% block title %}{% trans "Nutrition diary" %} - {{ log_data.0.planned_calories|floatformat:0 }} {% trans "kcal" %}{% endblock %}
@@ -24,11 +24,10 @@
{# Content #}
{# #}
{% block content %}
- <table class="table table-condensed">
+<table class="table table-condensed">
<thead>
<tr>
<th>{% trans "Date" %}</th>
- <th class="align-right">{% trans "Planned" %}</th>
<th class="align-right">{% trans "Logged" %}</th>
<th class="align-right">{% trans "Difference" %}</th>
</tr>
@@ -42,13 +41,10 @@
</a>
</td>
<td class="align-right">
- {{ entry.planned_calories|floatformat }} {% trans "kcal" %}
+ {{ entry.logged_calories|floatformat:0 }} {% trans "kcal" %}
</td>
<td class="align-right">
- {{ entry.logged_calories }} {% trans "kcal" %}
- </td>
- <td class="align-right">
- {{ entry.difference }}
+ {{ entry.difference|floatformat:0 }}
</td>
</tr>
{% empty %}
diff --git a/wger/nutrition/templates/plan/view.html b/wger/nutrition/templates/plan/view.html
index 1cec2694d..ed609aebe 100644
--- a/wger/nutrition/templates/plan/view.html
+++ b/wger/nutrition/templates/plan/view.html
@@ -84,7 +84,7 @@ function wgerCustomModalInit()
</a>
<a href="{% url 'nutrition:meal_item:add' meal.id %}" class="wger-modal-dialog edit-meal dropdown-item">
<span class="{% fa_class 'plus' %}"></span>
- {% trans 'Add' %}
+ {% trans 'Add ingredient to meal' %}
</a>
<a href="{% url 'nutrition:meal:edit' meal.id %}" class="wger-modal-dialog dropdown-item">
<span class="{% fa_class 'edit' %}"></span>
@@ -198,7 +198,7 @@ function wgerCustomModalInit()
<tbody>
<tr>
<td>{% trans "Energy" %}</td>
- <td class="align-right">{{nutritional_data.total.energy|floatformat:1}} {% trans "kcal" %}</td>
+ <td class="align-right">{{nutritional_data.total.energy|floatformat:0}} {% trans "kcal" %}</td>
<td></td>
<td></td>
</tr>
@@ -253,14 +253,13 @@ function wgerCustomModalInit()
</table>
-<h4>{% trans "Nutrition diary" %}</h4>
+<h4>{% trans "Nutrition diary" %} - {{nutritional_data.total.energy|floatformat:0}}{% trans "kcal" %}</h4>
<div id="nutrition_diary_chart"></div>
<table class="table table-condensed">
<thead>
<tr>
<th>{% trans "Date" %}</th>
- <th class="align-right">{% trans "Planned" %}</th>
<th class="align-right">{% trans "Logged" %}</th>
<th class="align-right">{% trans "Difference" %}</th>
</tr>
@@ -274,13 +273,10 @@ function wgerCustomModalInit()
</a>
</td>
<td class="align-right">
- {{ entry.planned_calories|floatformat }} {% trans "kcal" %}
+ {{ entry.logged_calories|floatformat:0 }} {% trans "kcal" %}
</td>
<td class="align-right">
- {{ entry.logged_calories }} {% trans "kcal" %}
- </td>
- <td class="align-right">
- {{ entry.difference }}
+ {{ entry.difference|floatformat:0 }}
</td>
</tr>
{% empty %}
@@ -293,7 +289,7 @@ function wgerCustomModalInit()
{% if log_data %}
<tr>
<td colspan="4">
- <a href="{% url 'nutrition:log:overview' plan.pk %}" class="btn btn-link btn-block">{% trans "View details" %}</a>
+ <a href="{% url 'nutrition:log:overview' plan.pk %}" class="btn btn-link btn-block">{% trans "View complete nutrition log" %}</a>
</td>
</tr>
{% endif %}
@@ -314,7 +310,7 @@ function wgerCustomModalInit()
<thead>
<tr>
<th>{% trans "Energy" %}</th>
- <th class="align-right">{{nutritional_data.total.energy|floatformat}} {% trans "kcal" %}</th>
+ <th class="align-right">{{nutritional_data.total.energy|floatformat:0}} {% trans "kcal" %}</th>
</tr>
</thead>
<tbody>