mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
sorting and ingredient adding
This commit is contained in:
@@ -70,6 +70,13 @@
|
||||
<h3>Step</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label :for="'id_step_' + step.id + 'name'">{% trans 'Step Name' %}</label>
|
||||
<input class="form-control" v-model="step.name" :id="'id_step_' + step.id + 'name'">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<draggable :list="step.ingredients" group="ingredients"
|
||||
@@ -129,6 +136,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</draggable>
|
||||
|
||||
<button class="btn btn-success" @click="addIngredient(step)"><i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -209,6 +218,15 @@
|
||||
element.order = index
|
||||
});
|
||||
},
|
||||
addIngredient: function (step) { //TODO see if default can be generated from options request
|
||||
step.ingredients.push({
|
||||
'food': undefined,
|
||||
'unit': undefined,
|
||||
'amount': 0,
|
||||
'note': '',
|
||||
})
|
||||
this.sortStep(step)
|
||||
},
|
||||
searchKeywords: function (query) {
|
||||
this.keywords_loading = true
|
||||
this.$http.get("{% url 'api:keyword-list' %}" + '?query=' + query + '&limit=10').then((response) => {
|
||||
|
||||
Reference in New Issue
Block a user