mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-09 08:08:24 -05:00
Merge pull request #390 from smilerz/develop
Add keywords during edit & url import
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -78,3 +78,4 @@ postgresql/
|
|||||||
|
|
||||||
/docker-compose.override.yml
|
/docker-compose.override.yml
|
||||||
vue/node_modules
|
vue/node_modules
|
||||||
|
.vscode/
|
||||||
|
|||||||
@@ -77,6 +77,9 @@
|
|||||||
:hide-selected="true"
|
:hide-selected="true"
|
||||||
:preserve-search="true"
|
:preserve-search="true"
|
||||||
placeholder="{% trans 'Select Keywords' %}"
|
placeholder="{% trans 'Select Keywords' %}"
|
||||||
|
tag-placeholder="{% trans 'Add Keyword' %}"
|
||||||
|
:taggable="true"
|
||||||
|
@tag="addKeyword"
|
||||||
label="label"
|
label="label"
|
||||||
track-by="id"
|
track-by="id"
|
||||||
id="id_keywords"
|
id="id_keywords"
|
||||||
@@ -667,6 +670,10 @@
|
|||||||
this.units.push(new_unit.unit)
|
this.units.push(new_unit.unit)
|
||||||
this.recipe.steps[step].ingredients[id] = new_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) {
|
searchKeywords: function (query) {
|
||||||
this.keywords_loading = true
|
this.keywords_loading = true
|
||||||
this.$http.get("{% url 'api:keyword-list' %}" + '?query=' + query + '&limit=10').then((response) => {
|
this.$http.get("{% url 'api:keyword-list' %}" + '?query=' + query + '&limit=10').then((response) => {
|
||||||
|
|||||||
@@ -190,6 +190,9 @@
|
|||||||
:hide-selected="true"
|
:hide-selected="true"
|
||||||
:preserve-search="true"
|
:preserve-search="true"
|
||||||
placeholder="{% trans 'Select one' %}"
|
placeholder="{% trans 'Select one' %}"
|
||||||
|
tag-placeholder="{% trans 'Add Keyword' %}"
|
||||||
|
:taggable="true"
|
||||||
|
@tag="addKeyword"
|
||||||
label="text"
|
label="text"
|
||||||
track-by="id"
|
track-by="id"
|
||||||
id="id_keywords"
|
id="id_keywords"
|
||||||
@@ -357,6 +360,10 @@
|
|||||||
this.units.push(new_unit.unit)
|
this.units.push(new_unit.unit)
|
||||||
this.recipe_data.recipeIngredient[index] = new_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) {
|
openUnitSelect: function (id) {
|
||||||
let index = id.replace('unit_', '')
|
let index = id.replace('unit_', '')
|
||||||
if (this.recipe_data.recipeIngredient[index].unit !== null) {
|
if (this.recipe_data.recipeIngredient[index].unit !== null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user