Add more parameters to advanced search
This commit is contained in:
parent
aa4c994069
commit
c3c0ad74a7
@ -93,19 +93,36 @@
|
|||||||
<span class="title">Climate</span>
|
<span class="title">Climate</span>
|
||||||
<span class="desc">| sweetspot selection</span>
|
<span class="desc">| sweetspot selection</span>
|
||||||
</div>
|
</div>
|
||||||
<app-toggle-slider [(model)]="temperatureMeanMax" [label]="'Temperature'" [max]="45"
|
<app-toggle-slider [(model)]="temperatureMeanMax" [label]="'Temperature (°C)'" [max]="45"
|
||||||
[min]="0"></app-toggle-slider>
|
[min]="0"></app-toggle-slider>
|
||||||
<app-toggle-slider [(model)]="precipitation" [label]="'Precipitation'" [max]="500"
|
<app-toggle-slider [(model)]="precipitation" [label]="'Precipitation (mm)'" [max]="500"
|
||||||
|
[min]="0"></app-toggle-slider>
|
||||||
|
<app-toggle-slider [(model)]="sunHours" [label]="'Sun hours'" [max]="400"
|
||||||
|
[min]="0"></app-toggle-slider>
|
||||||
|
<app-toggle-slider [(model)]="rainDays" [label]="'Rain days'" [max]="31"
|
||||||
[min]="0"></app-toggle-slider>
|
[min]="0"></app-toggle-slider>
|
||||||
</section>
|
</section>
|
||||||
<!-- Financial -->
|
<!-- Financial -->
|
||||||
<section class="group">
|
<section class="group">
|
||||||
<div class="horizontal">
|
<div class="horizontal">
|
||||||
<span class="title">Financial</span>
|
<span class="title">Financial</span>
|
||||||
<span class="desc">| sweetspot selection</span>
|
<span class="desc">| sweetspot selection (€/day)</span>
|
||||||
</div>
|
</div>
|
||||||
<app-toggle-slider [(model)]="accommodation" [label]="'Accommodation'" [max]="60" [min]="0"></app-toggle-slider>
|
<app-toggle-slider [(model)]="costPerDay" [label]="'Cost'" [max]="400" [min]="0"></app-toggle-slider>
|
||||||
|
<app-toggle-slider [(model)]="accommodation" [label]="'Accommodation'" [max]="200"
|
||||||
|
[min]="0"></app-toggle-slider>
|
||||||
|
<app-toggle-slider [(model)]="localTransport" [label]="'Local transport'" [max]="20"
|
||||||
|
[min]="0"></app-toggle-slider>
|
||||||
</section>
|
</section>
|
||||||
|
<!-- Tags -->
|
||||||
|
<section class="group">
|
||||||
|
<div class="horizontal">
|
||||||
|
<span class="title">Tags</span>
|
||||||
|
<span class="desc">| Search by user ratings</span>
|
||||||
|
</div>
|
||||||
|
<app-multi-tag-select [(model)]="selectedTags" [availableTags]="tags"></app-multi-tag-select>
|
||||||
|
</section>
|
||||||
|
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
|
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin: 1rem 0;
|
margin: 1rem 0;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
@ -52,6 +53,10 @@
|
|||||||
min-width: 14rem;
|
min-width: 14rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> app-multi-tag-select {
|
||||||
|
margin: 1rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.horizontal {
|
.horizontal {
|
||||||
|
|||||||
@ -37,7 +37,12 @@ export class SearchInputComponent implements OnInit {
|
|||||||
fullText = false;
|
fullText = false;
|
||||||
temperatureMeanMax: number;
|
temperatureMeanMax: number;
|
||||||
precipitation: number;
|
precipitation: number;
|
||||||
|
rainDays: number;
|
||||||
|
sunHours: number;
|
||||||
accommodation: number;
|
accommodation: number;
|
||||||
|
costPerDay: number;
|
||||||
|
entertainment: number;
|
||||||
|
localTransport: number;
|
||||||
|
|
||||||
readonly today = this.from = formatDate(new Date(), 'yyyy-MM-dd', 'en-GB');
|
readonly today = this.from = formatDate(new Date(), 'yyyy-MM-dd', 'en-GB');
|
||||||
|
|
||||||
@ -124,6 +129,7 @@ export class SearchInputComponent implements OnInit {
|
|||||||
const query: Query = {
|
const query: Query = {
|
||||||
from: new Date(this.from).getTime(),
|
from: new Date(this.from).getTime(),
|
||||||
to: new Date(this.to).getTime(),
|
to: new Date(this.to).getTime(),
|
||||||
|
tags: this.selectedTags
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.textFilter.length > 0) {
|
if (this.textFilter.length > 0) {
|
||||||
@ -150,7 +156,12 @@ export class SearchInputComponent implements OnInit {
|
|||||||
textFiler: this.textFilter,
|
textFiler: this.textFilter,
|
||||||
tempMeanMax: this.temperatureMeanMax,
|
tempMeanMax: this.temperatureMeanMax,
|
||||||
precipitation: this.precipitation,
|
precipitation: this.precipitation,
|
||||||
|
rain_days: this.rainDays,
|
||||||
|
sun_hours: this.sunHours,
|
||||||
|
average_per_day_costs: this.costPerDay,
|
||||||
accommodation: this.accommodation,
|
accommodation: this.accommodation,
|
||||||
|
entertainment_costs: this.entertainment,
|
||||||
|
local_transportation_costs: this.localTransport,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +179,12 @@ export class SearchInputComponent implements OnInit {
|
|||||||
this.selectedTab = prevInput.wasAdvanced ? 1 : 0;
|
this.selectedTab = prevInput.wasAdvanced ? 1 : 0;
|
||||||
this.temperatureMeanMax = prevInput.tempMeanMax;
|
this.temperatureMeanMax = prevInput.tempMeanMax;
|
||||||
this.precipitation = prevInput.precipitation;
|
this.precipitation = prevInput.precipitation;
|
||||||
|
this.rainDays = prevInput.rain_days;
|
||||||
|
this.sunHours = prevInput.sun_hours;
|
||||||
|
this.costPerDay = prevInput.average_per_day_costs;
|
||||||
this.accommodation = prevInput.accommodation;
|
this.accommodation = prevInput.accommodation;
|
||||||
|
this.entertainment = prevInput.entertainment_costs;
|
||||||
|
this.localTransport = prevInput.local_transportation_costs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,12 @@ export interface SearchInput {
|
|||||||
fullText: boolean;
|
fullText: boolean;
|
||||||
tempMeanMax: number;
|
tempMeanMax: number;
|
||||||
precipitation: number;
|
precipitation: number;
|
||||||
|
rain_days: number;
|
||||||
|
sun_hours: number;
|
||||||
|
average_per_day_costs: number;
|
||||||
accommodation: number;
|
accommodation: number;
|
||||||
|
entertainment_costs: number;
|
||||||
|
local_transportation_costs: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user