more fixes after rebase

This commit is contained in:
smilerz
2021-11-01 16:34:53 -05:00
parent 06b7ba809b
commit e229a70360
7 changed files with 52 additions and 69 deletions

View File

@ -66,6 +66,11 @@ class Migration(migrations.Migration):
name='mealplan', name='mealplan',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='cookbook.mealplan'), field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='cookbook.mealplan'),
), ),
migrations.AddField(
model_name='shoppinglistrecipe',
name='name',
field=models.CharField(blank=True, default='', max_length=32),
),
migrations.AddField( migrations.AddField(
model_name='shoppinglistentry', model_name='shoppinglistentry',
name='ingredient', name='ingredient',

View File

@ -85,4 +85,3 @@
"coa": "2.0.2" "coa": "2.0.2"
} }
} }
}

View File

@ -258,7 +258,7 @@ import "bootstrap-vue/dist/bootstrap-vue.css"
import ContextMenu from "@/components/ContextMenu/ContextMenu" import ContextMenu from "@/components/ContextMenu/ContextMenu"
import ContextMenuItem from "@/components/ContextMenu/ContextMenuItem" import ContextMenuItem from "@/components/ContextMenu/ContextMenuItem"
import MealPlanCard from "@/components/MealPlanCard" import MealPlanCard from "@/components/MealPlanCard"
import MealPlanEditModal from "@/components/MealPlanEditModal" import MealPlanEditModal from "@/components/Modals/MealPlanEditModal"
import MealPlanCalenderHeader from "@/components/MealPlanCalenderHeader" import MealPlanCalenderHeader from "@/components/MealPlanCalenderHeader"
import EmojiInput from "@/components/Modals/EmojiInput" import EmojiInput from "@/components/Modals/EmojiInput"

View File

@ -25,35 +25,9 @@
</div> </div>
<div style="text-align: center"> <div style="text-align: center">
<keywords-component :recipe="recipe"></keywords-component> <keywords-component :recipe="recipe" />
</div> </div>
<hr/>
<div class="row">
<div class="col col-md-3">
<div class="row d-flex" style="padding-left: 16px">
<div class="my-auto" style="padding-right: 4px">
<i class="fas fa-user-clock fa-2x text-primary"></i>
</div>
<div class="my-auto" style="padding-right: 4px">
<span class="text-primary"><b>{{ $t('Preparation') }}</b></span><br/>
{{ recipe.working_time }} {{ $t('min') }}
</div>
<div class="row text-center">
<div class="col col-md-12">
<recipe-rating :recipe="recipe"></recipe-rating>
<last-cooked :recipe="recipe" class="mt-2"></last-cooked>
</div>
</div>
<div class="my-auto">
<div class="col-12" style="text-align: center">
<i>{{ recipe.description }}</i>
</div>
</div>
<hr /> <hr />
<div class="row"> <div class="row">
<div class="col col-md-3"> <div class="col col-md-3">
@ -118,27 +92,33 @@
</div> </div>
</div> </div>
<div class="row" style="margin-top: 2vh; margin-bottom: 2vh"> <div class="row" style="margin-top: 2vh; margin-bottom: 2vh">
<div class="col-12"> <div class="col-12">
<Nutrition-component :recipe="recipe" :ingredient_factor="ingredient_factor"></Nutrition-component> <Nutrition-component :recipe="recipe" :ingredient_factor="ingredient_factor"></Nutrition-component>
</div> </div>
</div> </div>
<add-recipe-to-book :recipe="recipe"></add-recipe-to-book>
<div class="row text-center d-print-none" style="margin-top: 3vh; margin-bottom: 3vh" v-if="share_uid !== 'None'">
<div class="col col-md-12">
<a :href="resolveDjangoUrl('view_report_share_abuse', share_uid)">{{ $t("Report Abuse") }}</a>
</div> </div>
</div> </div>
<template v-if="!recipe.internal">
<div v-if="recipe.file_path.includes('.pdf')">
<PdfViewer :recipe="recipe"></PdfViewer>
</div>
<div v-if="recipe.file_path.includes('.png') || recipe.file_path.includes('.jpg') || recipe.file_path.includes('.jpeg') || recipe.file_path.includes('.gif')">
<ImageViewer :recipe="recipe"></ImageViewer>
</div>
</template> </template>
<div v-for="(s, index) in recipe.steps" v-bind:key="s.id" style="margin-top: 1vh"> <div v-for="(s, index) in recipe.steps" v-bind:key="s.id" style="margin-top: 1vh">
<step-component :recipe="recipe" :step="s" :ingredient_factor="ingredient_factor" :index="index" :start_time="start_time" <step-component
@update-start-time="updateStartTime" @checked-state-changed="updateIngredientCheckedState"></step-component> :recipe="recipe"
:step="s"
:ingredient_factor="ingredient_factor"
:index="index"
:start_time="start_time"
@update-start-time="updateStartTime"
@checked-state-changed="updateIngredientCheckedState"
></step-component>
</div> </div>
</div> </div>
@ -159,7 +139,7 @@ import "bootstrap-vue/dist/bootstrap-vue.css"
import { apiLoadRecipe } from "@/utils/api" import { apiLoadRecipe } from "@/utils/api"
import StepComponent from "@/components/StepComponent"; import StepComponent from "@/components/StepComponent"
import RecipeContextMenu from "@/components/ContextMenu/RecipeContextMenu" import RecipeContextMenu from "@/components/ContextMenu/RecipeContextMenu"
import { ResolveUrlMixin, ToastMixin } from "@/utils/utils" import { ResolveUrlMixin, ToastMixin } from "@/utils/utils"
@ -168,8 +148,8 @@ import ImageViewer from "@/components/ImageViewer"
import IngredientsCard from "@/components/IngredientsCard" import IngredientsCard from "@/components/IngredientsCard"
import moment from "moment" import moment from "moment"
import KeywordsComponent from "@/components/KeywordsComponent"; import KeywordsComponent from "@/components/KeywordsComponent"
import NutritionComponent from "@/components/NutritionComponent"; import NutritionComponent from "@/components/NutritionComponent"
import LoadingSpinner from "@/components/LoadingSpinner" import LoadingSpinner from "@/components/LoadingSpinner"
import AddRecipeToBook from "@/components/Modals/AddRecipeToBook" import AddRecipeToBook from "@/components/Modals/AddRecipeToBook"
import RecipeRating from "@/components/RecipeRating" import RecipeRating from "@/components/RecipeRating"

