allow disabling of ingredient overview

This commit is contained in:
vabene1111
2022-06-26 12:36:37 +02:00
parent 7945c1a431
commit 27c695a393
7 changed files with 49 additions and 8 deletions

View File

@ -19,8 +19,14 @@
<label for="id_description">
{{ $t("Description") }}
</label>
<textarea id="id_description" class="form-control" v-model="recipe.description"
<b-input-group >
<textarea id="id_description" class="form-control" v-model="recipe.description"
maxlength="512"></textarea>
<b-input-group-append>
<b-button variant="danger" @click="recipe.description=''"><i class="fas fa-trash-alt"></i></b-button>
</b-input-group-append>
</b-input-group>
</div>
</div>
@ -88,6 +94,11 @@
>
<template v-slot:noOptions>{{ $t("empty_list") }}</template>
</multiselect>
<br/>
<label for="id_name"> {{ $t("Ingredient Overview") }}</label>
<b-form-checkbox v-model="recipe.show_ingredient_overview" >{{$t('show_ingredient_overview')}}</b-form-checkbox>
<br/>
</div>
</div>
@ -558,7 +569,8 @@
<div class="col-md-12">
<label :for="'id_instruction_' + step.id">{{ $t("Instructions") }}</label>
<mavon-editor v-model="step.instruction" :autofocus="false"
style="height: 40vh; z-index: auto" :id="'id_instruction_' + step.id" :language="'en'"
style="height: 40vh; z-index: auto" :id="'id_instruction_' + step.id"
:language="'en'"
:toolbars="md_editor_toolbars"/>
<!-- TODO markdown DOCS link and markdown editor -->
@ -608,7 +620,7 @@
<div class="col-3 col-md-6 mb-1 mb-md-0 pr-2 pl-2">
<a :href="resolveDjangoUrl('delete_recipe', recipe.id)"
class="d-block d-md-none btn btn-block btn-danger shadow-none"><i class="fa fa-trash fa-lg"></i></a>
<a :href="resolveDjangoUrl('delete_recipe', recipe.id)"
<a :href="resolveDjangoUrl('delete_recipe', recipe.id)"
class="d-none d-md-block btn btn-block btn-danger shadow-none">{{ $t("Delete") }}</a>
</div>
<div class="col-3 col-md-6 mb-1 mb-md-0 pr-2 pl-2">
@ -623,11 +635,13 @@
</div>
<div class="col-3 col-md-6 mb-1 mb-md-0 pr-2 pl-2">
<button type="button" @click="updateRecipe(false)" v-b-tooltip.hover
:title="`${$t('Key_Ctrl')} + S`" class="d-block d-md-none btn btn-sm btn-block btn-info shadow-none">
:title="`${$t('Key_Ctrl')} + S`"
class="d-block d-md-none btn btn-sm btn-block btn-info shadow-none">
<i class="fa fa-save fa-lg"></i>
</button>
<button type="button" @click="updateRecipe(false)" v-b-tooltip.hover
:title="`${$t('Key_Ctrl')} + S`" class="d-none d-md-block btn btn-sm btn-block btn-info shadow-none">
<button type="button" @click="updateRecipe(false)" v-b-tooltip.hover
:title="`${$t('Key_Ctrl')} + S`"
class="d-none d-md-block btn btn-sm btn-block btn-info shadow-none">
{{ $t("Save") }}
</button>
</div>

View File

@ -82,7 +82,7 @@
<div class="row">
<div class="col-md-6 order-md-1 col-sm-12 order-sm-2 col-12 order-2"
v-if="recipe && ingredient_count > 0">
v-if="recipe && ingredient_count > 0 && (recipe.show_ingredient_overview || recipe.steps.length < 2)">
<ingredients-card
:recipe="recipe.id"
:steps="recipe.steps"

View File

@ -371,6 +371,8 @@
"ChildInheritFields": "Children Inherit Fields",
"ChildInheritFields_help": "Children will inherit these fields by default.",
"InheritFields_help": "The values of these fields will be inherited from parent (Exception: blank shopping categories are not inherited)",
"show_ingredient_overview": "Display a list of all ingredients at the start of the recipe.",
"Ingredient Overview": "Ingredient Overview",
"last_viewed": "Last Viewed",
"created_on": "Created On",
"updatedon": "Updated On",

View File

@ -1851,6 +1851,12 @@ export interface Recipe {
* @memberof Recipe
*/
internal?: boolean;
/**
*
* @type {boolean}
* @memberof Recipe
*/
show_ingredient_overview?: boolean;
/**
*
* @type {RecipeNutrition}