Merge branch 'develop' into feature/spaces

# Conflicts:
#	cookbook/views/data.py
#	cookbook/views/views.py
This commit is contained in:
vabene1111
2021-02-25 15:59:32 +01:00
19 changed files with 2353 additions and 962 deletions

View File

@@ -77,6 +77,9 @@
:hide-selected="true"
:preserve-search="true"
placeholder="{% trans 'Select Keywords' %}"
tag-placeholder="{% trans 'Add Keyword' %}"
:taggable="true"
@tag="addKeyword"
label="label"
track-by="id"
id="id_keywords"
@@ -667,6 +670,10 @@
this.units.push(new_unit.unit)
this.recipe.steps[step].ingredients[id] = new_unit
},
addKeyword: function (tag) {
let new_keyword = {'label':tag,'name':tag}
this.recipe.keywords.push(new_keyword)
},
searchKeywords: function (query) {
this.keywords_loading = true
this.$http.get("{% url 'api:keyword-list' %}" + '?query=' + query + '&limit=10').then((response) => {

View File

@@ -542,6 +542,7 @@
this.loadShoppingList()
{% if recipes %}
this.loading = true
this.edit_mode = true
let loadingRecipes = []
@@ -605,6 +606,7 @@
})
},
loadInitialRecipe: function (recipe, servings) {
servings = 1 //TODO temporary until i can actually fix the servings for this #453
return this.$http.get('{% url 'api:recipe-detail' 123456 %}'.replace('123456', recipe)).then((response) => {
this.addRecipeToList(response.data, servings)
}).catch((err) => {

View File

@@ -190,6 +190,9 @@
:hide-selected="true"
:preserve-search="true"
placeholder="{% trans 'Select one' %}"
tag-placeholder="{% trans 'Add Keyword' %}"
:taggable="true"
@tag="addKeyword"
label="text"
track-by="id"
id="id_keywords"
@@ -357,6 +360,10 @@
this.units.push(new_unit.unit)
this.recipe_data.recipeIngredient[index] = new_unit
},
addKeyword: function (tag) {
let new_keyword = {'text':tag,'id':null}
this.recipe_data.keywords.push(new_keyword)
},
openUnitSelect: function (id) {
let index = id.replace('unit_', '')
if (this.recipe_data.recipeIngredient[index].unit !== null) {