mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-06 22:58:19 -05:00
recipe step sidebar no name
This commit is contained in:
@@ -379,7 +379,10 @@
|
|||||||
<i class="fas fa-clock fa-fw" v-if="step.type == 'TIME'"></i>
|
<i class="fas fa-clock fa-fw" v-if="step.type == 'TIME'"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-fill" style="padding-left: 4px">
|
<div class="flex-fill" style="padding-left: 4px">
|
||||||
<a href="#" v-scroll-to="'#id_step_' + step_index">[[step.name]]</a>
|
<a href="#" v-scroll-to="'#id_step_' + step_index">
|
||||||
|
<template v-if="step.name">[[step.name]]</template>
|
||||||
|
<template v-else>{% trans 'Step' %} [[step_index + 1]]</template>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="handle flex-grow-0 align-content-end">
|
<div class="handle flex-grow-0 align-content-end">
|
||||||
<i class="fas fa-sort "></i>
|
<i class="fas fa-sort "></i>
|
||||||
@@ -446,7 +449,7 @@
|
|||||||
this.searchKeywords('')
|
this.searchKeywords('')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
makeToast: function(title, message, variant=null) {
|
makeToast: function (title, message, variant = null) {
|
||||||
//TODO remove duplicate function in favor of central one
|
//TODO remove duplicate function in favor of central one
|
||||||
this.$bvToast.toast(message, {
|
this.$bvToast.toast(message, {
|
||||||
title: title,
|
title: title,
|
||||||
@@ -468,7 +471,7 @@
|
|||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err)
|
console.log(err)
|
||||||
this.makeToast('{% trans 'Error' %}','{% trans 'There was an error loading the recipe!' %}' + err.bodyText, 'danger')
|
this.makeToast('{% trans 'Error' %}', '{% trans 'There was an error loading the recipe!' %}' + err.bodyText, 'danger')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateRecipe: function (view_after) {
|
updateRecipe: function (view_after) {
|
||||||
@@ -479,14 +482,14 @@
|
|||||||
this.$http.put("{% url 'api:recipe-detail' recipe.pk %}", this.recipe,
|
this.$http.put("{% url 'api:recipe-detail' recipe.pk %}", this.recipe,
|
||||||
{}).then((response) => {
|
{}).then((response) => {
|
||||||
console.log(response)
|
console.log(response)
|
||||||
this.makeToast('{% trans 'Updated' %}','{% trans 'Changes saved successfully!' %}', 'success')
|
this.makeToast('{% trans 'Updated' %}', '{% trans 'Changes saved successfully!' %}', 'success')
|
||||||
this.recipe_changed = false
|
this.recipe_changed = false
|
||||||
if (view_after) {
|
if (view_after) {
|
||||||
location.href = "{% url 'view_recipe' 12345 %}".replace(/12345/, this.recipe.id);
|
location.href = "{% url 'view_recipe' 12345 %}".replace(/12345/, this.recipe.id);
|
||||||
}
|
}
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
this.makeToast('{% trans 'Error' %}','{% trans 'There was an error updating the recipe!' %}' + err.bodyText, 'danger')
|
this.makeToast('{% trans 'Error' %}', '{% trans 'There was an error updating the recipe!' %}' + err.bodyText, 'danger')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
imageChanged: function (event) {
|
imageChanged: function (event) {
|
||||||
@@ -496,11 +499,11 @@
|
|||||||
this.$http.put("{% url 'api:recipe-detail' recipe.pk %}" + 'image/', fd,
|
this.$http.put("{% url 'api:recipe-detail' recipe.pk %}" + 'image/', fd,
|
||||||
{headers: {'Content-Type': 'multipart/form-data'}}).then((response) => {
|
{headers: {'Content-Type': 'multipart/form-data'}}).then((response) => {
|
||||||
console.log(response)
|
console.log(response)
|
||||||
this.makeToast('{% trans 'Updated' %}','{% trans 'Changes saved successfully!' %}', 'success')
|
this.makeToast('{% trans 'Updated' %}', '{% trans 'Changes saved successfully!' %}', 'success')
|
||||||
|
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
this.makeToast('{% trans 'Error' %}','{% trans 'There was an error updating the recipe!' %}' + err.body.image, 'danger')
|
this.makeToast('{% trans 'Error' %}', '{% trans 'There was an error updating the recipe!' %}' + err.body.image, 'danger')
|
||||||
})
|
})
|
||||||
|
|
||||||
let reader = new FileReader();
|
let reader = new FileReader();
|
||||||
@@ -579,7 +582,7 @@
|
|||||||
this.keywords_loading = false
|
this.keywords_loading = false
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
this.makeToast('{% trans 'Error' %}','{% trans 'There was an error loading a resource!' %}' + err.bodyText, 'danger')
|
this.makeToast('{% trans 'Error' %}', '{% trans 'There was an error loading a resource!' %}' + err.bodyText, 'danger')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchUnits: function (query) {
|
searchUnits: function (query) {
|
||||||
@@ -598,7 +601,7 @@
|
|||||||
}
|
}
|
||||||
this.units_loading = false
|
this.units_loading = false
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
this.makeToast('{% trans 'Error' %}','{% trans 'There was an error loading a resource!' %}' + err.bodyText, 'danger')
|
this.makeToast('{% trans 'Error' %}', '{% trans 'There was an error loading a resource!' %}' + err.bodyText, 'danger')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchFoods: function (query) {
|
searchFoods: function (query) {
|
||||||
@@ -618,7 +621,7 @@
|
|||||||
|
|
||||||
this.foods_loading = false
|
this.foods_loading = false
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
this.makeToast('{% trans 'Error' %}','{% trans 'There was an error loading a resource!' %}' + err.bodyText, 'danger')
|
this.makeToast('{% trans 'Error' %}', '{% trans 'There was an error loading a resource!' %}' + err.bodyText, 'danger')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
scrollToStep: function (step_index) {
|
scrollToStep: function (step_index) {
|
||||||
|
|||||||
Reference in New Issue
Block a user