diff --git a/vue/src/components/PropertyViewComponent.vue b/vue/src/components/PropertyViewComponent.vue index f4f5ceac..44222274 100644 --- a/vue/src/components/PropertyViewComponent.vue +++ b/vue/src/components/PropertyViewComponent.vue @@ -8,13 +8,6 @@
{{ $t('Properties') }}
- {{ $t('per_serving') }} - {{ $t('total') }} - - - - -
{{ $t('Food') }} @@ -31,13 +24,20 @@ + + + + + + - + +
{{ $t('per_serving') }}{{ $t('total') }}
{{ p.icon }} {{ p.name }} {{ get_amount(p.property_amount) }}{{ p.property_amount_per_serving }}{{ p.property_amount_total }} {{ p.unit }} @@ -97,7 +97,6 @@ export default { selected_property: undefined, selected_food: undefined, show_food_edit_modal: false, - show_total: false, show_recipe_properties: false, } }, @@ -128,7 +127,8 @@ export default { 'description': rp.property_type.description, 'icon': rp.property_type.icon, 'food_values': [], - 'property_amount': rp.property_amount, + 'property_amount_per_serving': rp.property_amount, + 'property_amount_total': rp.property_amount * this.recipe.servings * (this.servings / this.recipe.servings), 'missing_value': false, 'unit': rp.property_type.unit, } @@ -143,7 +143,8 @@ export default { 'description': fp.description, 'icon': fp.icon, 'food_values': fp.food_values, - 'property_amount': fp.total_value, + 'property_amount_per_serving': fp.total_value / this.recipe.servings, + 'property_amount_total': fp.total_value * (this.servings / this.recipe.servings), 'missing_value': fp.missing_value, 'unit': fp.unit, } @@ -159,19 +160,6 @@ export default { } }, methods: { - get_amount: function (amount) { - if (this.show_total) { - return (amount * (this.servings / this.recipe.servings)).toLocaleString(window.CUSTOM_LOCALE, { - 'maximumFractionDigits': 2, - 'minimumFractionDigits': 2 - }) - } else { - return (amount / this.recipe.servings).toLocaleString(window.CUSTOM_LOCALE, { - 'maximumFractionDigits': 2, - 'minimumFractionDigits': 2 - }) - } - }, openFoodEditModal: function (food) { console.log(food) let apiClient = ApiApiFactory()