Merge branch 'dev' into '58-transport-other-wird-nicht-gezahlt'
# Conflicts: # src/app/pages/coronatransport/coronatransport.page.ts # src/app/pages/psicheckin/psicheckin.page.html
This commit is contained in:
commit
6aed96adb9
10 files changed
+106
-79
No files matched your search
@@ -16,6 +16,7 @@ import { OasemenuPage } from './pages/oasemenu/oasemenu.page';
|
||||
import {CoronatransportPage} from './pages/coronatransport/coronatransport.page';
|
||||
import {PsicheckinPage} from './pages/psicheckin/psicheckin.page';
|
||||
import {CoronarestaurantPage} from './pages/coronarestaurant/coronarestaurant.page';
|
||||
import {CoronahelppageComponent} from './components/coronahelppage/coronahelppage.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
@@ -82,11 +83,11 @@ const routes: Routes = [
|
||||
{
|
||||
path: 'coronarestaurant',
|
||||
component: CoronarestaurantPage
|
||||
},
|
||||
{
|
||||
path: 'coronahelppage',
|
||||
component: CoronahelppageComponent
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<ion-footer (mouseup)="closeSettingsMenu()">
|
||||
<ion-menu-toggle auto-hide="false">
|
||||
<!--FAQ page-->
|
||||
<ion-item lines="none" routerLink="" color="danger">
|
||||
<ion-item lines="none" routerLink="/coronahelppage" color="danger">
|
||||
<ion-icon slot="start" name="pulse"></ion-icon>
|
||||
<ion-label>
|
||||
Corona Info
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<ion-header>
|
||||
<ion-header mode="md">
|
||||
<ion-toolbar>
|
||||
<ion-title>
|
||||
PSI Check-in info
|
||||
</ion-title>
|
||||
</ion-toolbar>
|
||||
<ion-segment fill="outline" color="medium" [(ngModel)]='languageTab'>
|
||||
<ion-segment-button value="english">
|
||||
<ion-label>English</ion-label>
|
||||
<ion-segment mode="md" fill="outline" color="light" [(ngModel)]="languageTab">
|
||||
<ion-segment-button [ngStyle]="{'border-bottom':languageTab == 'english' ? '3px solid lightgray' : 'none'}" value="english">
|
||||
<ion-label [ngStyle]="{'color':languageTab == 'english' ? '#989aa2' : '#989aa2', 'font-weight':languageTab == 'english' ? 'bold' : 'normal'}">English</ion-label>
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="german">
|
||||
<ion-label>Deutsch</ion-label>
|
||||
<ion-segment-button [ngStyle]="{'border-bottom':languageTab == 'german' ? '3px solid lightgray' : 'none'}" value="german">
|
||||
<ion-label [ngStyle]="{'color':languageTab == 'german' ? '#989aa2' : '#989aa2', 'font-weight':languageTab == 'german' ? 'bold' : 'normal'}">Deutsch</ion-label>
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-header>
|
||||
@@ -20,16 +20,16 @@
|
||||
<ion-item lines="full">
|
||||
<h4>Disclaimer</h4>
|
||||
</ion-item>
|
||||
<p>We do not collect any personal data from you. The selection you make is stored locally on your mobile phone.
|
||||
<p>We do not store any personal data from you. The selection you make is stored locally on your mobile phone.
|
||||
The data send to the server is encrypted and anonymous.</p>
|
||||
<ion-item lines="full">
|
||||
<h4>Purpose of this check-in</h4>
|
||||
</ion-item>
|
||||
<p>
|
||||
This feature is intended to help us to comply with the recommended measures to protect our health. With this, we
|
||||
This feature is intended to help us to comply with the measures recommended by <a href="https://www.bag.admin.ch/">BAG</a> to protect our health. With this, we
|
||||
try
|
||||
to avoid large crowds on the bus or in the catering restaurants. This depends on your participation.
|
||||
At the moment the check-in is only set up for weekdays.
|
||||
The check-in is only set up for working days.
|
||||
</p>
|
||||
<ion-item lines="full">
|
||||
<h4>Who should use the check-in?</h4>
|
||||
@@ -60,18 +60,18 @@
|
||||
<h4>Haftungsausschluss</h4>
|
||||
</ion-item>
|
||||
<p>
|
||||
Wir sammeln keine personenbezogenen Daten von Ihnen. Die von Ihnen getroffene Auswahl wird lokal auf Ihrem
|
||||
Wir speichern keine personenbezogenen Daten von Ihnen. Die von Ihnen getroffene Auswahl wird lokal auf Ihrem
|
||||
Mobiltelefon gespeichert. Die an den Server gesendeten Daten sind verschlüsselt und anonym.
|
||||
</p>
|
||||
<ion-item lines="full">
|
||||
<h4>Zweck dieses Check-ins</h4>
|
||||
</ion-item>
|
||||
<p>
|
||||
Diese Funktion soll uns helfen, die empfohlenen Maßnahmen zum Schutz unserer Gesundheit einzuhalten. Damit
|
||||
Diese Funktion soll uns helfen, die vom <a href="https://www.bag.admin.ch/">BAG</a> empfohlenen Maßnahmen zum Schutz unserer Gesundheit einzuhalten. Damit
|
||||
versuchen
|
||||
wir, große Menschenmengen im Bus oder in den Catering-Restaurants zu vermeiden. Dies hängt von Ihrer Teilnahme
|
||||
ab.
|
||||
Im Moment ist der Check-in nur für Wochentage eingerichtet.
|
||||
Der Check-in ist nur für Werktage eingerichtet.
|
||||
</p>
|
||||
<ion-item lines="full">
|
||||
<h4>Wer sollte den Check-in nutzen?</h4>
|
||||
|
||||
@@ -10,13 +10,14 @@ import { Content } from '@angular/compiler/src/render3/r3_ast';
|
||||
|
||||
export class CoronahelppageComponent implements OnInit {
|
||||
|
||||
public languageTab = 'english'
|
||||
public languageTab = 'english';
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
) { }
|
||||
|
||||
ngOnInit() {}
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
// cancels the settings modal
|
||||
public cancel() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ion-header>
|
||||
<ion-header mode="md">
|
||||
<ion-toolbar>
|
||||
<ion-title size="small" style="font-size: 16px"><b class="ion-text-nowrap">Choose your time for lunch at {{restaurants[restaurant]}}:</b> <span class="ion-text-nowrap">{{date | date}}</span>
|
||||
</ion-title>
|
||||
@@ -47,7 +47,7 @@
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
<ion-button slot="end" (click)="close()" fill="clear">
|
||||
Save
|
||||
Close
|
||||
</ion-button>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
@@ -17,7 +17,7 @@ export class CoronarestaurantPage implements OnInit {
|
||||
{ text: '11:00 - 11:45', value: Timeframe.slot_11_00_11_45 },
|
||||
{ text: '11:45 - 12:30', value: Timeframe.slot_11_45_12_30 },
|
||||
{ text: '12:30 - 13:15', value: Timeframe.slot_12_30_13_15 },
|
||||
{ text: '13:15 - 14:00', value: Timeframe.slot_13_15_13_45 },
|
||||
{ text: '13:15 - 13:45', value: Timeframe.slot_13_15_13_45 },
|
||||
];
|
||||
public selectedTimeframe: TimeframeSelection;
|
||||
public queues: TimeframeQueue[] = [];
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<ion-header>
|
||||
<ion-header mode="md">
|
||||
<ion-toolbar>
|
||||
<ion-title size="small" style="font-size: 16px">
|
||||
<b class="ion-text-nowrap">Choose your bus for:</b> <span class="ion-text-nowrap">{{date | date}}</span>
|
||||
</ion-title>
|
||||
</ion-toolbar>
|
||||
<!--Public Transport Tabs-->
|
||||
<ion-segment fill="outline" color="medium" [(ngModel)]='menuTab'>
|
||||
<ion-segment-button value="arrival">
|
||||
<ion-label>Arrival to PSI</ion-label>
|
||||
<ion-segment mode="md" fill="outline" color="light" [(ngModel)]="menuTab">
|
||||
<ion-segment-button [ngStyle]="{'border-bottom':menuTab == 'arrival' ? '3px solid lightgray' : 'none'}" value="arrival">
|
||||
<ion-label [ngStyle]="{'color':menuTab == 'arrival' ? '#989aa2' : '#989aa2', 'font-weight':menuTab == 'arrival' ? 'bold' : 'normal'}">Arrival to PSI</ion-label>
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="depart">
|
||||
<ion-label>Departure from PSI</ion-label>
|
||||
<ion-segment-button [ngStyle]="{'border-bottom':menuTab == 'depart' ? '3px solid lightgray' : 'none'}" value="depart">
|
||||
<ion-label [ngStyle]="{'color':menuTab == 'depart' ? '#989aa2' : '#989aa2', 'font-weight':menuTab == 'depart' ? 'bold' : 'normal'}">Departure from PSI</ion-label>
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-header>
|
||||
@@ -202,7 +202,7 @@
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
<ion-button slot="end" (click)="close()" fill="clear">
|
||||
Save
|
||||
Close
|
||||
</ion-button>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit, Input, OnDestroy } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import {Component, OnInit, Input} from '@angular/core';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {environment} from '../../../environments/environment';
|
||||
import {
|
||||
BusSchedule,
|
||||
BusDirection,
|
||||
@@ -11,11 +11,11 @@ import {
|
||||
BusStatus,
|
||||
BUS_LIMITS
|
||||
} from '../../interfaces/bus-schedule';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ModalController, Platform, PopoverController, ToastController } from '@ionic/angular';
|
||||
import { CoronatransportpopoverComponent } from '../../components/coronatransportpopover/coronatransportpopover.component';
|
||||
import { CoronaBusService } from '../../services/corona-bus.service';
|
||||
import { SoapApiHelper } from 'src/app/classes/api-helper';
|
||||
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
|
||||
import {ModalController, Platform, PopoverController, ToastController} from '@ionic/angular';
|
||||
import {CoronatransportpopoverComponent} from '../../components/coronatransportpopover/coronatransportpopover.component';
|
||||
import {CoronaBusService} from '../../services/corona-bus.service';
|
||||
import {SoapApiHelper} from 'src/app/classes/api-helper';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -38,11 +38,11 @@ export class CoronatransportPage implements OnInit {
|
||||
public limits = BUS_LIMITS;
|
||||
|
||||
constructor(private http: HttpClient,
|
||||
private _FB: FormBuilder,
|
||||
private modalController: ModalController,
|
||||
private popoverController: PopoverController,
|
||||
private toastController: ToastController,
|
||||
private busService: CoronaBusService) {
|
||||
private _FB: FormBuilder,
|
||||
private modalController: ModalController,
|
||||
private popoverController: PopoverController,
|
||||
private toastController: ToastController,
|
||||
private busService: CoronaBusService) {
|
||||
this.arrivalForm = _FB.group({
|
||||
'time': ['', Validators.required],
|
||||
'from': ['', Validators.required],
|
||||
@@ -57,10 +57,10 @@ export class CoronatransportPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.http.get<BusSchedule>(this.assets + '/busfahrplan.json')
|
||||
.subscribe(data => {
|
||||
this.busSchedule = data;
|
||||
this.initForm();
|
||||
});
|
||||
.subscribe(data => {
|
||||
this.busSchedule = data;
|
||||
this.initForm();
|
||||
});
|
||||
this.loadBusesStatus();
|
||||
this.updateSelection();
|
||||
}
|
||||
@@ -73,50 +73,30 @@ export class CoronatransportPage implements OnInit {
|
||||
if (this.date.getTime() <= new Date('05.10.2020').getTime()) {
|
||||
// Check if start station is Siggenthal
|
||||
if (this.arrivalForm.controls['from'].value == 'Siggenthal') {
|
||||
this.filteredAData = this.busSchedule.arrival.filter(a => a.middle_time != ''
|
||||
&& new Date(this.date.toDateString() + ' ' + a.start_time) >= new Date(this.arrivalForm.controls['time'].value)
|
||||
&& a.date == '10.05.2020');
|
||||
this.filteredAData = this.busSchedule.arrival.filter(a => a.middle_time != '' && new Date(new Date().toDateString() + ' ' + a.middle_time) >= new Date(this.arrivalForm.controls['time'].value) && a.date == '10.05.2020');
|
||||
} else {
|
||||
this.filteredAData = this.busSchedule.arrival.filter(a => a.start_station == this.arrivalForm.controls['from'].value
|
||||
&& new Date(this.date.toDateString() + ' ' + a.start_time) >= new Date(this.arrivalForm.controls['time'].value)
|
||||
&& a.date == '10.05.2020');
|
||||
this.filteredAData = this.busSchedule.arrival.filter(a => a.start_station == this.arrivalForm.controls['from'].value && new Date(new Date().toDateString()+ ' ' + a.start_time) >= new Date(this.arrivalForm.controls['time'].value) && a.date == '10.05.2020');
|
||||
}
|
||||
// Check if end station is Siggenthal
|
||||
if (this.departureForm.controls['to'].value == 'Siggenthal') {
|
||||
this.filteredDData = this.busSchedule.departure.filter(d => d.middle_time != ''
|
||||
&& (new Date(this.date.toDateString() + ' ' + d.start_time_east) >= new Date(this.departureForm.controls['time'].value)
|
||||
|| new Date(this.date.toDateString() + ' ' + d.start_time_west) >= new Date(this.departureForm.controls['time'].value))
|
||||
&& d.date == '10.05.2020');
|
||||
this.filteredDData = this.busSchedule.departure.filter(d => d.middle_time != '' && (new Date(new Date().toDateString() + ' ' + d.start_time_east) >= new Date(this.departureForm.controls['time'].value) || new Date(new Date().toDateString() + ' ' + d.start_time_west) >= new Date(this.departureForm.controls['time'].value)) && d.date == '10.05.2020');
|
||||
} else {
|
||||
this.filteredDData = this.busSchedule.departure.filter(d => d.end_station == this.departureForm.controls['to'].value
|
||||
&& (new Date(this.date.toDateString() + ' ' + d.start_time_east) >= new Date(this.departureForm.controls['time'].value)
|
||||
|| new Date(this.date.toDateString() + ' ' + d.start_time_west) >= new Date(this.departureForm.controls['time'].value))
|
||||
&& d.date == '10.05.2020');
|
||||
this.filteredDData = this.busSchedule.departure.filter(d => d.end_station == this.departureForm.controls['to'].value && (new Date(new Date().toDateString() + ' ' + d.start_time_east) >= new Date(this.departureForm.controls['time'].value) || new Date(new Date().toDateString() + ' ' + d.start_time_west) >= new Date(this.departureForm.controls['time'].value)) && d.date == '10.05.2020');
|
||||
}
|
||||
|
||||
// Check if today's date is lower or above 11th May 2020
|
||||
} else if (this.date.getTime() >= new Date('05.11.2020').getTime()) {
|
||||
// Check if start station is Siggenthal
|
||||
if (this.arrivalForm.controls['from'].value == 'Siggenthal') {
|
||||
this.filteredAData = this.busSchedule.arrival.filter(a => a.middle_time != ''
|
||||
&& new Date(this.date.toDateString() + ' ' + a.start_time) >= new Date(this.arrivalForm.controls['time'].value)
|
||||
&& a.date == '11.05.2020');
|
||||
this.filteredAData = this.busSchedule.arrival.filter(a => a.middle_time != '' && new Date(new Date().toDateString() + ' ' + a.middle_time) >= new Date(this.arrivalForm.controls['time'].value) && a.date == '11.05.2020');
|
||||
} else {
|
||||
this.filteredAData = this.busSchedule.arrival.filter(a => a.start_station == this.arrivalForm.controls['from'].value
|
||||
&& new Date(this.date.toDateString() + ' ' + a.start_time) >= new Date(this.arrivalForm.controls['time'].value)
|
||||
&& a.date == '11.05.2020');
|
||||
this.filteredAData = this.busSchedule.arrival.filter(a => a.start_station == this.arrivalForm.controls['from'].value && new Date(new Date().toDateString() + ' ' + a.start_time) >= new Date(this.arrivalForm.controls['time'].value) && a.date == '11.05.2020');
|
||||
}
|
||||
// Check if end station is Siggenthal
|
||||
if (this.departureForm.controls['to'].value == 'Siggenthal') {
|
||||
this.filteredDData = this.busSchedule.departure.filter(d => d.middle_time != ''
|
||||
&& (new Date(this.date.toDateString() + ' ' + d.start_time_east) >= new Date(this.departureForm.controls['time'].value)
|
||||
|| new Date(this.date.toDateString() + ' ' + d.start_time_west) >= new Date(this.departureForm.controls['time'].value))
|
||||
&& d.date == '11.05.2020');
|
||||
this.filteredDData = this.busSchedule.departure.filter(d => d.middle_time != '' && (new Date(new Date().toDateString() + ' ' + d.start_time_east) >= new Date(this.departureForm.controls['time'].value) || new Date(new Date().toDateString() + ' ' + d.start_time_west) >= new Date(this.departureForm.controls['time'].value)) && d.date == '11.05.2020');
|
||||
} else {
|
||||
this.filteredDData = this.busSchedule.departure.filter(d => d.end_station == this.departureForm.controls['to'].value
|
||||
&& (new Date(this.date.toDateString() + ' ' + d.start_time_east) >= new Date(this.departureForm.controls['time'].value)
|
||||
|| new Date(this.date.toDateString() + ' ' + d.start_time_west) >= new Date(this.departureForm.controls['time'].value))
|
||||
&& d.date == '11.05.2020');
|
||||
this.filteredDData = this.busSchedule.departure.filter(d => d.end_station == this.departureForm.controls['to'].value && (new Date(new Date().toDateString() + ' ' + d.start_time_east) >= new Date(this.departureForm.controls['time'].value) || new Date(new Date().toDateString() + ' ' + d.start_time_west) >= new Date(this.departureForm.controls['time'].value)) && d.date == '11.05.2020');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,7 +106,7 @@ export class CoronatransportPage implements OnInit {
|
||||
*/
|
||||
public getArrivalSelection(): BusSelection {
|
||||
return this.selections.find(selection => selection.date.getTime() === this.date.getTime()
|
||||
&& selection.direction === BusDirection.ToPSI);
|
||||
&& selection.direction === BusDirection.ToPSI);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,7 +114,7 @@ export class CoronatransportPage implements OnInit {
|
||||
*/
|
||||
public getDepartureSelection(): BusSelection {
|
||||
return this.selections.find(selection => selection.date.getTime() === this.date.getTime()
|
||||
&& selection.direction === BusDirection.FromPSI);
|
||||
&& selection.direction === BusDirection.FromPSI);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -143,7 +123,7 @@ export class CoronatransportPage implements OnInit {
|
||||
* @param id unique id of the bus
|
||||
*/
|
||||
public getBusStatus(id: number): BusInformation {
|
||||
return this.busesStatus.find(status => status.id == id) || { id, currentNb: 0, status: BusStatus.Ok };
|
||||
return this.busesStatus.find(status => status.id == id) || {id, currentNb: 0, status: BusStatus.Ok};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,7 +213,7 @@ export class CoronatransportPage implements OnInit {
|
||||
*/
|
||||
private loadBusesStatus(): void {
|
||||
this.busService.getBusesStatus(this.date)
|
||||
.subscribe(data => this.busesStatus = data, error => SoapApiHelper.handleError(this.toastController, error));
|
||||
.subscribe(data => this.busesStatus = data, error => SoapApiHelper.handleError(this.toastController, error));
|
||||
}
|
||||
|
||||
// closes the settings modal
|
||||
|
||||
@@ -13,7 +13,48 @@
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content color="medium">
|
||||
<ion-content color="medium" scroll-y="false">
|
||||
<ion-slides (ionSlideDidChange)="checkSelections()" pager="true" [options]="slideOpts">
|
||||
<ion-slide>
|
||||
<ion-card>
|
||||
<ion-card-header>
|
||||
<ion-card-title>
|
||||
Which day would you like to configure?
|
||||
</ion-card-title>
|
||||
</ion-card-header>
|
||||
<ion-card-content>
|
||||
<h3>Please choose an option bellow</h3>
|
||||
<ion-button [color]="allSelectionsCheckedToday ? 'success' : 'dark'" fill="outline"
|
||||
(click)="selectDay('today');goToSlide(1)">
|
||||
Today
|
||||
<ion-icon *ngIf="allSelectionsCheckedToday" name="checkmark"></ion-icon>
|
||||
</ion-button>
|
||||
<ion-button [color]="allSelectionsCheckedTomorrow ? 'success' : 'dark'" fill="outline"
|
||||
(click)="selectDay('tomorrow');goToSlide(1)">
|
||||
Tomorrow
|
||||
<ion-icon *ngIf="allSelectionsCheckedTomorrow" name="checkmark"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</ion-slide>
|
||||
<ion-slide>
|
||||
<ion-card>
|
||||
<ion-card-header>
|
||||
<ion-card-title>
|
||||
How do you get to PSI?
|
||||
</ion-card-title>
|
||||
<ion-card-subtitle>
|
||||
{{selectedDate | date}}
|
||||
</ion-card-subtitle>
|
||||
</ion-card-header>
|
||||
<ion-card-content>
|
||||
<h3>Please choose an option below</h3>
|
||||
<ion-button fill="outline" color="dark" (click)="presentTransportModal()">by Bus
|
||||
</ion-button>
|
||||
<ion-button fill="outline" color="dark" (click)="goToSlide(2)">Other</ion-button>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</ion-slide>
|
||||
|
||||
<ion-slides (ionSlideDidChange)="checkSelections()" style="height: 100%" pager="true" [options]="slideOpts">
|
||||
<ion-slide>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
ion-slide {
|
||||
height: 100vh;
|
||||
flex-direction: column;
|
||||
}
|
||||
Reference in new issue
Block a user