fixed old search made new search default
This commit is contained in:
parent
8642298eda
commit
12a438752b
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.2.5 on 2021-07-29 14:50
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cookbook', '0141_auto_20210713_1042'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='userpreference',
|
||||||
|
name='search_style',
|
||||||
|
field=models.CharField(choices=[('SMALL', 'Small'), ('LARGE', 'Large'), ('NEW', 'New')], default='NEW', max_length=64),
|
||||||
|
),
|
||||||
|
]
|
@ -143,7 +143,7 @@ class UserPreference(models.Model, PermissionModelMixin):
|
|||||||
choices=PAGES, max_length=64, default=SEARCH
|
choices=PAGES, max_length=64, default=SEARCH
|
||||||
)
|
)
|
||||||
search_style = models.CharField(
|
search_style = models.CharField(
|
||||||
choices=SEARCH_STYLE, max_length=64, default=LARGE
|
choices=SEARCH_STYLE, max_length=64, default=NEW
|
||||||
)
|
)
|
||||||
show_recent = models.BooleanField(default=True)
|
show_recent = models.BooleanField(default=True)
|
||||||
plan_share = models.ManyToManyField(
|
plan_share = models.ManyToManyField(
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="card-body">
|
<div class="card-body" style="padding: 16px">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<div class="flex-fill">
|
<div class="flex-fill">
|
||||||
<h5 class="card-title p-0 m-0">{{ row.cells.name }}
|
<h5 class="card-title p-0 m-0">{{ row.cells.name }}
|
||||||
|
@ -133,7 +133,7 @@
|
|||||||
:initial_selection="settings.search_keywords"
|
:initial_selection="settings.search_keywords"
|
||||||
search_function="listKeywords" label="label"
|
search_function="listKeywords" label="label"
|
||||||
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
|
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
|
||||||
v-bind:placeholder="$t('Keywords')"></generic-multiselect>
|
v-bind:placeholder="$t('Keywords')" :limit="50"></generic-multiselect>
|
||||||
<b-input-group-append>
|
<b-input-group-append>
|
||||||
<b-input-group-text>
|
<b-input-group-text>
|
||||||
<b-form-checkbox v-model="settings.search_keywords_or" name="check-button"
|
<b-form-checkbox v-model="settings.search_keywords_or" name="check-button"
|
||||||
@ -155,7 +155,7 @@
|
|||||||
:initial_selection="settings.search_foods"
|
:initial_selection="settings.search_foods"
|
||||||
search_function="listFoods" label="name"
|
search_function="listFoods" label="name"
|
||||||
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
|
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
|
||||||
v-bind:placeholder="$t('Ingredients')"></generic-multiselect>
|
v-bind:placeholder="$t('Ingredients')" :limit="20"></generic-multiselect>
|
||||||
<b-input-group-append>
|
<b-input-group-append>
|
||||||
<b-input-group-text>
|
<b-input-group-text>
|
||||||
<b-form-checkbox v-model="settings.search_foods_or" name="check-button"
|
<b-form-checkbox v-model="settings.search_foods_or" name="check-button"
|
||||||
@ -177,7 +177,7 @@
|
|||||||
:initial_selection="settings.search_books"
|
:initial_selection="settings.search_books"
|
||||||
search_function="listRecipeBooks" label="name"
|
search_function="listRecipeBooks" label="name"
|
||||||
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
|
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
|
||||||
v-bind:placeholder="$t('Books')"></generic-multiselect>
|
v-bind:placeholder="$t('Books')" :limit="50"></generic-multiselect>
|
||||||
<b-input-group-append>
|
<b-input-group-append>
|
||||||
<b-input-group-text>
|
<b-input-group-text>
|
||||||
<b-form-checkbox v-model="settings.search_books_or" name="check-button"
|
<b-form-checkbox v-model="settings.search_books_or" name="check-button"
|
||||||
|
@ -37,6 +37,10 @@ export default {
|
|||||||
label: String,
|
label: String,
|
||||||
parent_variable: String,
|
parent_variable: String,
|
||||||
initial_selection: Array,
|
initial_selection: Array,
|
||||||
|
limit: {
|
||||||
|
type: Number,
|
||||||
|
default: 10,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
initial_selection: function (newVal, oldVal) { // watch it
|
initial_selection: function (newVal, oldVal) { // watch it
|
||||||
@ -50,7 +54,7 @@ export default {
|
|||||||
search: function (query) {
|
search: function (query) {
|
||||||
let apiClient = new ApiApiFactory()
|
let apiClient = new ApiApiFactory()
|
||||||
|
|
||||||
apiClient[this.search_function]({query: {query: query, limit: 10}}).then(result => {
|
apiClient[this.search_function]({query: {query: query, limit: this.limit}}).then(result => {
|
||||||
this.objects = result.data
|
this.objects = result.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user