updated javascript files
This commit is contained in:
parent
486c871cb5
commit
910dc29f06
@ -84,7 +84,7 @@ class ExternalRecipeForm(forms.ModelForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Recipe
|
model = Recipe
|
||||||
fields = (
|
fields = (
|
||||||
'name', 'keywords', 'working_time', 'waiting_time',
|
'name', 'keywords', 'description', 'servings', 'working_time', 'waiting_time',
|
||||||
'file_path', 'storage', 'file_uid'
|
'file_path', 'storage', 'file_uid'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -162,6 +162,9 @@ def recipe_view(request, pk, share=None):
|
|||||||
servings__gt=0
|
servings__gt=0
|
||||||
).all().aggregate(Avg('servings'))['servings__avg']
|
).all().aggregate(Avg('servings'))['servings__avg']
|
||||||
|
|
||||||
|
if not user_servings:
|
||||||
|
user_servings = 0
|
||||||
|
|
||||||
if request.user.is_authenticated:
|
if request.user.is_authenticated:
|
||||||
if not ViewLog.objects \
|
if not ViewLog.objects \
|
||||||
.filter(recipe=recipe) \
|
.filter(recipe=recipe) \
|
||||||
|
@ -118,13 +118,16 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="recipe.file_path.includes('.pdf')">
|
<template v-if="!recipe.internal">
|
||||||
<PdfViewer :recipe="recipe"></PdfViewer>
|
<div v-if="recipe.file_path.includes('.pdf')">
|
||||||
</div>
|
<PdfViewer :recipe="recipe"></PdfViewer>
|
||||||
<div
|
</div>
|
||||||
v-if="recipe.file_path.includes('.png') || recipe.file_path.includes('.jpg') || recipe.file_path.includes('.jpeg')">
|
<div
|
||||||
<ImageViewer :recipe="recipe"></ImageViewer>
|
v-if="recipe.file_path.includes('.png') || recipe.file_path.includes('.jpg') || recipe.file_path.includes('.jpeg')">
|
||||||
</div>
|
<ImageViewer :recipe="recipe"></ImageViewer>
|
||||||
|
</div>
|
||||||
|
</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 :recipe="recipe" :step="s" :ingredient_factor="ingredient_factor" :index="index" :start_time="start_time"
|
<Step :recipe="recipe" :step="s" :ingredient_factor="ingredient_factor" :index="index" :start_time="start_time"
|
||||||
@ -144,7 +147,7 @@ import {apiLoadRecipe} from "@/utils/api";
|
|||||||
|
|
||||||
import Step from "@/components/Step";
|
import Step from "@/components/Step";
|
||||||
import RecipeContextMenu from "@/components/RecipeContextMenu";
|
import RecipeContextMenu from "@/components/RecipeContextMenu";
|
||||||
import {GettextMixin, ToastMixin} from "@/utils/utils";
|
import {GettextMixin, ResolveUrlMixin, ToastMixin} from "@/utils/utils";
|
||||||
import Ingredient from "@/components/Ingredient";
|
import Ingredient from "@/components/Ingredient";
|
||||||
|
|
||||||
import PdfViewer from "@/components/PdfViewer";
|
import PdfViewer from "@/components/PdfViewer";
|
||||||
@ -163,6 +166,7 @@ export default {
|
|||||||
name: 'RecipeView',
|
name: 'RecipeView',
|
||||||
mixins: [
|
mixins: [
|
||||||
GettextMixin,
|
GettextMixin,
|
||||||
|
ResolveUrlMixin,
|
||||||
ToastMixin,
|
ToastMixin,
|
||||||
],
|
],
|
||||||
components: {
|
components: {
|
||||||
|
@ -8,8 +8,13 @@
|
|||||||
</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)"><i
|
||||||
class="fas fa-pencil-alt fa-fw"></i> {{ _('Edit') }}</a>
|
class="fas fa-pencil-alt fa-fw"></i> {{ _('Edit') }}</a>
|
||||||
|
|
||||||
|
<a class="dropdown-item" :href="resolveDjangoUrl('edit_convert_recipe', recipe.id)" v-if="!recipe.internal"><i
|
||||||
|
class="fas fa-exchange-alt fa-fw"></i> {{ _('Convert to internal recipe') }}</a>
|
||||||
|
|
||||||
<button class="dropdown-item" onclick="$('#bookmarkModal').modal({'show':true})">
|
<button class="dropdown-item" onclick="$('#bookmarkModal').modal({'show':true})">
|
||||||
<i class="fas fa-bookmark fa-fw"></i> {{ _('Add to Book') }}
|
<i class="fas fa-bookmark fa-fw"></i> {{ _('Add to Book') }}
|
||||||
</button>
|
</button>
|
||||||
|
@ -1 +1 @@
|
|||||||
{"status":"done","publicPath":"http://localhost:8080/","chunks":{"chunk-vendors":[{"name":"js/chunk-vendors.js","publicPath":"http://localhost:8080/js/chunk-vendors.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\chunk-vendors.js"}],"recipe_view":[{"name":"js/recipe_view.js","publicPath":"http://localhost:8080/js/recipe_view.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\recipe_view.js"},{"name":"recipe_view.5c9c79044479f9c9ebe7.hot-update.js","publicPath":"http://localhost:8080/recipe_view.5c9c79044479f9c9ebe7.hot-update.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\recipe_view.5c9c79044479f9c9ebe7.hot-update.js"}]},"error":"ModuleError","message":"Module Error (from ./node_modules/eslint-loader/index.js):\n\nF:\\Developement\\Django\\recipes\\vue\\src\\components\\Keywords.vue\n 3:7 error Elements in iteration expect to have 'v-bind:key' directives vue/require-v-for-key\n\n✖ 1 problem (1 error, 0 warnings)\n"}
|
{"status":"compiling","publicPath":"http://localhost:8080/"}
|
Loading…
Reference in New Issue
Block a user