added plural migration and pass param trough in recipe view

This commit is contained in:
vabene1111
2022-11-22 07:58:12 +01:00
parent f92ee32c01
commit 39ccf7bbcf
5 changed files with 57 additions and 6 deletions

View File

@@ -18,11 +18,11 @@
<td @click="done">
<template v-if="ingredient.unit !== null && !ingredient.no_amount">
<template v-if="!use_plural">
<span>{{ ingredient.unit.name }}
<span>{{ ingredient.unit.name }}</span>
</template>
<template v-else>
<template v-if="ingredient.unit.plural_name === '' || ingredient.unit.plural_name === null">
<span>{{ ingredient.unit.name }}
<span>{{ ingredient.unit.name }}</span>
</template>
<template v-else>
<span v-if="ingredient.always_use_plural_unit">{{ ingredient.unit.plural_name}}</span>

View File

@@ -35,7 +35,7 @@
<div class="col col-md-4"
v-if="step.ingredients.length > 0 && (recipe.steps.length > 1 || force_ingredients)">
<table class="table table-sm">
<ingredients-card :steps="[step]" :ingredient_factor="ingredient_factor"
<ingredients-card :steps="[step]" :ingredient_factor="ingredient_factor" :use_plural="use_plural"
@checked-state-changed="$emit('checked-state-changed', $event)"/>
</table>
</div>
@@ -90,6 +90,7 @@
:index="index"
:start_time="start_time"
:force_ingredients="true"
:use_plural="use_plural"
></step-component>
</div>
</div>
@@ -149,6 +150,10 @@ export default {
type: Boolean,
default: false,
},
use_plural: {
type: Boolean,
default: false,
},
},
computed: {
step_time: function() {