From 5855accc169579d87f5779fd602d4f00f2b479a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jovan=20Kruni=C4=87?= Date: Wed, 10 Apr 2019 15:01:00 +0200 Subject: [PATCH] feat(data): add data detail templates Additionally clean up the code --- package-lock.json | 73 ++++++++++++++- package.json | 3 + .../_helpers/data/resources/test-resources.ts | 16 +++- src/app/modules/data/data.module.ts | 57 ++++++++++-- .../detail/data-detail-content.component.ts | 24 +++++ .../data/detail/data-detail-content.html | 27 ++++++ .../data/detail/data-detail.component.ts | 14 ++- src/app/modules/data/detail/data-detail.html | 9 +- src/app/modules/data/detail/data-detail.scss | 14 ++- ...ts => academic-offers-detail.component.ts} | 6 +- .../data/elements/academic-offers-detail.html | 36 ++++++++ .../academic-offers-in-list.component.ts | 24 +++++ ...list.html => academic-offers-in-list.html} | 0 .../data/elements/address-detail.component.ts | 24 +++++ .../modules/data/elements/address-detail.html | 43 +++++++++ .../data/elements/origin-detail.component.ts | 24 +++++ .../modules/data/elements/origin-detail.html | 25 +++++ .../data/elements/origin-in-list.component.ts | 24 +++++ .../modules/data/elements/origin-in-list.html | 7 ++ .../data/elements/simple-card.component.ts | 33 +++++++ .../modules/data/elements/simple-card.html | 27 ++++++ src/app/modules/data/list/data-list-item.html | 1 + src/app/modules/data/list/data-list-item.scss | 2 +- .../article-detail-content.component.ts | 31 +++++++ .../types/article/article-detail-content.html | 6 ++ .../data/types/article/article-list-item.html | 2 +- .../catalog-detail-content.component.ts | 31 +++++++ .../types/catalog/catalog-detail-content.html | 2 + .../date-series-detail-content.component.ts | 31 +++++++ .../date-series-detail-content.html | 13 +++ .../date-series/date-series-list-item.html | 7 +- .../dish/dish-detail-content.component.ts | 16 ++-- .../data/types/dish/dish-detail-content.html | 91 ++++++++++--------- .../data/types/dish/dish-list-item.html | 2 +- .../event/event-detail-content.component.ts | 31 +++++++ .../types/event/event-detail-content.html | 6 ++ .../types/event/event-list-item.component.ts | 2 +- .../favorite-detail-content.component.ts | 31 +++++++ .../favorite/favorite-detail-content.html | 1 + .../types/favorite/favorite-list-item.html | 3 +- .../message-detail-content.component.ts | 31 +++++++ .../types/message/message-detail-content.html | 5 + .../data/types/message/message-list-item.html | 1 + .../organization-detail-content.component.ts | 31 +++++++ .../organization-detail-content.html | 9 ++ .../person/person-detail-content.component.ts | 31 +++++++ .../types/person/person-detail-content.html | 38 ++++++++ .../place/place-detail-content.component.ts | 31 +++++++ .../types/place/place-detail-content.html | 15 +++ .../types/place/place-list-item.component.ts | 4 +- .../data/types/place/place-list-item.html | 4 +- .../semester-detail-content.component.ts | 31 +++++++ .../semester/semester-detail-content.html | 2 + .../types/semester/semester-list-item.html | 12 +++ .../video/video-detail-content.component.ts | 31 +++++++ .../types/video/video-detail-content.html | 6 ++ .../data/types/video/video-list-item.html | 1 + .../settings/page/settings-page.component.ts | 4 +- 58 files changed, 1015 insertions(+), 91 deletions(-) create mode 100644 src/app/modules/data/detail/data-detail-content.component.ts create mode 100644 src/app/modules/data/detail/data-detail-content.html rename src/app/modules/data/elements/{offers-in-list.component.ts => academic-offers-detail.component.ts} (86%) create mode 100644 src/app/modules/data/elements/academic-offers-detail.html create mode 100644 src/app/modules/data/elements/academic-offers-in-list.component.ts rename src/app/modules/data/elements/{offers-in-list.html => academic-offers-in-list.html} (100%) create mode 100644 src/app/modules/data/elements/address-detail.component.ts create mode 100644 src/app/modules/data/elements/address-detail.html create mode 100644 src/app/modules/data/elements/origin-detail.component.ts create mode 100644 src/app/modules/data/elements/origin-detail.html create mode 100644 src/app/modules/data/elements/origin-in-list.component.ts create mode 100644 src/app/modules/data/elements/origin-in-list.html create mode 100644 src/app/modules/data/elements/simple-card.component.ts create mode 100644 src/app/modules/data/elements/simple-card.html create mode 100644 src/app/modules/data/types/article/article-detail-content.component.ts create mode 100644 src/app/modules/data/types/article/article-detail-content.html create mode 100644 src/app/modules/data/types/catalog/catalog-detail-content.component.ts create mode 100644 src/app/modules/data/types/catalog/catalog-detail-content.html create mode 100644 src/app/modules/data/types/date-series/date-series-detail-content.component.ts create mode 100644 src/app/modules/data/types/date-series/date-series-detail-content.html create mode 100644 src/app/modules/data/types/event/event-detail-content.component.ts create mode 100644 src/app/modules/data/types/event/event-detail-content.html create mode 100644 src/app/modules/data/types/favorite/favorite-detail-content.component.ts create mode 100644 src/app/modules/data/types/favorite/favorite-detail-content.html create mode 100644 src/app/modules/data/types/message/message-detail-content.component.ts create mode 100644 src/app/modules/data/types/message/message-detail-content.html create mode 100644 src/app/modules/data/types/organization/organization-detail-content.component.ts create mode 100644 src/app/modules/data/types/organization/organization-detail-content.html create mode 100644 src/app/modules/data/types/person/person-detail-content.component.ts create mode 100644 src/app/modules/data/types/person/person-detail-content.html create mode 100644 src/app/modules/data/types/place/place-detail-content.component.ts create mode 100644 src/app/modules/data/types/place/place-detail-content.html create mode 100644 src/app/modules/data/types/semester/semester-detail-content.component.ts create mode 100644 src/app/modules/data/types/semester/semester-detail-content.html create mode 100644 src/app/modules/data/types/video/video-detail-content.component.ts create mode 100644 src/app/modules/data/types/video/video-detail-content.html diff --git a/package-lock.json b/package-lock.json index 516346e3..969ff992 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2631,6 +2631,11 @@ "resolved": "https://registry.npmjs.org/@types/json-patch/-/json-patch-0.0.30.tgz", "integrity": "sha512-MhCUjojzDhVLnZnxwPwa+rETFRDQ0ffjxYdrqOP6TBO2O0/Z64PV5tNeYApo4bc4y4frbWOrRwv/eEkXlI13Rw==" }, + "@types/marked": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@types/marked/-/marked-0.6.5.tgz", + "integrity": "sha512-6kBKf64aVfx93UJrcyEZ+OBM5nGv4RLsI6sR1Ar34bpgvGVRoyTgpxn4ZmtxOM5aDTAaaznYuYUH8bUX3Nk3YA==" + }, "@types/node": { "version": "11.13.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.2.tgz", @@ -4368,6 +4373,17 @@ "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, + "clipboard": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.4.tgz", + "integrity": "sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==", + "optional": true, + "requires": { + "good-listener": "^1.2.2", + "select": "^1.1.2", + "tiny-emitter": "^2.0.0" + } + }, "cliui": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", @@ -5283,6 +5299,12 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "delegate": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", + "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==", + "optional": true + }, "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -7243,6 +7265,15 @@ "minimatch": "~3.0.2" } }, + "good-listener": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", + "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", + "optional": true, + "requires": { + "delegate": "^3.1.2" + } + }, "graceful-fs": { "version": "4.1.15", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", @@ -9296,8 +9327,7 @@ "marked": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/marked/-/marked-0.6.1.tgz", - "integrity": "sha512-+H0L3ibcWhAZE02SKMqmvYsErLo4EAVJxu5h3bHBBDvvjeWXtl92rGUSBYHL2++5Y+RSNgl8dYOAXcYe7lp1fA==", - "dev": true + "integrity": "sha512-+H0L3ibcWhAZE02SKMqmvYsErLo4EAVJxu5h3bHBBDvvjeWXtl92rGUSBYHL2++5Y+RSNgl8dYOAXcYe7lp1fA==" }, "md5.js": { "version": "1.3.5", @@ -9708,6 +9738,25 @@ "integrity": "sha1-a+lPysqNd63gqWcNxGCRTJRHJEQ=", "dev": true }, + "ngx-markdown": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/ngx-markdown/-/ngx-markdown-7.1.4.tgz", + "integrity": "sha512-GnYEKzuj3/DD8ir1MaZM+rlIy/Ua6U1h9VJ1fL1kvESyRRpLV8WoZhu3CdacoyELemwevChOyJh2yecCX+Ye+Q==", + "requires": { + "@types/marked": "^0.6.0", + "marked": "^0.6.0", + "prismjs": "^1.15.0", + "tslib": "^1.9.0" + } + }, + "ngx-moment": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/ngx-moment/-/ngx-moment-3.4.0.tgz", + "integrity": "sha512-GEqzSsu12VsXXP35aerlQpuZ1ienEYQZxHmp+RH7EuJD7hWamKgLOpmbiDI9Ij3KLW/UApvonYzZvyRSv3ea/w==", + "requires": { + "tslib": "^1.9.0" + } + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -10919,6 +10968,14 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "prismjs": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.16.0.tgz", + "integrity": "sha512-OA4MKxjFZHSvZcisLGe14THYsug/nF6O1f0pAJc0KN0wTyAcLqmsbE+lTGKSpyh+9pEW57+k6pg2AfYR+coyHA==", + "requires": { + "clipboard": "^2.0.0" + } + }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -11808,6 +11865,12 @@ } } }, + "select": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", + "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=", + "optional": true + }, "select-hose": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", @@ -13336,6 +13399,12 @@ "setimmediate": "^1.0.4" } }, + "tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", + "optional": true + }, "tiny-inflate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.2.tgz", diff --git a/package.json b/package.json index 9f32f32c..47b7d844 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,9 @@ "cordova-plugin-splashscreen": "5.0.2", "cordova-plugin-whitelist": "1.3.3", "core-js": "2.6.5", + "moment": "2.24.0", + "ngx-markdown": "7.1.4", + "ngx-moment": "3.4.0", "rxjs": "6.4.0", "zone.js": "0.9.0" }, diff --git a/src/app/_helpers/data/resources/test-resources.ts b/src/app/_helpers/data/resources/test-resources.ts index b90d9678..9b649a4b 100644 --- a/src/app/_helpers/data/resources/test-resources.ts +++ b/src/app/_helpers/data/resources/test-resources.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ export const sampleResources = [{ 'errorNames': [], "instance": { @@ -1423,7 +1424,17 @@ export const sampleResources = [{ 'created': '2018-09-11T12:30:00Z', 'deleted': false, 'type': 'user', - 'updated': '2018-12-11T12:30:00Z' + 'updated': '2018-12-11T12:30:00Z', + 'maintainer': { + 'type': 'organization', + 'name': 'tubIT', + 'uid': '25f76840-db89-5da2-a8a2-75992f637613', + 'origin': { + 'indexed': '2018-09-11T12:30:00Z', + 'name': 'Dummy', + 'type': 'remote' + } + }, } }, 'schema': 'SCFavorite', @@ -29262,6 +29273,7 @@ export const sampleResources = [{ 'audiences': [ 'students' ], + 'datePublished': '2018-08-01', 'origin': { 'indexed': '2018-09-11T12:30:00Z', 'name': 'Dummy', @@ -29284,6 +29296,7 @@ export const sampleResources = [{ 'audiences': [ 'students' ], + 'datePublished': '2018-08-01', 'origin': { 'indexed': '2018-09-11T12:30:00Z', 'name': 'foo', @@ -29307,6 +29320,7 @@ export const sampleResources = [{ 'audiences': [ 'students' ], + 'datePublished': '2018-08-01', 'origin': { 'indexed': '2018-09-11T12:30:00Z', 'name': 'Dummy', diff --git a/src/app/modules/data/data.module.ts b/src/app/modules/data/data.module.ts index 9b1d55cb..41cfb025 100644 --- a/src/app/modules/data/data.module.ts +++ b/src/app/modules/data/data.module.ts @@ -18,54 +18,85 @@ import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {IonicModule} from '@ionic/angular'; import {TranslateModule} from '@ngx-translate/core'; +import {MarkdownModule} from 'ngx-markdown'; +import {MomentModule} from 'ngx-moment'; import {StorageModule} from '../storage/storage.module'; import {DataFacetsProvider} from './data-facets.provider'; import {DataRoutingModule} from './data-routing.module'; import {DataProvider} from './data.provider'; +import {DataDetailContentComponent} from './detail/data-detail-content.component'; import {DataDetailComponent} from './detail/data-detail.component'; +import {AcademicOffersDetailComponent} from './elements/academic-offers-detail.component'; +import {AcademicOffersInListComponent} from './elements/academic-offers-in-list.component'; +import {AddressDetailComponent} from './elements/address-detail.component'; import {LongInlineText} from './elements/long-inline-text.component'; -import {OffersInListComponent} from './elements/offers-in-list.component'; +import {OriginDetailComponent} from './elements/origin-detail.component'; +import {OriginInListComponent} from './elements/origin-in-list.component'; +import {CardOfArrayComponent} from './elements/simple-card.component'; import {DataListItem} from './list/data-list-item.component'; import {DataListComponent} from './list/data-list.component'; import {StAppsWebHttpClient} from './stapps-web-http-client.provider'; +import {ArticleDetailContentComponent} from './types/article/article-detail-content.component'; import {ArticleListItem} from './types/article/article-list-item.component'; +import {CatalogDetailContentComponent} from './types/catalog/catalog-detail-content.component'; import {CatalogListItem} from './types/catalog/catalog-list-item.component'; +import {DateSeriesDetailContentComponent} from './types/date-series/date-series-detail-content.component'; import {DateSeriesListItem} from './types/date-series/date-series-list-item.component'; import {DishDetailContentComponent} from './types/dish/dish-detail-content.component'; import {DishListItem} from './types/dish/dish-list-item.component'; +import {EventDetailContentComponent} from './types/event/event-detail-content.component'; import {EventListItemComponent} from './types/event/event-list-item.component'; +import {FavoriteDetailContentComponent} from './types/favorite/favorite-detail-content.component'; import {FavoriteListItem} from './types/favorite/favorite-list-item.component'; +import {MessageDetailContentComponent} from './types/message/message-detail-content.component'; import {MessageListItem} from './types/message/message-list-item.component'; +import {OrganizationDetailContentComponent} from './types/organization/organization-detail-content.component'; import {OrganizationListItem} from './types/organization/organization-list-item.component'; +import {PersonDetailContentComponent} from './types/person/person-detail-content.component'; import {PersonListItem} from './types/person/person-list-item.component'; +import {PlaceDetailContentComponent} from './types/place/place-detail-content.component'; import {PlaceListItem} from './types/place/place-list-item.component'; +import {SemesterDetailContentComponent} from './types/semester/semester-detail-content.component'; import {SemesterListItem} from './types/semester/semester-list-item.component'; +import {VideoDetailContentComponent} from './types/video/video-detail-content.component'; import {VideoListItem} from './types/video/video-list-item.component'; @NgModule({ declarations: [ + AcademicOffersDetailComponent, + AcademicOffersInListComponent, + AddressDetailComponent, + ArticleDetailContentComponent, ArticleListItem, + CardOfArrayComponent, + CatalogDetailContentComponent, CatalogListItem, DataDetailComponent, - + DataDetailContentComponent, + DataListComponent, + DataListItem, + DateSeriesDetailContentComponent, + DateSeriesListItem, DishDetailContentComponent, DishListItem, - + EventDetailContentComponent, EventListItemComponent, + FavoriteDetailContentComponent, FavoriteListItem, - - DataListItem, - DataListComponent, - DateSeriesListItem, - OffersInListComponent, - LongInlineText, - + MessageDetailContentComponent, MessageListItem, + OrganizationDetailContentComponent, OrganizationListItem, + OriginDetailComponent, + OriginInListComponent, + PersonDetailContentComponent, PersonListItem, + PlaceDetailContentComponent, PlaceListItem, + SemesterDetailContentComponent, SemesterListItem, + VideoDetailContentComponent, VideoListItem, ], entryComponents: [ @@ -77,6 +108,12 @@ import {VideoListItem} from './types/video/video-list-item.component'; FormsModule, DataRoutingModule, HttpClientModule, + MarkdownModule.forRoot(), + MomentModule.forRoot({ + relativeTimeThresholdOptions: { + 'm': 59, + }, + }), StorageModule, TranslateModule.forChild(), ], diff --git a/src/app/modules/data/detail/data-detail-content.component.ts b/src/app/modules/data/detail/data-detail-content.component.ts new file mode 100644 index 00000000..4095a7d5 --- /dev/null +++ b/src/app/modules/data/detail/data-detail-content.component.ts @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2019 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 {SCThings} from '@openstapps/core'; + +@Component({ + selector: 'stapps-data-detail-content', + templateUrl: 'data-detail-content.html', +}) +export class DataDetailContentComponent { + @Input() item: SCThings; +} diff --git a/src/app/modules/data/detail/data-detail-content.html b/src/app/modules/data/detail/data-detail-content.html new file mode 100644 index 00000000..a5745a70 --- /dev/null +++ b/src/app/modules/data/detail/data-detail-content.html @@ -0,0 +1,27 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/app/modules/data/detail/data-detail.component.ts b/src/app/modules/data/detail/data-detail.component.ts index 9e444f3f..82bdf5f8 100644 --- a/src/app/modules/data/detail/data-detail.component.ts +++ b/src/app/modules/data/detail/data-detail.component.ts @@ -15,18 +15,28 @@ import {Component} from '@angular/core'; import {ActivatedRoute} from '@angular/router'; import {IonRefresher} from '@ionic/angular'; -import {SCThing, SCUuid} from '@openstapps/core'; +import {LangChangeEvent, TranslateService} from '@ngx-translate/core'; +import {SCLanguageCode, SCThing, SCUuid} from '@openstapps/core'; import {DataProvider, DataScope} from '../data.provider'; @Component({ selector: 'stapps-data-detail', + styleUrls: ['data-detail.scss'], templateUrl: 'data-detail.html', }) export class DataDetailComponent { dataProvider: DataProvider; item: SCThing; - constructor(private route: ActivatedRoute, dataProvider: DataProvider) { + language: SCLanguageCode; + constructor(private route: ActivatedRoute, dataProvider: DataProvider, translateService: TranslateService) { this.dataProvider = dataProvider; + this.language = translateService.currentLang as SCLanguageCode; + + // alert(translateService.currentLang); + + translateService.onLangChange.subscribe((event: LangChangeEvent) => { + this.language = event.lang as SCLanguageCode; + }); } /** * Provides data item with given UID diff --git a/src/app/modules/data/detail/data-detail.html b/src/app/modules/data/detail/data-detail.html index ec5e0a27..a2b9e18c 100644 --- a/src/app/modules/data/detail/data-detail.html +++ b/src/app/modules/data/detail/data-detail.html @@ -14,12 +14,5 @@ - -
- - - -
+ diff --git a/src/app/modules/data/detail/data-detail.scss b/src/app/modules/data/detail/data-detail.scss index 4d7aa624..1829b4b8 100644 --- a/src/app/modules/data/detail/data-detail.scss +++ b/src/app/modules/data/detail/data-detail.scss @@ -1,3 +1,13 @@ -stapps-data-detail { - +::ng-deep { + ion-card-header { + font-weight: bold; + } +} + +::ng-deep { + ion-slides.work-locations { + ion-slide { + display: block; text-align: left; + } + } } diff --git a/src/app/modules/data/elements/offers-in-list.component.ts b/src/app/modules/data/elements/academic-offers-detail.component.ts similarity index 86% rename from src/app/modules/data/elements/offers-in-list.component.ts rename to src/app/modules/data/elements/academic-offers-detail.component.ts index c5ab3eab..c243b0b4 100644 --- a/src/app/modules/data/elements/offers-in-list.component.ts +++ b/src/app/modules/data/elements/academic-offers-detail.component.ts @@ -16,9 +16,9 @@ import {Component, Input} from '@angular/core'; import {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '@openstapps/core'; @Component({ - selector: 'stapps-offers-in-list', - templateUrl: 'offers-in-list.html', + selector: 'stapps-academic-offers-detail', + templateUrl: 'academic-offers-detail.html', }) -export class OffersInListComponent { +export class AcademicOffersDetailComponent { @Input() offers: Array>; } diff --git a/src/app/modules/data/elements/academic-offers-detail.html b/src/app/modules/data/elements/academic-offers-detail.html new file mode 100644 index 00000000..ab1ceb78 --- /dev/null +++ b/src/app/modules/data/elements/academic-offers-detail.html @@ -0,0 +1,36 @@ + + Offers + +
+

+ + {{offer.inPlace.name}},  + + {{offer.availabilityStarts | date}} + +

+ + + Students: + +

{{offer.prices.student | currency:'EUR':'symbol':undefined:'de'}}

+
+
+ + Employees: + +

{{offer.prices.employee | currency:'EUR':'symbol':undefined:'de'}} +

+
+
+ + Guests: + +

+ {{offer.prices.guest | currency:'EUR':'symbol':undefined:'de'}}

+
+
+
+
+
+
diff --git a/src/app/modules/data/elements/academic-offers-in-list.component.ts b/src/app/modules/data/elements/academic-offers-in-list.component.ts new file mode 100644 index 00000000..71b0beba --- /dev/null +++ b/src/app/modules/data/elements/academic-offers-in-list.component.ts @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2019 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 {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '@openstapps/core'; + +@Component({ + selector: 'stapps-academic-offers-in-list', + templateUrl: 'academic-offers-in-list.html', +}) +export class AcademicOffersInListComponent { + @Input() offers: Array>; +} diff --git a/src/app/modules/data/elements/offers-in-list.html b/src/app/modules/data/elements/academic-offers-in-list.html similarity index 100% rename from src/app/modules/data/elements/offers-in-list.html rename to src/app/modules/data/elements/academic-offers-in-list.html diff --git a/src/app/modules/data/elements/address-detail.component.ts b/src/app/modules/data/elements/address-detail.component.ts new file mode 100644 index 00000000..28c47ddf --- /dev/null +++ b/src/app/modules/data/elements/address-detail.component.ts @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2019 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 {SCPostalAddress} from '@openstapps/core'; + +@Component({ + selector: 'stapps-address-detail', + templateUrl: 'address-detail.html', +}) +export class AddressDetailComponent { + @Input() address: SCPostalAddress; +} diff --git a/src/app/modules/data/elements/address-detail.html b/src/app/modules/data/elements/address-detail.html new file mode 100644 index 00000000..77799282 --- /dev/null +++ b/src/app/modules/data/elements/address-detail.html @@ -0,0 +1,43 @@ + + Address + + + + Street: + + {{address.streetAddress}} + + + + Postal code: + + {{address.postalCode}} + + + + City: + + {{address.addressLocality}} + + + + Region: + + {{address.addressRegion}} + + + + Country: + + {{address.addressCountry}} + + + + Post office box: + + {{address.postOfficeBoxNumber}} + + + + + diff --git a/src/app/modules/data/elements/origin-detail.component.ts b/src/app/modules/data/elements/origin-detail.component.ts new file mode 100644 index 00000000..9aac3a43 --- /dev/null +++ b/src/app/modules/data/elements/origin-detail.component.ts @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2019 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 {SCThingOrigin} from '@openstapps/core'; + +@Component({ + selector: 'stapps-origin-detail', + templateUrl: 'origin-detail.html', +}) +export class OriginDetailComponent { + @Input() origin: SCThingOrigin; +} diff --git a/src/app/modules/data/elements/origin-detail.html b/src/app/modules/data/elements/origin-detail.html new file mode 100644 index 00000000..4d295502 --- /dev/null +++ b/src/app/modules/data/elements/origin-detail.html @@ -0,0 +1,25 @@ + + Origin(user) + +

Created: {{origin.created | amDateFormat:'DD. MMM YYYY'}}

+

Updated: {{origin.updated | amDateFormat:'DD. MMM YYYY'}}

+

Modified: {{origin.modified | amDateFormat:'DD. MMM YYYY'}}

+

+ Maintainer: {{origin.maintainer.name}} +

+
+
+ + + Origin(remote) + +

Indexed: {{origin.indexed | amDateFormat:'DD. MMM YYYY'}}

+

Modified: {{origin.modified | amDateFormat:'DD. MMM YYYY'}}

+

+ Maintainer: {{origin.maintainer.name}} +

+

+ Responsible: {{origin.responsibleEntity.name}} +

+
+
diff --git a/src/app/modules/data/elements/origin-in-list.component.ts b/src/app/modules/data/elements/origin-in-list.component.ts new file mode 100644 index 00000000..966ca218 --- /dev/null +++ b/src/app/modules/data/elements/origin-in-list.component.ts @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2019 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 {SCThingOrigin} from '@openstapps/core'; + +@Component({ + selector: 'stapps-origin-in-list', + templateUrl: 'origin-in-list.html', +}) +export class OriginInListComponent { + @Input() origin: SCThingOrigin; +} diff --git a/src/app/modules/data/elements/origin-in-list.html b/src/app/modules/data/elements/origin-in-list.html new file mode 100644 index 00000000..5ccfbcd0 --- /dev/null +++ b/src/app/modules/data/elements/origin-in-list.html @@ -0,0 +1,7 @@ +
+

{{origin.created | amDateFormat:'DD. MMM YY'}}

+
+ +
+

{{origin.indexed | amDateFormat:'DD. MMM YY'}}

+
diff --git a/src/app/modules/data/elements/simple-card.component.ts b/src/app/modules/data/elements/simple-card.component.ts new file mode 100644 index 00000000..ea25da18 --- /dev/null +++ b/src/app/modules/data/elements/simple-card.component.ts @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2019 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 {isThing, SCThing} from '@openstapps/core'; + +@Component({ + selector: 'stapps-simple-card', + templateUrl: 'simple-card.html', +}) +export class CardOfArrayComponent { + areThings: boolean = false; + @Input() content: string | string[] | SCThing[]; + @Input() isMarkdown: boolean = false; + @Input() title: string; + isString(data: any): data is string { + return typeof data === 'string'; + } + isThing(something: any): something is SCThing { + return isThing(something); + } +} diff --git a/src/app/modules/data/elements/simple-card.html b/src/app/modules/data/elements/simple-card.html new file mode 100644 index 00000000..a0eca93c --- /dev/null +++ b/src/app/modules/data/elements/simple-card.html @@ -0,0 +1,27 @@ + + {{title}} + + + + + + + + +

{{content}}

+
+
+ + + + + +

{{thing.name}}

+
+
+ +

{{text}}

+
+
+
+
diff --git a/src/app/modules/data/list/data-list-item.html b/src/app/modules/data/list/data-list-item.html index 81af259a..a70f3a39 100644 --- a/src/app/modules/data/list/data-list-item.html +++ b/src/app/modules/data/list/data-list-item.html @@ -16,6 +16,7 @@ + diff --git a/src/app/modules/data/list/data-list-item.scss b/src/app/modules/data/list/data-list-item.scss index f540841a..8c5d379f 100644 --- a/src/app/modules/data/list/data-list-item.scss +++ b/src/app/modules/data/list/data-list-item.scss @@ -1,5 +1,5 @@ ::ng-deep { h2.name { - font-weight: bold !important; + font-weight: bold; } } diff --git a/src/app/modules/data/types/article/article-detail-content.component.ts b/src/app/modules/data/types/article/article-detail-content.component.ts new file mode 100644 index 00000000..47494977 --- /dev/null +++ b/src/app/modules/data/types/article/article-detail-content.component.ts @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2019 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 {SCArticle, SCThing, SCTranslations} from '@openstapps/core'; +import {SCThingTranslator} from '@openstapps/core'; + +@Component({ + selector: 'stapps-article-detail-content', + templateUrl: 'article-detail-content.html', +}) +export class ArticleDetailContentComponent { + @Input() item: SCArticle; + @Input() language: keyof SCTranslations; + objectKeys = Object.keys; + translator: SCThingTranslator; + constructor() { + this.translator = new SCThingTranslator(this.language, 'de'); + } +} diff --git a/src/app/modules/data/types/article/article-detail-content.html b/src/app/modules/data/types/article/article-detail-content.html new file mode 100644 index 00000000..fc4ebe69 --- /dev/null +++ b/src/app/modules/data/types/article/article-detail-content.html @@ -0,0 +1,6 @@ + + + + + diff --git a/src/app/modules/data/types/article/article-list-item.html b/src/app/modules/data/types/article/article-list-item.html index e69c36ab..4e39050b 100644 --- a/src/app/modules/data/types/article/article-list-item.html +++ b/src/app/modules/data/types/article/article-list-item.html @@ -6,7 +6,7 @@

- {{item.categories.join(', ')}} + {{item.type}}
diff --git a/src/app/modules/data/types/catalog/catalog-detail-content.component.ts b/src/app/modules/data/types/catalog/catalog-detail-content.component.ts new file mode 100644 index 00000000..ee09c206 --- /dev/null +++ b/src/app/modules/data/types/catalog/catalog-detail-content.component.ts @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2019 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 {SCCatalog, SCThing, SCTranslations} from '@openstapps/core'; +import {SCThingTranslator} from '@openstapps/core'; + +@Component({ + selector: 'stapps-catalog-detail-content', + templateUrl: 'catalog-detail-content.html', +}) +export class CatalogDetailContentComponent { + @Input() item: SCCatalog; + @Input() language: keyof SCTranslations; + objectKeys = Object.keys; + translator: SCThingTranslator; + constructor() { + this.translator = new SCThingTranslator(this.language, 'de'); + } +} diff --git a/src/app/modules/data/types/catalog/catalog-detail-content.html b/src/app/modules/data/types/catalog/catalog-detail-content.html new file mode 100644 index 00000000..8805385b --- /dev/null +++ b/src/app/modules/data/types/catalog/catalog-detail-content.html @@ -0,0 +1,2 @@ + + diff --git a/src/app/modules/data/types/date-series/date-series-detail-content.component.ts b/src/app/modules/data/types/date-series/date-series-detail-content.component.ts new file mode 100644 index 00000000..c2eba501 --- /dev/null +++ b/src/app/modules/data/types/date-series/date-series-detail-content.component.ts @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2019 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, SCThing, SCTranslations} from '@openstapps/core'; +import {SCThingTranslator} from '@openstapps/core'; + +@Component({ + selector: 'stapps-date-series-detail-content', + templateUrl: 'date-series-detail-content.html', +}) +export class DateSeriesDetailContentComponent { + @Input() item: SCDateSeries; + @Input() language: keyof SCTranslations; + objectKeys = Object.keys; + translator: SCThingTranslator; + constructor() { + this.translator = new SCThingTranslator(this.language, 'de'); + } +} diff --git a/src/app/modules/data/types/date-series/date-series-detail-content.html b/src/app/modules/data/types/date-series/date-series-detail-content.html new file mode 100644 index 00000000..c6749c73 --- /dev/null +++ b/src/app/modules/data/types/date-series/date-series-detail-content.html @@ -0,0 +1,13 @@ + + + Place + + + {{item.inPlace.name}} + + + + + + + diff --git a/src/app/modules/data/types/date-series/date-series-list-item.html b/src/app/modules/data/types/date-series/date-series-list-item.html index a7c72c54..f04678c3 100644 --- a/src/app/modules/data/types/date-series/date-series-list-item.html +++ b/src/app/modules/data/types/date-series/date-series-list-item.html @@ -4,12 +4,15 @@

{{item.name}}

- {{item.frequency}}, {{item.dates[0] | date: 'shortDate'}} - {{item.dates[item.dates.length-1] | date: 'shortDate'}} + + {{item.frequency}}, {{item.dates[0] | amDateFormat:'dddd'}} + ({{item.dates[0] | amDateFormat:'DD. MMM YYYY'}} - {{item.dates[item.dates.length - 1] | amDateFormat:'DD. MMM YYYY'}}) +

{{item.event.categories.join(', ')}}
- +
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 index 5c635092..d235397e 100644 --- a/src/app/modules/data/types/dish/dish-detail-content.component.ts +++ b/src/app/modules/data/types/dish/dish-detail-content.component.ts @@ -13,8 +13,8 @@ * this program. If not, see . */ import {Component, Input} from '@angular/core'; -import {LangChangeEvent, TranslateService} from '@ngx-translate/core'; -import {SCDish, SCLanguageName} from '@openstapps/core'; +import {SCDish, SCThing, SCTranslations} from '@openstapps/core'; +import {SCThingTranslator} from '@openstapps/core'; @Component({ selector: 'stapps-dish-detail-content', @@ -22,14 +22,10 @@ import {SCDish, SCLanguageName} from '@openstapps/core'; }) export class DishDetailContentComponent { @Input() item: SCDish; - language: SCLanguageName; + @Input() language: keyof SCTranslations; objectKeys = Object.keys; - - constructor(translateService: TranslateService) { - this.language = translateService.currentLang as SCLanguageName; - - translateService.onLangChange.subscribe((event: LangChangeEvent) => { - this.language = event.lang as SCLanguageName; - }); + translator: SCThingTranslator; + constructor() { + this.translator = new SCThingTranslator(this.language, 'de'); } } diff --git a/src/app/modules/data/types/dish/dish-detail-content.html b/src/app/modules/data/types/dish/dish-detail-content.html index d0056ae6..4f1ecd86 100644 --- a/src/app/modules/data/types/dish/dish-detail-content.html +++ b/src/app/modules/data/types/dish/dish-detail-content.html @@ -1,49 +1,58 @@ - - {{meta.getFieldTranslation(language, 'description')}} - {{item.description}} - - - - {{meta.getFieldTranslation(language, 'categories')}} - {{item.categories.join(', ')}} - - + + - {{meta.getFieldTranslation(language, 'characteristics')}} - {{item.characteristics.join(', ')}} + Characteristics + +

+  {{characteristic.name}}   +

+
- - - {{meta.getFieldTranslation(language, 'additives')}} - {{item.additives.join(', ')}} - - - - + diff --git a/src/app/modules/data/types/dish/dish-list-item.html b/src/app/modules/data/types/dish/dish-list-item.html index 8cf9c462..81a6fd29 100644 --- a/src/app/modules/data/types/dish/dish-list-item.html +++ b/src/app/modules/data/types/dish/dish-list-item.html @@ -6,7 +6,7 @@

{{item.categories.join(',')}}

- + diff --git a/src/app/modules/data/types/event/event-detail-content.component.ts b/src/app/modules/data/types/event/event-detail-content.component.ts new file mode 100644 index 00000000..69603ecc --- /dev/null +++ b/src/app/modules/data/types/event/event-detail-content.component.ts @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2019 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 {SCAcademicEvent, SCSportCourse, SCThing, SCTranslations} from '@openstapps/core'; +import {SCThingTranslator} from '@openstapps/core'; + +@Component({ + selector: 'stapps-event-detail-content', + templateUrl: 'event-detail-content.html', +}) +export class EventDetailContentComponent { + @Input() item: SCAcademicEvent | SCSportCourse; + @Input() language: keyof SCTranslations; + objectKeys = Object.keys; + translator: SCThingTranslator; + constructor() { + this.translator = new SCThingTranslator(this.language, 'de'); + } +} diff --git a/src/app/modules/data/types/event/event-detail-content.html b/src/app/modules/data/types/event/event-detail-content.html new file mode 100644 index 00000000..b679bafc --- /dev/null +++ b/src/app/modules/data/types/event/event-detail-content.html @@ -0,0 +1,6 @@ + + + + + + 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 index 2b96117e..9d29282e 100644 --- a/src/app/modules/data/types/event/event-list-item.component.ts +++ b/src/app/modules/data/types/event/event-list-item.component.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018, 2019 StApps + * Copyright (C) 2019 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. diff --git a/src/app/modules/data/types/favorite/favorite-detail-content.component.ts b/src/app/modules/data/types/favorite/favorite-detail-content.component.ts new file mode 100644 index 00000000..5fc441a8 --- /dev/null +++ b/src/app/modules/data/types/favorite/favorite-detail-content.component.ts @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2019 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 {SCFavorite, SCThing, SCTranslations} from '@openstapps/core'; +import {SCThingTranslator} from '@openstapps/core'; + +@Component({ + selector: 'stapps-favorite-detail-content', + templateUrl: 'favorite-detail-content.html', +}) +export class FavoriteDetailContentComponent { + @Input() item: SCFavorite; + @Input() language: keyof SCTranslations; + objectKeys = Object.keys; + translator: SCThingTranslator; + constructor() { + this.translator = new SCThingTranslator(this.language, 'de'); + } +} diff --git a/src/app/modules/data/types/favorite/favorite-detail-content.html b/src/app/modules/data/types/favorite/favorite-detail-content.html new file mode 100644 index 00000000..956ee1cd --- /dev/null +++ b/src/app/modules/data/types/favorite/favorite-detail-content.html @@ -0,0 +1 @@ + diff --git a/src/app/modules/data/types/favorite/favorite-list-item.html b/src/app/modules/data/types/favorite/favorite-list-item.html index 23b4af44..e35402d3 100644 --- a/src/app/modules/data/types/favorite/favorite-list-item.html +++ b/src/app/modules/data/types/favorite/favorite-list-item.html @@ -5,9 +5,10 @@

- {{item.data.type}} + {{item.type}} ({{item.data.type}}) + diff --git a/src/app/modules/data/types/message/message-detail-content.component.ts b/src/app/modules/data/types/message/message-detail-content.component.ts new file mode 100644 index 00000000..e9b4284d --- /dev/null +++ b/src/app/modules/data/types/message/message-detail-content.component.ts @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2019 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 {SCMessage, SCThing, SCTranslations} from '@openstapps/core'; +import {SCThingTranslator} from '@openstapps/core'; + +@Component({ + selector: 'stapps-message-detail-content', + templateUrl: 'message-detail-content.html', +}) +export class MessageDetailContentComponent { + @Input() item: SCMessage; + @Input() language: keyof SCTranslations; + objectKeys = Object.keys; + translator: SCThingTranslator; + constructor() { + this.translator = new SCThingTranslator(this.language, 'de'); + } +} diff --git a/src/app/modules/data/types/message/message-detail-content.html b/src/app/modules/data/types/message/message-detail-content.html new file mode 100644 index 00000000..e9b5cfd3 --- /dev/null +++ b/src/app/modules/data/types/message/message-detail-content.html @@ -0,0 +1,5 @@ + + + + + diff --git a/src/app/modules/data/types/message/message-list-item.html b/src/app/modules/data/types/message/message-list-item.html index b4ed7591..40de0c58 100644 --- a/src/app/modules/data/types/message/message-list-item.html +++ b/src/app/modules/data/types/message/message-list-item.html @@ -5,6 +5,7 @@

+ {{item.type}} diff --git a/src/app/modules/data/types/organization/organization-detail-content.component.ts b/src/app/modules/data/types/organization/organization-detail-content.component.ts new file mode 100644 index 00000000..3012bb50 --- /dev/null +++ b/src/app/modules/data/types/organization/organization-detail-content.component.ts @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2019 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 {SCOrganization, SCThing, SCTranslations} from '@openstapps/core'; +import {SCThingTranslator} from '@openstapps/core'; + +@Component({ + selector: 'stapps-organization-detail-content', + templateUrl: 'organization-detail-content.html', +}) +export class OrganizationDetailContentComponent { + @Input() item: SCOrganization; + @Input() language: keyof SCTranslations; + objectKeys = Object.keys; + translator: SCThingTranslator; + constructor() { + this.translator = new SCThingTranslator(this.language, 'de'); + } +} diff --git a/src/app/modules/data/types/organization/organization-detail-content.html b/src/app/modules/data/types/organization/organization-detail-content.html new file mode 100644 index 00000000..8d4972fc --- /dev/null +++ b/src/app/modules/data/types/organization/organization-detail-content.html @@ -0,0 +1,9 @@ + + + Place + + + {{item.inPlace.name}} + + + diff --git a/src/app/modules/data/types/person/person-detail-content.component.ts b/src/app/modules/data/types/person/person-detail-content.component.ts new file mode 100644 index 00000000..000c8ddb --- /dev/null +++ b/src/app/modules/data/types/person/person-detail-content.component.ts @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2019 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 {SCPerson, SCThing, SCTranslations} from '@openstapps/core'; +import {SCThingTranslator} from '@openstapps/core'; + +@Component({ + selector: 'stapps-person-detail-content', + templateUrl: 'person-detail-content.html', +}) +export class PersonDetailContentComponent { + @Input() item: SCPerson; + @Input() language: keyof SCTranslations; + objectKeys = Object.keys; + translator: SCThingTranslator; + constructor() { + this.translator = new SCThingTranslator(this.language, 'de'); + } +} diff --git a/src/app/modules/data/types/person/person-detail-content.html b/src/app/modules/data/types/person/person-detail-content.html new file mode 100644 index 00000000..e3e556e0 --- /dev/null +++ b/src/app/modules/data/types/person/person-detail-content.html @@ -0,0 +1,38 @@ + + + Contact information + + + +

Tel: {{item.workLocations[0].telephone}} +

+

Email: {{item.workLocations[0].email}}

+

Fax: {{item.workLocations[0].faxNumber}}

+

URL: {{item.workLocations[0].url}} +

+

Office: {{item.workLocations[0].areaServed.name}} +

+
+ + +

Tel: {{workLocation.telephone}} +

+

Email: {{workLocation.email}} +

+

Fax: {{workLocation.faxNumber}}

+

URL: {{workLocation.url}}

+

Office: {{workLocation.areaServed.name}} +

+ + +
+
+
+
+ diff --git a/src/app/modules/data/types/place/place-detail-content.component.ts b/src/app/modules/data/types/place/place-detail-content.component.ts new file mode 100644 index 00000000..85a48109 --- /dev/null +++ b/src/app/modules/data/types/place/place-detail-content.component.ts @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2019 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 {SCBuilding, SCFloor, SCPointOfInterest, SCRoom, SCThing, SCTranslations} from '@openstapps/core'; +import {SCThingTranslator} from '@openstapps/core'; + +@Component({ + selector: 'stapps-place-detail-content', + templateUrl: 'place-detail-content.html', +}) +export class PlaceDetailContentComponent { + @Input() item: SCBuilding | SCRoom | SCPointOfInterest | SCFloor; + @Input() language: keyof SCTranslations; + objectKeys = Object.keys; + translator: SCThingTranslator; + constructor() { + this.translator = new SCThingTranslator(this.language, 'de'); + } +} diff --git a/src/app/modules/data/types/place/place-detail-content.html b/src/app/modules/data/types/place/place-detail-content.html new file mode 100644 index 00000000..502e8271 --- /dev/null +++ b/src/app/modules/data/types/place/place-detail-content.html @@ -0,0 +1,15 @@ + + + + + + + + Building: + + + {{item.inPlace.name}} + + + + diff --git a/src/app/modules/data/types/place/place-list-item.component.ts b/src/app/modules/data/types/place/place-list-item.component.ts index a563e885..98054dbb 100644 --- a/src/app/modules/data/types/place/place-list-item.component.ts +++ b/src/app/modules/data/types/place/place-list-item.component.ts @@ -13,7 +13,7 @@ * this program. If not, see . */ import {Component, Input} from '@angular/core'; -import {SCBuilding, SCPointOfInterest, SCRoom} from '@openstapps/core'; +import {SCBuilding, SCFloor, SCPointOfInterest, SCRoom} from '@openstapps/core'; import {DataListItem} from '../../list/data-list-item.component'; @Component({ @@ -22,7 +22,7 @@ import {DataListItem} from '../../list/data-list-item.component'; }) export class PlaceListItem extends DataListItem { - @Input() item: SCBuilding | SCRoom | SCPointOfInterest; + @Input() item: SCBuilding | SCRoom | SCPointOfInterest | SCFloor; ngOnInit() { // TODO: translation diff --git a/src/app/modules/data/types/place/place-list-item.html b/src/app/modules/data/types/place/place-list-item.html index 37e59e44..eaf8b55f 100644 --- a/src/app/modules/data/types/place/place-list-item.html +++ b/src/app/modules/data/types/place/place-list-item.html @@ -6,7 +6,9 @@ {{item.type}} - {{item.inPlace.name}} + + {{item.inPlace.name}} + diff --git a/src/app/modules/data/types/semester/semester-detail-content.component.ts b/src/app/modules/data/types/semester/semester-detail-content.component.ts new file mode 100644 index 00000000..6e1dad53 --- /dev/null +++ b/src/app/modules/data/types/semester/semester-detail-content.component.ts @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2019 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 {SCSemester, SCThing, SCTranslations} from '@openstapps/core'; +import {SCThingTranslator} from '@openstapps/core'; + +@Component({ + selector: 'stapps-semester-detail-content', + templateUrl: 'semester-detail-content.html', +}) +export class SemesterDetailContentComponent { + @Input() item: SCSemester; + @Input() language: keyof SCTranslations; + objectKeys = Object.keys; + translator: SCThingTranslator; + constructor() { + this.translator = new SCThingTranslator(this.language, 'de'); + } +} diff --git a/src/app/modules/data/types/semester/semester-detail-content.html b/src/app/modules/data/types/semester/semester-detail-content.html new file mode 100644 index 00000000..0fbef74c --- /dev/null +++ b/src/app/modules/data/types/semester/semester-detail-content.html @@ -0,0 +1,2 @@ + + diff --git a/src/app/modules/data/types/semester/semester-list-item.html b/src/app/modules/data/types/semester/semester-list-item.html index e69de29b..978d5fb6 100644 --- a/src/app/modules/data/types/semester/semester-list-item.html +++ b/src/app/modules/data/types/semester/semester-list-item.html @@ -0,0 +1,12 @@ + + + +

{{item.name}}

+

+ + {{item.startDate | amDateFormat: 'DD. MMM YYYY'}} - {{item.endDate | amDateFormat:'DD. MMM YYYY'}} +

+ {{item.type}} +
+
+
diff --git a/src/app/modules/data/types/video/video-detail-content.component.ts b/src/app/modules/data/types/video/video-detail-content.component.ts new file mode 100644 index 00000000..6145f6df --- /dev/null +++ b/src/app/modules/data/types/video/video-detail-content.component.ts @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2018, 2019 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 {SCThing, SCTranslations, SCVideo} from '@openstapps/core'; +import {SCThingTranslator} from '@openstapps/core'; + +@Component({ + selector: 'stapps-video-detail-content', + templateUrl: 'video-detail-content.html', +}) +export class VideoDetailContentComponent { + @Input() item: SCVideo; + @Input() language: keyof SCTranslations; + objectKeys = Object.keys; + translator: SCThingTranslator; + constructor() { + this.translator = new SCThingTranslator(this.language, 'de'); + } +} diff --git a/src/app/modules/data/types/video/video-detail-content.html b/src/app/modules/data/types/video/video-detail-content.html new file mode 100644 index 00000000..1c8ce9fd --- /dev/null +++ b/src/app/modules/data/types/video/video-detail-content.html @@ -0,0 +1,6 @@ + + + + + diff --git a/src/app/modules/data/types/video/video-list-item.html b/src/app/modules/data/types/video/video-list-item.html index 8aadf60d..a42c3b1c 100644 --- a/src/app/modules/data/types/video/video-list-item.html +++ b/src/app/modules/data/types/video/video-list-item.html @@ -3,6 +3,7 @@

{{item.name}}

+

Duration: {{item.duration | amDuration:'seconds'}}

{{item.type}}
diff --git a/src/app/modules/settings/page/settings-page.component.ts b/src/app/modules/settings/page/settings-page.component.ts index c5932d78..5d7c8136 100644 --- a/src/app/modules/settings/page/settings-page.component.ts +++ b/src/app/modules/settings/page/settings-page.component.ts @@ -12,7 +12,7 @@ * 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 {Component} from '@angular/core'; import {LangChangeEvent, TranslateService} from '@ngx-translate/core'; import {SCSettingMeta, SCTranslations} from '@openstapps/core'; import {SettingsCache, SettingsProvider} from '../settings.provider'; @@ -21,7 +21,7 @@ import {SettingsCache, SettingsProvider} from '../settings.provider'; selector: 'stapps-settings-page', templateUrl: 'settings-page.html', }) -export class SettingsPageComponent implements OnInit { +export class SettingsPageComponent { categoriesOrder: string[]; // limit to languages that are available in StApps Core language: keyof SCTranslations;