From 41eef9a913bbba6eb62a8090da1169fafe5b2b8b Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 1 Jul 2020 21:42:46 +0200 Subject: [PATCH] step sorting buttons --- .../templates/forms/edit_internal_recipe.html | 53 +++++++++++++++---- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/cookbook/templates/forms/edit_internal_recipe.html b/cookbook/templates/forms/edit_internal_recipe.html index 9298e17eb..ad0a8072e 100644 --- a/cookbook/templates/forms/edit_internal_recipe.html +++ b/cookbook/templates/forms/edit_internal_recipe.html @@ -91,8 +91,30 @@
- + + + + +
@@ -283,16 +305,20 @@ +
+
+ + + + {% trans 'View Recipe' %} +
+ +
- - - - {% trans 'View Recipe' %} -
-
@@ -441,6 +467,11 @@ this.recipe.steps = this.recipe.steps.filter(item => item !== step) } }, + moveStep: function (step, new_index) { + this.recipe.steps.splice(this.recipe.steps.indexOf(step), 1); + this.recipe.steps.splice((new_index < 0 ? 0 : new_index), 0, step); + this.sortSteps() + }, addFoodType: function (tag, index) { let [tmp, step, id] = index.split('_')