recipe search

main
Mel 3 years ago
parent 425ad27e18
commit 2feb961000

@ -9,8 +9,8 @@
"state": {
"type": "markdown",
"state": {
"file": "00.01 Admin/Templates/layout$qrecipe.md",
"mode": "source"
"file": "03.03 Recipes/@@Recipes.md",
"mode": "preview"
}
}
}
@ -76,7 +76,7 @@
"state": {
"type": "backlink",
"state": {
"file": "00.01 Admin/Templates/layout$qrecipe.md",
"file": "03.03 Recipes/@@Recipes.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@ -115,15 +115,15 @@
},
"active": "c1cbd199334b4022",
"lastOpenFiles": [
"03.03 Recipes/@@Recipes.md",
"03.03 Recipes/Chicken Fried Rice.md",
"03.03 Recipes/@Main dishes.md",
"03.03 Recipes/Indian Buttered Chicken.md",
"03.03 Recipes/Mexican Beef Wrap.md",
"00.01 Admin/Templates/Untitled.md",
"00.01 Admin/Templates/layout$qproduct.md",
"03.03 Recipes/@@Recipes.md",
"00.01 Admin/Templates/layout$qplace.md",
"03.03 Recipes/@Desserts.md",
"03.03 Recipes/Aromatic Beef Pilaf.md",
"01.01 Life Orga/Finances.md",
"01.01 Life Orga/Lifestyle.md",
"03.03 Recipes/Mushroom Fricassée.md",
"03.03 Recipes/@Side dishes.md"
"03.03 Recipes/Aromatic Beef Pilaf.md"
]
}

@ -86,10 +86,9 @@ class globalFunc {
BuildList(arg1, construct) {
let ilength = arg1.length
let TempS = ""
for (let i = 0; i < ilength; i++) {
for (let i = 0; i < arg1.length; i++) {
if (Boolean(arg1[i])) {
if (TempS == "") {
TempS = arg1[i]

@ -0,0 +1,19 @@
let {course, category, cuisine, ingredient, dateadded, theme, isfavourite, rating, cookingtime} = input;
const iArray = [course, category, cuisine, ingredient, dateadded, theme, isfavourite, rating, cookingtime];
const dArray = ["course", "category", "cuisine", "ingredient", "dateadded", "theme", "is favourite", "rating", "cooking time"];
let TempS = ""
for (let i = 0; i < iArray.length; i++) {
if (Boolean(iArray[i])) {
if (TempS == "") {
TempS = dArray[i] + ": " + "<b>" + iArray[i] + "</b>"
} else {
TempS = TempS + "\n• " + dArray[i] + ": " + "<b>" + iArray[i] + "</b>"
}
if (dArray[i].search(new RegExp("time", "i")) > -1) {
TempS = TempS + " <b>min</b>"
}
}
}
dv.el('t', "<b>🔎 search terms:</b> \n• " + TempS);

@ -3,7 +3,7 @@
QueryCourse:
QueryCategory: ""
QueryCuisine: ""
QueryIngredient: "!coriander"
QueryIngredient: chicken
QueryTheme: ""
QueryFavourite:
QueryRating: ""
@ -77,8 +77,7 @@ id EditMetaData
&emsp;
```dataviewjs
dv.view("00.01 Admin/dv-views/print_data", {toprint: [dv.current().QueryCourse, dv.current().QueryCategory, dv.current().QueryCuisine, dv.current().QueryIngredient, dv.current().QueryTheme, dv.current().QueryFavourite, dv.current().QueryRating, dv.current().QueryCookingTime,
dv.current().QueryAddedDate]})
dv.view("00.01 Admin/dv-views/print_recipesearch", {course: dv.current().QueryCourse, dateadded: dv.current().QueryAddedDate, category: dv.current().QueryCategory, cuisine: dv.current().QueryCuisine, ingredient: dv.current().QueryIngredient, theme: dv.current().QueryTheme, isfavourite: dv.current().QueryFavourite, rating: dv.current().QueryRating, cookingtime: dv.current().QueryCookingTime, viewtype: "extended"})
```
&emsp;

Loading…
Cancel
Save