Merge pull request #2539 from srwareham/hide-step-ingredients

Added option: Hide step ingredients
This commit is contained in:
vabene1111
2023-08-24 10:33:57 +02:00
committed by GitHub
32 changed files with 87 additions and 38 deletions

View File

@ -31,6 +31,12 @@
</b-form-checkbox>
</b-form-group>
<b-form-group :description="$t('show_step_ingredients_setting_help')">
<b-form-checkbox v-model="user_preferences.show_step_ingredients" @change="updateSettings(false);">
{{ $t('show_step_ingredients_setting') }}
</b-form-checkbox>
</b-form-group>
<hr/>

View File

@ -33,7 +33,7 @@
<div class="row">
<!-- ingredients table -->
<div class="col col-md-4"
v-if="step.ingredients.length > 0 && (recipe.steps.length > 1 || force_ingredients)">
v-if="step.show_ingredients_table && step.ingredients.length > 0 && (recipe.steps.length > 1 || force_ingredients)">
<table class="table table-sm">
<ingredients-card :steps="[step]" :ingredient_factor="ingredient_factor"
@checked-state-changed="$emit('checked-state-changed', $event)"/>
@ -124,10 +124,7 @@
</template>
<script>
import {calculateAmount} from "@/utils/utils"
import {GettextMixin} from "@/utils/utils"
import {calculateAmount, GettextMixin, getUserPreference} from "@/utils/utils"
import CompileComponent from "@/components/CompileComponent"
import IngredientsCard from "@/components/IngredientsCard"
import Vue from "vue"