mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
importing improvements
This commit is contained in:
@@ -73,6 +73,7 @@
|
||||
<th>{% trans 'Amount' %}</th>
|
||||
<th>{% trans 'Unit' %}</th>
|
||||
<th>{% trans 'Ingredient' %}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -81,9 +82,18 @@
|
||||
<td><input class="form-control" v-model="i.amount"></td>
|
||||
<td><input class="form-control" v-model="i.unit"></td>
|
||||
<td><input class="form-control" v-model="i.ingredient"></td>
|
||||
<td style="vertical-align: middle;text-align: center">
|
||||
<button class="btn btn-outline-danger" type="button" @click="deleteIngredient(i)"><i
|
||||
class="fas fa-trash-alt"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="text-align: center">
|
||||
<button class="btn btn-success" type="button" @click="addIngredient()"><i class="fas fa-plus"></i></button>
|
||||
<br/><br/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -179,7 +189,7 @@
|
||||
delimiters: ['[[', ']]'],
|
||||
el: '#app',
|
||||
data: {
|
||||
remote_url: 'https://www.rezeptschachtel.de/schwarzwaelder_kirschtorte_rezept.html',
|
||||
remote_url: '',
|
||||
keywords: [],
|
||||
recipe_data: undefined,
|
||||
error: undefined,
|
||||
@@ -187,7 +197,6 @@
|
||||
all_keywords: false,
|
||||
},
|
||||
mounted: function () {
|
||||
this.loadRecipe();
|
||||
this.getKeywords();
|
||||
},
|
||||
methods: {
|
||||
@@ -212,6 +221,16 @@
|
||||
console.log("dragChanged create error", err);
|
||||
})
|
||||
},
|
||||
deleteIngredient: function (i) {
|
||||
this.recipe_data.recipeIngredient = this.recipe_data.recipeIngredient.filter(item => item !== i)
|
||||
},
|
||||
addIngredient: function (i) {
|
||||
this.recipe_data.recipeIngredient.push({
|
||||
unit: '{{ request.user.userpreference.default_unit }}',
|
||||
amount: 0,
|
||||
ingredient: ''
|
||||
})
|
||||
},
|
||||
getKeywords: function () {
|
||||
this.$http.get("{% url 'dal_keyword' %}").then((response) => {
|
||||
this.keywords = response.data.results;
|
||||
|
||||
Reference in New Issue
Block a user