fixed print from card when recipe is not open
This commit is contained in:
parent
12a8582a9a
commit
36c30f9e11
@ -75,7 +75,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col col-md-2 col-2 mt-2 mt-md-0 text-right">
|
<div class="col col-md-2 col-2 mt-2 mt-md-0 text-right">
|
||||||
<recipe-context-menu v-bind:recipe="recipe" :servings="servings"></recipe-context-menu>
|
<recipe-context-menu v-bind:recipe="recipe" :servings="servings" :disabled_options="{print:false}"></recipe-context-menu>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
<hr/>
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
<template v-if="recipe && recipe.loading">
|
<template v-if="recipe && recipe.loading">
|
||||||
<b-card no-body v-hover>
|
<b-card no-body v-hover>
|
||||||
<b-card-img-lazy style="height: 15vh; object-fit: cover" class="" :src="placeholder_image"
|
<b-card-img-lazy style="height: 15vh; object-fit: cover" class="" :src="placeholder_image"
|
||||||
v-bind:alt="$t('Recipe_Image')" top></b-card-img-lazy>
|
v-bind:alt="$t('Recipe_Image')" top></b-card-img-lazy>
|
||||||
|
|
||||||
<b-card-body class="p-4">
|
<b-card-body class="p-4">
|
||||||
<h6>
|
<h6>
|
||||||
<b-skeleton width="95%"></b-skeleton>
|
<b-skeleton width="95%"></b-skeleton>
|
||||||
</h6>
|
</h6>
|
||||||
|
|
||||||
<b-card-text>
|
<b-card-text>
|
||||||
<b-skeleton height="12px" :width="(45 + Math.random() * 45).toString() + '%'"></b-skeleton>
|
<b-skeleton height="12px" :width="(45 + Math.random() * 45).toString() + '%'"></b-skeleton>
|
||||||
<b-skeleton height="12px" :width="(20 + Math.random() * 25).toString() + '%'"></b-skeleton>
|
<b-skeleton height="12px" :width="(20 + Math.random() * 25).toString() + '%'"></b-skeleton>
|
||||||
<b-skeleton height="12px" :width="(30 + Math.random() * 35).toString() + '%'"></b-skeleton>
|
<b-skeleton height="12px" :width="(30 + Math.random() * 35).toString() + '%'"></b-skeleton>
|
||||||
</b-card-text>
|
</b-card-text>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
class="card-img-overlay h-100 d-flex flex-column justify-content-right float-right text-right pt-2 pr-1"
|
class="card-img-overlay h-100 d-flex flex-column justify-content-right float-right text-right pt-2 pr-1"
|
||||||
v-if="show_context_menu">
|
v-if="show_context_menu">
|
||||||
<a>
|
<a>
|
||||||
<recipe-context-menu :recipe="recipe" class="float-right"
|
<recipe-context-menu :recipe="recipe" class="float-right" :disabled_options="context_disabled_options"
|
||||||
v-if="recipe !== null"></recipe-context-menu>
|
v-if="recipe !== null"></recipe-context-menu>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -124,7 +124,8 @@ export default {
|
|||||||
footer_text: String,
|
footer_text: String,
|
||||||
footer_icon: String,
|
footer_icon: String,
|
||||||
detailed: {type: Boolean, default: true},
|
detailed: {type: Boolean, default: true},
|
||||||
show_context_menu: {type: Boolean, default: true}
|
show_context_menu: {type: Boolean, default: true},
|
||||||
|
context_disabled_options: Object,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -7,54 +7,54 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuLink">
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuLink">
|
||||||
<a class="dropdown-item" :href="resolveDjangoUrl('edit_recipe', recipe.id)"><i
|
<a class="dropdown-item" :href="resolveDjangoUrl('edit_recipe', recipe.id)" v-if="!disabled_options.edit"><i
|
||||||
class="fas fa-pencil-alt fa-fw"></i> {{ $t("Edit") }}</a>
|
class="fas fa-pencil-alt fa-fw"></i> {{ $t("Edit") }}</a>
|
||||||
|
|
||||||
<a class="dropdown-item" :href="resolveDjangoUrl('edit_convert_recipe', recipe.id)"
|
<a class="dropdown-item" :href="resolveDjangoUrl('edit_convert_recipe', recipe.id)"
|
||||||
v-if="!recipe.internal"><i class="fas fa-exchange-alt fa-fw"></i> {{ $t("convert_internal") }}</a>
|
v-if="!recipe.internal && !disabled_options.convert"><i class="fas fa-exchange-alt fa-fw"></i> {{ $t("convert_internal") }}</a>
|
||||||
|
|
||||||
<a href="javascript:void(0);">
|
<a href="javascript:void(0);">
|
||||||
<button class="dropdown-item" @click="$bvModal.show(`id_modal_add_book_${modal_id}`)"><i
|
<button class="dropdown-item" @click="$bvModal.show(`id_modal_add_book_${modal_id}`)" v-if="!disabled_options.books"><i
|
||||||
class="fas fa-bookmark fa-fw"></i> {{ $t("Manage_Books") }}
|
class="fas fa-bookmark fa-fw"></i> {{ $t("Manage_Books") }}
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="dropdown-item" v-if="recipe.internal" @click="addToShopping" href="#"> <i
|
<a class="dropdown-item" v-if="recipe.internal && !disabled_options.shopping" @click="addToShopping" href="#" > <i
|
||||||
class="fas fa-shopping-cart fa-fw"></i> {{ $t("Add_to_Shopping") }} </a>
|
class="fas fa-shopping-cart fa-fw"></i> {{ $t("Add_to_Shopping") }} </a>
|
||||||
|
|
||||||
<a class="dropdown-item" @click="createMealPlan" href="javascript:void(0);"><i
|
<a class="dropdown-item" @click="createMealPlan" href="javascript:void(0);" v-if="!disabled_options.plan"><i
|
||||||
class="fas fa-calendar fa-fw"></i> {{ $t("Add_to_Plan") }} </a>
|
class="fas fa-calendar fa-fw"></i> {{ $t("Add_to_Plan") }} </a>
|
||||||
|
|
||||||
<a href="javascript:void(0);">
|
<a href="javascript:void(0);">
|
||||||
<button class="dropdown-item" @click="$bvModal.show(`id_modal_cook_log_${modal_id}`)"><i
|
<button class="dropdown-item" @click="$bvModal.show(`id_modal_cook_log_${modal_id}`)" v-if="!disabled_options.log"><i
|
||||||
class="fas fa-clipboard-list fa-fw"></i> {{ $t("Log_Cooking") }}
|
class="fas fa-clipboard-list fa-fw"></i> {{ $t("Log_Cooking") }}
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="javascript:void(0);">
|
<a href="javascript:void(0);">
|
||||||
<button class="dropdown-item" onclick="window.print()">
|
<button class="dropdown-item" onclick="window.print()" v-if="!disabled_options.print">
|
||||||
<i class="fas fa-print fa-fw"></i>
|
<i class="fas fa-print fa-fw"></i>
|
||||||
{{ $t("Print") }}
|
{{ $t("Print") }}
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
<a href="javascript:void(0);">
|
<a href="javascript:void(0);">
|
||||||
<button class="dropdown-item" @click="copyToNew"><i class="fas fa-copy fa-fw"></i>
|
<button class="dropdown-item" @click="copyToNew" v-if="!disabled_options.copy"><i class="fas fa-copy fa-fw"></i>
|
||||||
{{ $t("copy_to_new") }}
|
{{ $t("copy_to_new") }}
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="dropdown-item" :href="resolveDjangoUrl('view_export') + '?r=' + recipe.id" target="_blank"
|
<a class="dropdown-item" :href="resolveDjangoUrl('view_export') + '?r=' + recipe.id" target="_blank"
|
||||||
rel="noopener noreferrer"><i class="fas fa-file-export fa-fw"></i> {{ $t("Export") }}</a>
|
rel="noopener noreferrer" v-if="!disabled_options.export"><i class="fas fa-file-export fa-fw"></i> {{ $t("Export") }}</a>
|
||||||
|
|
||||||
<a href="javascript:void(0);">
|
<a href="javascript:void(0);">
|
||||||
<button class="dropdown-item" @click="pinRecipe()">
|
<button class="dropdown-item" @click="pinRecipe()" v-if="!disabled_options.pin">
|
||||||
<i class="fas fa-thumbtack fa-fw"></i>
|
<i class="fas fa-thumbtack fa-fw"></i>
|
||||||
{{ $t("Pin") }}
|
{{ $t("Pin") }}
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="javascript:void(0);">
|
<a href="javascript:void(0);">
|
||||||
<button class="dropdown-item" @click="createShareLink()" v-if="recipe.internal"><i
|
<button class="dropdown-item" @click="createShareLink()" v-if="recipe.internal && !disabled_options.share" ><i
|
||||||
class="fas fa-share-alt fa-fw"></i> {{ $t("Share") }}
|
class="fas fa-share-alt fa-fw"></i> {{ $t("Share") }}
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
@ -147,6 +147,10 @@ export default {
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: -1,
|
default: -1,
|
||||||
},
|
},
|
||||||
|
disabled_options: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({print:true}),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.servings_value = this.servings === -1 ? this.recipe.servings : this.servings
|
this.servings_value = this.servings === -1 ? this.recipe.servings : this.servings
|
||||||
|
Loading…
Reference in New Issue
Block a user