Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions www/activities/foods-meals-recipes/js/foods-meals-recipes.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,12 @@ app.FoodsMealsRecipes = {
portion.innerText += " \u00D7 "; // times symbol

portion.innerText += app.Utils.tidyNumber(parseFloat(item.quantity));

if (app.Settings.get("diary", "show-total-portion-size") == true) {
let totalPortionSize = item.portion * item.quantity;
let totalPortionSizeText = " (= " + app.Utils.tidyNumber(parseFloat(totalPortionSize), item.unit) + ")";
portion.innerText += totalPortionSizeText;
}
}

inner.appendChild(portion);
Expand Down
3 changes: 2 additions & 1 deletion www/activities/settings/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,8 @@ app.Settings = {
"show-all-nutriments": false,
"show-macro-nutriments-summary": false,
"show-nutrition-units": false,
"prompt-add-items": false
"prompt-add-items": false,
"show-total-portion-size": false
},
foodlist: {
labels: app.FoodsCategories.defaultLabels,
Expand Down
14 changes: 14 additions & 0 deletions www/activities/settings/views/diary.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,20 @@
</div>
</li>

<li>
<div class="item-content">
<div class="item-inner">
<div class="item-title" data-localize="settings.diary.show-total-portion-size">Show Total Portion Size</div>
<div class="item-after">
<label class="toggle toggle-init">
<input type="checkbox" field="diary" name="show-total-portion-size" />
<span class="toggle-icon"></span>
</label>
</div>
</div>
</div>
</li>

</ul>
</div>

Expand Down
3 changes: 2 additions & 1 deletion www/assets/locales/locale-de.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@
"show-all-nutriments": "Alle Nährstoffe auf Übersichtsseite anzeigen",
"show-units": "Nährstoffeinheiten anzeigen",
"prompt-add-items": "Beim Hinzufügen von Einträgen Menge abfragen",
"show-macro-nutriments-summary": "Makro-Nährstoffe pro Kategorie anzeigen"
"show-macro-nutriments-summary": "Makro-Nährstoffe pro Kategorie anzeigen",
"show-total-portion-size": "Gesamtportionsgröße anzeigen"
},
"nutriments": {
"title": "Nährstoffe",
Expand Down
3 changes: 2 additions & 1 deletion www/assets/locales/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@
"show-all-nutriments": "Show all nutrients on Overview page",
"show-units": "Show nutrition units",
"prompt-add-items": "Prompt for quantity when adding items",
"show-macro-nutriments-summary": "Show macros summary per category"
"show-macro-nutriments-summary": "Show macros summary per category",
"show-total-portion-size": "Show Total Portion Size"
},
"nutriments": {
"title": "Nutrients",
Expand Down