+
\ No newline at end of file
diff --git a/src/app/modules/data/detail/data-detail.scss b/src/app/modules/data/detail/data-detail.scss
new file mode 100644
index 00000000..4d7aa624
--- /dev/null
+++ b/src/app/modules/data/detail/data-detail.scss
@@ -0,0 +1,3 @@
+stapps-data-detail {
+
+}
diff --git a/src/app/modules/data/list/data-list-item.component.ts b/src/app/modules/data/list/data-list-item.component.ts
new file mode 100644
index 00000000..61481071
--- /dev/null
+++ b/src/app/modules/data/list/data-list-item.component.ts
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2018 StApps
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see .
+ */
+import {Component, Input, OnInit} from '@angular/core';
+import {SCThings} from '@openstapps/core';
+
+@Component({
+ selector: 'stapps-data-list-item',
+ templateUrl: 'data-list-item.html'
+})
+export class DataListItem implements OnInit {
+ @Input() item: SCThings;
+
+ constructor() {
+ // noop
+ // this.item is not available yet
+ }
+
+ ngOnInit() {
+ // noop
+ // this.item is available now - the template is loaded and compiled
+ }
+}
diff --git a/src/app/modules/data/list/data-list-item.html b/src/app/modules/data/list/data-list-item.html
new file mode 100644
index 00000000..8d152ce8
--- /dev/null
+++ b/src/app/modules/data/list/data-list-item.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+ {{item.type}}
+
+
+
+
\ No newline at end of file
diff --git a/src/app/modules/data/list/data-list.component.ts b/src/app/modules/data/list/data-list.component.ts
new file mode 100644
index 00000000..ab3b9cae
--- /dev/null
+++ b/src/app/modules/data/list/data-list.component.ts
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2018 StApps
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see .
+ */
+import {Component} from '@angular/core';
+import {AlertController, LoadingController} from '@ionic/angular';
+import {Client} from '@openstapps/api/lib/client';
+import {SCThing} from '@openstapps/core';
+import {Subject} from 'rxjs';
+import {debounceTime, distinctUntilChanged} from 'rxjs/operators';
+import {StAppsWebHttpClient} from '../data.provider';
+
+@Component({
+ selector: 'stapps-data-list',
+ templateUrl: 'data-list.html',
+})
+export class DataListComponent {
+ selectedItem: any;
+ items: SCThing[] = [];
+
+ client: Client;
+
+ size: number = 30;
+ from: number = 0;
+
+ query: string;
+ queryChanged: Subject = new Subject();
+
+ loading: HTMLIonLoadingElement;
+
+ constructor(private loadingController: LoadingController,
+ private alertController: AlertController,
+ swHttpClient: StAppsWebHttpClient) {
+ this.client = new Client(swHttpClient, 'https://stappsbe01.innocampus.tu-berlin.de', '1.0.6');
+
+ this.queryChanged
+ .pipe(
+ debounceTime(1000),
+ distinctUntilChanged())
+ .subscribe((model) => {
+ this.from = 0;
+ this.query = model;
+ this.items = [];
+ this.fetchItems();
+ });
+
+ this.fetchItems();
+ }
+
+ search(query: string) {
+ this.queryChanged.next(query);
+ }
+
+ async loadMore(event: any): Promise {
+ this.from += this.size;
+ await this.fetchItems();
+ event.target.complete();
+ return;
+ }
+
+ private async fetchItems(): Promise {
+ if (this.from === 0) {
+ this.loading = await this.loadingController.create();
+ await this.loading.present();
+ }
+
+ return this.client.search({
+ from: this.from,
+ query: this.query,
+ size: this.size
+ } as any).then((result) => {
+ result.data.forEach((item) => {
+ this.items.push(item);
+ });
+
+ if (this.from === 0) {
+ this.loading.dismiss();
+ }
+ }, async (err) => {
+ const alert: HTMLIonAlertElement = await this.alertController.create({
+ buttons: ['Dismiss'],
+ header: 'Error',
+ subHeader: err.message,
+ });
+
+ await alert.present();
+
+ await this.loading.dismiss();
+ });
+ }
+}
diff --git a/src/app/modules/data/list/data-list.html b/src/app/modules/data/list/data-list.html
new file mode 100644
index 00000000..beb9dcee
--- /dev/null
+++ b/src/app/modules/data/list/data-list.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/modules/data/list/data-list.scss b/src/app/modules/data/list/data-list.scss
new file mode 100644
index 00000000..cc9c32ca
--- /dev/null
+++ b/src/app/modules/data/list/data-list.scss
@@ -0,0 +1,3 @@
+stapps-data-list {
+
+}
diff --git a/src/app/modules/data/types/dish/dish-detail-content.component.ts b/src/app/modules/data/types/dish/dish-detail-content.component.ts
new file mode 100644
index 00000000..6b5536f4
--- /dev/null
+++ b/src/app/modules/data/types/dish/dish-detail-content.component.ts
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2018 StApps
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see .
+ */
+import {Component, Input} from '@angular/core';
+import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
+import {SCDish, SCDishMeta, SCLanguageName, SCThingMeta} from '@openstapps/core';
+
+@Component({
+ selector: 'stapps-dish-detail-content',
+ templateUrl: 'dish-detail-content.html'
+})
+export class DishDetailContentComponent {
+ @Input() item: SCDish;
+ language: SCLanguageName;
+ meta: SCThingMeta;
+
+ constructor(translateService: TranslateService) {
+ this.language = translateService.currentLang as SCLanguageName;
+
+ this.meta = SCDishMeta;
+
+ translateService.onLangChange.subscribe((event: LangChangeEvent) => {
+ this.language = event.lang as SCLanguageName;
+ });
+ }
+}
diff --git a/src/app/modules/data/types/dish/dish-detail-content.html b/src/app/modules/data/types/dish/dish-detail-content.html
new file mode 100644
index 00000000..785a02fa
--- /dev/null
+++ b/src/app/modules/data/types/dish/dish-detail-content.html
@@ -0,0 +1,47 @@
+
+ {{meta.getFieldTranslation(language, 'description')}}
+ {{item.description}}
+
+
+
+ {{meta.getFieldTranslation(language, 'categories')}}
+ {{item.categories.join(', ')}}
+
+
+
+ {{meta.getFieldTranslation(language, 'characteristics')}}
+ {{item.characteristics.join(', ')}}
+
+
+
+ {{meta.getFieldTranslation(language, 'additives')}}
+ {{item.additives.join(', ')}}
+
+
+
+ {{meta.getFieldTranslation(language, 'place')}}
+ {{item.place.name}}
+
+
+
+ {{meta.getFieldTranslation(language, 'price')}}
+
+
+
+
+ {{offer.universityRole.name}}
+
+ {{offer.price}}
+
+
+ Standard / Gäste
+ {{item.price}}
+
+
+
+
+
+
+ Verfügbarkeit
+ {{item.availabilityStarts | date}}
+
diff --git a/src/app/modules/data/types/dish/dish-list-item.component.ts b/src/app/modules/data/types/dish/dish-list-item.component.ts
new file mode 100644
index 00000000..872249fb
--- /dev/null
+++ b/src/app/modules/data/types/dish/dish-list-item.component.ts
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2018 StApps
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see .
+ */
+import {Component, Input} from '@angular/core';
+import {SCDish} from '@openstapps/core';
+import {DataListItem} from '../../list/data-list-item.component';
+
+@Component({
+ selector: 'stapps-dish-list-item',
+ templateUrl: 'dish-list-item.html',
+})
+export class DishListItem extends DataListItem {
+ @Input() item: SCDish;
+}
diff --git a/src/app/modules/data/types/dish/dish-list-item.html b/src/app/modules/data/types/dish/dish-list-item.html
new file mode 100644
index 00000000..b77b8304
--- /dev/null
+++ b/src/app/modules/data/types/dish/dish-list-item.html
@@ -0,0 +1,6 @@
+{{item.name}}
+
+ {{item.price}}
+ {{item.categories.join(',')}}
+ {{item.place.name}}
+
diff --git a/src/app/modules/data/types/event/event-list-item.component.ts b/src/app/modules/data/types/event/event-list-item.component.ts
new file mode 100644
index 00000000..4d0dd6ef
--- /dev/null
+++ b/src/app/modules/data/types/event/event-list-item.component.ts
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2018 StApps
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see .
+ */
+import {Component, Input} from '@angular/core';
+import {SCDateSeries} from '@openstapps/core';
+import {DataListItem} from '../../list/data-list-item.component';
+
+@Component({
+ selector: 'stapps-event-list-item',
+ templateUrl: 'event-list-item.html'
+})
+export class EventListItemComponent extends DataListItem {
+ @Input() item: SCDateSeries;
+}
diff --git a/src/app/modules/data/types/event/event-list-item.html b/src/app/modules/data/types/event/event-list-item.html
new file mode 100644
index 00000000..2e9ac7cc
--- /dev/null
+++ b/src/app/modules/data/types/event/event-list-item.html
@@ -0,0 +1,7 @@
+{{item.name}}
+
+
+ {{item.subProperties.semester}}
+ {{item.categories.join(', ')}}
+ {{item.startDate}} - {{item.endDate}}
+
diff --git a/src/app/modules/menu/menu.module.ts b/src/app/modules/menu/menu.module.ts
new file mode 100644
index 00000000..7ca94e7e
--- /dev/null
+++ b/src/app/modules/menu/menu.module.ts
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2018 StApps
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see .
+ */
+import {CommonModule} from '@angular/common';
+import {NgModule} from '@angular/core';
+import {RouterModule} from '@angular/router';
+import {IonicModule} from '@ionic/angular';
+import {NavigationComponent} from './navigation/navigation.component';
+
+@NgModule({
+ declarations: [
+ NavigationComponent,
+ ],
+ entryComponents: [
+ NavigationComponent
+ ],
+ exports: [
+ NavigationComponent
+ ],
+ imports: [
+ IonicModule.forRoot(),
+ CommonModule,
+ RouterModule
+ ]
+})
+export class MenuModule {}
diff --git a/src/app/modules/menu/navigation/navigation.component.ts b/src/app/modules/menu/navigation/navigation.component.ts
new file mode 100644
index 00000000..d75310ca
--- /dev/null
+++ b/src/app/modules/menu/navigation/navigation.component.ts
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2018 StApps
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see .
+ */
+import {Component} from '@angular/core';
+
+/**
+ * Generated class for the MenuPage page.
+ *
+ * See https://ionicframework.com/docs/components/#navigation for more info on
+ * Ionic pages and navigation.
+ */
+
+@Component({
+ selector: 'stapps-navigation',
+ templateUrl: 'navigation.html',
+})
+export class NavigationComponent {
+ public pages = [
+ {title: 'Search', url: '/search', icon: 'search'},
+ {title: 'Settings', url: '/settings', icon: 'settings'},
+ ];
+
+ constructor() {
+ // Nothing yet.
+ }
+
+ ionViewDidLoad() {
+ // console.log('ionViewDidLoad MenuPage');
+ }
+
+ // openPage(page) {
+ // this.nav.setRoot(page.component);
+ // }
+}
diff --git a/src/app/modules/menu/navigation/navigation.html b/src/app/modules/menu/navigation/navigation.html
new file mode 100644
index 00000000..bbbc9bb2
--- /dev/null
+++ b/src/app/modules/menu/navigation/navigation.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+ StApps
+
+
+
+
+
+
+
+
+ {{p.title}}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/modules/menu/navigation/navigation.scss b/src/app/modules/menu/navigation/navigation.scss
new file mode 100644
index 00000000..5ff27918
--- /dev/null
+++ b/src/app/modules/menu/navigation/navigation.scss
@@ -0,0 +1,3 @@
+stapps-navigation {
+
+}
diff --git a/src/app/modules/settings/item/settings-item.component.ts b/src/app/modules/settings/item/settings-item.component.ts
new file mode 100644
index 00000000..b5bd7a0a
--- /dev/null
+++ b/src/app/modules/settings/item/settings-item.component.ts
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2018 StApps
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see .
+ */
+import {Component, Input} from '@angular/core';
+import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
+import {
+ SCLanguageName,
+ SCSetting,
+ SCSettingMeta,
+} from '@openstapps/core';
+import {SettingsProvider} from '../../settingsProvider/settings.provider';
+
+@Component({
+ selector: 'stapps-settings-item',
+ templateUrl: 'settings-item.html',
+})
+export class SettingsItemComponent {
+ isVisible = true;
+ language: SCLanguageName;
+ meta = SCSettingMeta;
+
+ @Input() setting: SCSetting;
+
+ constructor(private translateService: TranslateService,
+ private settingsProvider: SettingsProvider) {
+ this.meta = SCSettingMeta;
+
+ this.language = translateService.currentLang as SCLanguageName;
+
+ translateService.onLangChange.subscribe((event: LangChangeEvent) => {
+ this.isVisible = false;
+ this.language = event.lang as SCLanguageName;
+ // workaround for selected 'select option' not updating translation
+ setTimeout(() => this.isVisible = true);
+ });
+ }
+
+ /**
+ * handles value changes of the setting
+ */
+ async settingChanged(): Promise {
+ switch (this.setting.name) {
+ case 'language':
+ if (this.setting.input.value !== undefined) {
+ this.translateService.use(this.setting.input.value.toString());
+ }
+ break;
+ default:
+ }
+ await this.settingsProvider
+ .setSettingValue(this.setting.categories[0], this.setting.name, this.setting.input.value);
+ }
+
+ typeOf(val: any) {
+ return typeof (val);
+ }
+}
diff --git a/src/app/modules/settings/item/settings-item.html b/src/app/modules/settings/item/settings-item.html
new file mode 100644
index 00000000..d2ade01f
--- /dev/null
+++ b/src/app/modules/settings/item/settings-item.html
@@ -0,0 +1,55 @@
+
+
+ {{ meta.getFieldValueTranslation(language, 'name', setting) }}
+
+
+ {{ meta.getFieldValueTranslation(language, 'description', setting) }}
+
+
+
+
+
diff --git a/src/app/modules/settings/page/settings-page.component.ts b/src/app/modules/settings/page/settings-page.component.ts
new file mode 100644
index 00000000..5baa496e
--- /dev/null
+++ b/src/app/modules/settings/page/settings-page.component.ts
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2018 StApps
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see .
+ */
+import {Component, OnInit} from '@angular/core';
+import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
+import {SCLanguageName, SCSettingMeta} from '@openstapps/core';
+import {SettingsCache, SettingsProvider} from '../../settingsProvider/settings.provider';
+
+@Component({
+ selector: 'stapps-settings-page',
+ templateUrl: 'settings-page.html',
+})
+export class SettingsPageComponent implements OnInit {
+ categoriesOrder: string[];
+ language: SCLanguageName;
+ meta = SCSettingMeta;
+ objectKeys = Object.keys;
+ settingsCache: SettingsCache;
+
+ constructor(public settingsProvider: SettingsProvider,
+ translateService: TranslateService) {
+ this.language = translateService.currentLang as SCLanguageName;
+ translateService.onLangChange.subscribe((event: LangChangeEvent) => {
+ this.language = event.lang as SCLanguageName;
+ });
+ this.settingsCache = {};
+ this.categoriesOrder = settingsProvider.getCategoriesOrder();
+ }
+
+ async loadSettings(): Promise {
+ this.settingsCache = await this.settingsProvider.getSettingsCache();
+ }
+
+ async ngOnInit() {
+ await this.loadSettings();
+ }
+}
diff --git a/src/app/modules/settings/page/settings-page.html b/src/app/modules/settings/page/settings-page.html
new file mode 100644
index 00000000..1c7921b9
--- /dev/null
+++ b/src/app/modules/settings/page/settings-page.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+