mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-07 15:18:20 -05:00
fix view recipes in Model View
This commit is contained in:
@@ -41,19 +41,19 @@ class RecipeSearch():
|
|||||||
self._string = params.get('string').strip() if params.get('string', None) else None
|
self._string = params.get('string').strip() if params.get('string', None) else None
|
||||||
self._rating = self._params.get('rating', None)
|
self._rating = self._params.get('rating', None)
|
||||||
self._keywords = {
|
self._keywords = {
|
||||||
'or': self._params.get('keywords_or', None),
|
'or': self._params.get('keywords_or', None) or self._params.get('keywords', None),
|
||||||
'and': self._params.get('keywords_and', None),
|
'and': self._params.get('keywords_and', None),
|
||||||
'or_not': self._params.get('keywords_or_not', None),
|
'or_not': self._params.get('keywords_or_not', None),
|
||||||
'and_not': self._params.get('keywords_and_not', None)
|
'and_not': self._params.get('keywords_and_not', None)
|
||||||
}
|
}
|
||||||
self._foods = {
|
self._foods = {
|
||||||
'or': self._params.get('foods_or', None),
|
'or': self._params.get('foods_or', None) or self._params.get('foods', None),
|
||||||
'and': self._params.get('foods_and', None),
|
'and': self._params.get('foods_and', None),
|
||||||
'or_not': self._params.get('foods_or_not', None),
|
'or_not': self._params.get('foods_or_not', None),
|
||||||
'and_not': self._params.get('foods_and_not', None)
|
'and_not': self._params.get('foods_and_not', None)
|
||||||
}
|
}
|
||||||
self._books = {
|
self._books = {
|
||||||
'or': self._params.get('books_or', None),
|
'or': self._params.get('books_or', None) or self._params.get('books', None),
|
||||||
'and': self._params.get('books_and', None),
|
'and': self._params.get('books_and', None),
|
||||||
'or_not': self._params.get('books_or_not', None),
|
'or_not': self._params.get('books_or_not', None),
|
||||||
'and_not': self._params.get('books_and_not', None)
|
'and_not': self._params.get('books_and_not', None)
|
||||||
|
|||||||
@@ -498,7 +498,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col col-md-12">
|
<div class="col col-md-12">
|
||||||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); grid-gap: 0.8rem">
|
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); grid-gap: 0.8rem">
|
||||||
<template v-if="!searchFiltered()">
|
<template v-if="searchFiltered()">
|
||||||
<recipe-card v-bind:key="`mp_${m.id}`" v-for="m in meal_plans" :recipe="m.recipe" :meal_plan="m" :footer_text="m.meal_type_name" footer_icon="far fa-calendar-alt"></recipe-card>
|
<recipe-card v-bind:key="`mp_${m.id}`" v-for="m in meal_plans" :recipe="m.recipe" :meal_plan="m" :footer_text="m.meal_type_name" footer_icon="far fa-calendar-alt"></recipe-card>
|
||||||
</template>
|
</template>
|
||||||
<recipe-card v-for="r in recipes" v-bind:key="r.id" :recipe="r" :footer_text="isRecentOrNew(r)[0]" :footer_icon="isRecentOrNew(r)[1]"></recipe-card>
|
<recipe-card v-for="r in recipes" v-bind:key="r.id" :recipe="r" :footer_text="isRecentOrNew(r)[0]" :footer_icon="isRecentOrNew(r)[1]"></recipe-card>
|
||||||
@@ -694,7 +694,7 @@ export default {
|
|||||||
const field = [
|
const field = [
|
||||||
[this.$t("search_rank"), "score"],
|
[this.$t("search_rank"), "score"],
|
||||||
[this.$t("Name"), "name"],
|
[this.$t("Name"), "name"],
|
||||||
[this.$t("date_cooked"), "lastcooked"],
|
[this.$t("last_cooked"), "lastcooked"],
|
||||||
[this.$t("Rating"), "rating"],
|
[this.$t("Rating"), "rating"],
|
||||||
[this.$t("times_cooked"), "favorite"],
|
[this.$t("times_cooked"), "favorite"],
|
||||||
[this.$t("date_created"), "created_at"],
|
[this.$t("date_created"), "created_at"],
|
||||||
@@ -1031,8 +1031,6 @@ export default {
|
|||||||
this.search.makenow !== false ||
|
this.search.makenow !== false ||
|
||||||
(this.search.lastcooked !== undefined && this.search.lastcooked !== "")
|
(this.search.lastcooked !== undefined && this.search.lastcooked !== "")
|
||||||
|
|
||||||
console.log()
|
|
||||||
|
|
||||||
if (ignore_string) {
|
if (ignore_string) {
|
||||||
return filtered
|
return filtered
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user