From 372dd0afa1c326bf9eb4be10c85003052614de94 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 8 Jul 2020 21:55:17 +0200 Subject: [PATCH] recipe step sidebar no name --- .../templates/forms/edit_internal_recipe.html | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/cookbook/templates/forms/edit_internal_recipe.html b/cookbook/templates/forms/edit_internal_recipe.html index d71ba9287..1472e5f9f 100644 --- a/cookbook/templates/forms/edit_internal_recipe.html +++ b/cookbook/templates/forms/edit_internal_recipe.html @@ -379,7 +379,10 @@
- [[step.name]] + + + +
@@ -446,7 +449,7 @@ this.searchKeywords('') }, methods: { - makeToast: function(title, message, variant=null) { + makeToast: function (title, message, variant = null) { //TODO remove duplicate function in favor of central one this.$bvToast.toast(message, { title: title, @@ -468,7 +471,7 @@ }).catch((err) => { this.loading = false 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) { @@ -479,14 +482,14 @@ this.$http.put("{% url 'api:recipe-detail' recipe.pk %}", this.recipe, {}).then((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 if (view_after) { location.href = "{% url 'view_recipe' 12345 %}".replace(/12345/, this.recipe.id); } }).catch((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) { @@ -496,11 +499,11 @@ this.$http.put("{% url 'api:recipe-detail' recipe.pk %}" + 'image/', fd, {headers: {'Content-Type': 'multipart/form-data'}}).then((response) => { console.log(response) - this.makeToast('{% trans 'Updated' %}','{% trans 'Changes saved successfully!' %}', 'success') + this.makeToast('{% trans 'Updated' %}', '{% trans 'Changes saved successfully!' %}', 'success') }).catch((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(); @@ -579,7 +582,7 @@ this.keywords_loading = false }).catch((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) { @@ -598,7 +601,7 @@ } this.units_loading = false }).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) { @@ -618,7 +621,7 @@ this.foods_loading = false }).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) {