View File

@ -25,7 +25,7 @@
<!-- eslint-disable vue/no-v-for-template-key-on-child --> <!-- eslint-disable vue/no-v-for-template-key-on-child -->
<template v-for="s in steps"> <template v-for="s in steps">
<template v-for="i in s.ingredients"> <template v-for="i in s.ingredients">
<ingredient <ingredient-component
:ingredient="i" :ingredient="i"
:ingredient_factor="ingredient_factor" :ingredient_factor="ingredient_factor"
:key="i.id" :key="i.id"
@ -52,14 +52,14 @@ import Vue from "vue"
import { BootstrapVue } from "bootstrap-vue" import { BootstrapVue } from "bootstrap-vue"
import "bootstrap-vue/dist/bootstrap-vue.css" import "bootstrap-vue/dist/bootstrap-vue.css"
import Ingredient from "@/components/Ingredient" import IngredientComponent from "@/components/IngredientComponent"
import { ApiMixin, StandardToasts } from "@/utils/utils" import { ApiMixin, StandardToasts } from "@/utils/utils"
Vue.use(BootstrapVue) Vue.use(BootstrapVue)
export default { export default {
name: "IngredientCard", name: "IngredientCard",
mixins: [ApiMixin], mixins: [ApiMixin],
components: { Ingredient }, components: { IngredientComponent },
props: { props: {
steps: { steps: {
type: Array, type: Array,

View File

@ -7,19 +7,12 @@
<recipe-context-menu :recipe="recipe" class="float-right" v-if="recipe !== null"></recipe-context-menu> <recipe-context-menu :recipe="recipe" class="float-right" v-if="recipe !== null"></recipe-context-menu>
</a> </a>
</div> </div>
<div class="card-img-overlay w-50 d-flex flex-column justify-content-left float-left text-left pt-2" v-if="recipe.waiting_time !== 0"> <div class="card-img-overlay w-50 d-flex flex-column justify-content-left float-left text-left pt-2" v-if="recipe.working_time !== 0 || recipe.waiting_time !== 0">
<b-badge pill variant="light" class="mt-1 font-weight-normal"><i class="fa fa-clock"></i> {{ recipe.working_time }} {{ $t("min") }} </b-badge> <b-badge pill variant="light" class="mt-1 font-weight-normal" v-if="recipe.working_time !== 0"
<b-badge pill variant="secondary" class="mt-1 font-weight-normal"><i class="fa fa-pause"></i> {{ recipe.waiting_time }} {{ $t("min") }} </b-badge> ><i class="fa fa-clock"></i> {{ recipe.working_time }} {{ $t("min") }}
</div>
</a>
</div>
<div class="card-img-overlay w-50 d-flex flex-column justify-content-left float-left text-left pt-2"
v-if="recipe.working_time !== 0 || recipe.waiting_time !== 0">
<b-badge pill variant="light" class="mt-1 font-weight-normal" v-if="recipe.working_time !== 0"><i class="fa fa-clock"></i>
{{ recipe.working_time }} {{ $t('min') }}
</b-badge> </b-badge>
<b-badge pill variant="secondary" class="mt-1 font-weight-normal" v-if="recipe.waiting_time !== 0"><i class="fa fa-pause"></i> <b-badge pill variant="secondary" class="mt-1 font-weight-normal" v-if="recipe.waiting_time !== 0"
{{ recipe.waiting_time }} {{ $t('min') }} ><i class="fa fa-pause"></i> {{ recipe.waiting_time }} {{ $t("min") }}
</b-badge> </b-badge>
</div> </div>
</a> </a>
@ -69,7 +62,7 @@
<script> <script>
import RecipeContextMenu from "@/components/ContextMenu/RecipeContextMenu" import RecipeContextMenu from "@/components/ContextMenu/RecipeContextMenu"
import KeywordsComponent from "@/components/KeywordsComponent"; import KeywordsComponent from "@/components/KeywordsComponent"
import { resolveDjangoUrl, ResolveUrlMixin } from "@/utils/utils" import { resolveDjangoUrl, ResolveUrlMixin } from "@/utils/utils"
import RecipeRating from "@/components/RecipeRating" import RecipeRating from "@/components/RecipeRating"
import moment from "moment/moment" import moment from "moment/moment"

View File

@ -2940,6 +2940,12 @@ export interface UserPreference {
* @memberof UserPreference * @memberof UserPreference
*/ */
default_page?: UserPreferenceDefaultPageEnum; default_page?: UserPreferenceDefaultPageEnum;
/**
*
* @type {boolean}
* @memberof UserPreference
*/
use_kj?: boolean;
/** /**
* *
* @type {string} * @type {string}