feat(data): add data detail templates

Additionally clean up the code
This commit is contained in:
Jovan Krunić
2019-04-12 14:14:22 +02:00
parent 75ca8c8a73
commit 5855accc16
58 changed files with 1014 additions and 90 deletions
+71 -2
View File
@@ -2631,6 +2631,11 @@
"resolved": "https://registry.npmjs.org/@types/json-patch/-/json-patch-0.0.30.tgz", "resolved": "https://registry.npmjs.org/@types/json-patch/-/json-patch-0.0.30.tgz",
"integrity": "sha512-MhCUjojzDhVLnZnxwPwa+rETFRDQ0ffjxYdrqOP6TBO2O0/Z64PV5tNeYApo4bc4y4frbWOrRwv/eEkXlI13Rw==" "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": { "@types/node": {
"version": "11.13.2", "version": "11.13.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.2.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.2.tgz",
@@ -4368,6 +4373,17 @@
"integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=",
"dev": true "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": { "cliui": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", "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", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" "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": { "delegates": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
@@ -7243,6 +7265,15 @@
"minimatch": "~3.0.2" "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": { "graceful-fs": {
"version": "4.1.15", "version": "4.1.15",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz",
@@ -9296,8 +9327,7 @@
"marked": { "marked": {
"version": "0.6.1", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.6.1.tgz", "resolved": "https://registry.npmjs.org/marked/-/marked-0.6.1.tgz",
"integrity": "sha512-+H0L3ibcWhAZE02SKMqmvYsErLo4EAVJxu5h3bHBBDvvjeWXtl92rGUSBYHL2++5Y+RSNgl8dYOAXcYe7lp1fA==", "integrity": "sha512-+H0L3ibcWhAZE02SKMqmvYsErLo4EAVJxu5h3bHBBDvvjeWXtl92rGUSBYHL2++5Y+RSNgl8dYOAXcYe7lp1fA=="
"dev": true
}, },
"md5.js": { "md5.js": {
"version": "1.3.5", "version": "1.3.5",
@@ -9708,6 +9738,25 @@
"integrity": "sha1-a+lPysqNd63gqWcNxGCRTJRHJEQ=", "integrity": "sha1-a+lPysqNd63gqWcNxGCRTJRHJEQ=",
"dev": true "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": { "nice-try": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
@@ -10919,6 +10968,14 @@
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
"dev": true "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": { "process": {
"version": "0.11.10", "version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "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": { "select-hose": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz",
@@ -13336,6 +13399,12 @@
"setimmediate": "^1.0.4" "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": { "tiny-inflate": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.2.tgz", "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.2.tgz",
+3
View File
@@ -54,6 +54,9 @@
"cordova-plugin-splashscreen": "5.0.2", "cordova-plugin-splashscreen": "5.0.2",
"cordova-plugin-whitelist": "1.3.3", "cordova-plugin-whitelist": "1.3.3",
"core-js": "2.6.5", "core-js": "2.6.5",
"moment": "2.24.0",
"ngx-markdown": "7.1.4",
"ngx-moment": "3.4.0",
"rxjs": "6.4.0", "rxjs": "6.4.0",
"zone.js": "0.9.0" "zone.js": "0.9.0"
}, },
@@ -1,3 +1,4 @@
/* tslint:disable */
export const sampleResources = [{ export const sampleResources = [{
'errorNames': [], 'errorNames': [],
"instance": { "instance": {
@@ -1423,7 +1424,17 @@ export const sampleResources = [{
'created': '2018-09-11T12:30:00Z', 'created': '2018-09-11T12:30:00Z',
'deleted': false, 'deleted': false,
'type': 'user', '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', 'schema': 'SCFavorite',
@@ -29262,6 +29273,7 @@ export const sampleResources = [{
'audiences': [ 'audiences': [
'students' 'students'
], ],
'datePublished': '2018-08-01',
'origin': { 'origin': {
'indexed': '2018-09-11T12:30:00Z', 'indexed': '2018-09-11T12:30:00Z',
'name': 'Dummy', 'name': 'Dummy',
@@ -29284,6 +29296,7 @@ export const sampleResources = [{
'audiences': [ 'audiences': [
'students' 'students'
], ],
'datePublished': '2018-08-01',
'origin': { 'origin': {
'indexed': '2018-09-11T12:30:00Z', 'indexed': '2018-09-11T12:30:00Z',
'name': 'foo', 'name': 'foo',
@@ -29307,6 +29320,7 @@ export const sampleResources = [{
'audiences': [ 'audiences': [
'students' 'students'
], ],
'datePublished': '2018-08-01',
'origin': { 'origin': {
'indexed': '2018-09-11T12:30:00Z', 'indexed': '2018-09-11T12:30:00Z',
'name': 'Dummy', 'name': 'Dummy',
+47 -10
View File
@@ -18,54 +18,85 @@ import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {IonicModule} from '@ionic/angular'; import {IonicModule} from '@ionic/angular';
import {TranslateModule} from '@ngx-translate/core'; import {TranslateModule} from '@ngx-translate/core';
import {MarkdownModule} from 'ngx-markdown';
import {MomentModule} from 'ngx-moment';
import {StorageModule} from '../storage/storage.module'; import {StorageModule} from '../storage/storage.module';
import {DataFacetsProvider} from './data-facets.provider'; import {DataFacetsProvider} from './data-facets.provider';
import {DataRoutingModule} from './data-routing.module'; import {DataRoutingModule} from './data-routing.module';
import {DataProvider} from './data.provider'; import {DataProvider} from './data.provider';
import {DataDetailContentComponent} from './detail/data-detail-content.component';
import {DataDetailComponent} from './detail/data-detail.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 {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 {DataListItem} from './list/data-list-item.component';
import {DataListComponent} from './list/data-list.component'; import {DataListComponent} from './list/data-list.component';
import {StAppsWebHttpClient} from './stapps-web-http-client.provider'; 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 {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 {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 {DateSeriesListItem} from './types/date-series/date-series-list-item.component';
import {DishDetailContentComponent} from './types/dish/dish-detail-content.component'; import {DishDetailContentComponent} from './types/dish/dish-detail-content.component';
import {DishListItem} from './types/dish/dish-list-item.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 {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 {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 {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 {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 {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 {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 {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'; import {VideoListItem} from './types/video/video-list-item.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
AcademicOffersDetailComponent,
AcademicOffersInListComponent,
AddressDetailComponent,
ArticleDetailContentComponent,
ArticleListItem, ArticleListItem,
CardOfArrayComponent,
CatalogDetailContentComponent,
CatalogListItem, CatalogListItem,
DataDetailComponent, DataDetailComponent,
DataDetailContentComponent,
DataListComponent,
DataListItem,
DateSeriesDetailContentComponent,
DateSeriesListItem,
DishDetailContentComponent, DishDetailContentComponent,
DishListItem, DishListItem,
EventDetailContentComponent,
EventListItemComponent, EventListItemComponent,
FavoriteDetailContentComponent,
FavoriteListItem, FavoriteListItem,
DataListItem,
DataListComponent,
DateSeriesListItem,
OffersInListComponent,
LongInlineText, LongInlineText,
MessageDetailContentComponent,
MessageListItem, MessageListItem,
OrganizationDetailContentComponent,
OrganizationListItem, OrganizationListItem,
OriginDetailComponent,
OriginInListComponent,
PersonDetailContentComponent,
PersonListItem, PersonListItem,
PlaceDetailContentComponent,
PlaceListItem, PlaceListItem,
SemesterDetailContentComponent,
SemesterListItem, SemesterListItem,
VideoDetailContentComponent,
VideoListItem, VideoListItem,
], ],
entryComponents: [ entryComponents: [
@@ -77,6 +108,12 @@ import {VideoListItem} from './types/video/video-list-item.component';
FormsModule, FormsModule,
DataRoutingModule, DataRoutingModule,
HttpClientModule, HttpClientModule,
MarkdownModule.forRoot(),
MomentModule.forRoot({
relativeTimeThresholdOptions: {
'm': 59,
},
}),
StorageModule, StorageModule,
TranslateModule.forChild(), TranslateModule.forChild(),
], ],
@@ -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 <https://www.gnu.org/licenses/>.
*/
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;
}
@@ -0,0 +1,27 @@
<stapps-simple-card *ngIf="item.description" [title]="'Description'" [content]="item.description"></stapps-simple-card>
<div [ngSwitch]="true" lines="full">
<stapps-dish-detail-content [item]="item" [language]="language" *ngSwitchCase="item.type === 'dish'">
</stapps-dish-detail-content>
<stapps-place-detail-content [item]="item" [language]="language"
*ngSwitchCase="item.type === 'building' || item.type === 'point of interest' || item.type === 'room' || item.type === 'floor'">
</stapps-place-detail-content>
<stapps-event-detail-content [item]="item" [language]="language"
*ngSwitchCase="item.type === 'academic event' || item.type === 'sport course'"></stapps-event-detail-content>
<stapps-person-detail-content [item]="item" [language]="language" *ngSwitchCase="item.type === 'person'">
</stapps-person-detail-content>
<stapps-favorite-detail-content [item]="item" [language]="language" *ngSwitchCase="item.type === 'favorite'">
</stapps-favorite-detail-content>
<stapps-catalog-detail-content [item]="item" [language]="language" *ngSwitchCase="item.type === 'catalog'">
</stapps-catalog-detail-content>
<stapps-message-detail-content [item]="item" [language]="language" *ngSwitchCase="item.type === 'message'">
</stapps-message-detail-content>
<stapps-date-series-detail-content [item]="item" [language]="language" *ngSwitchCase="item.type === 'date series'">
</stapps-date-series-detail-content>
<stapps-article-detail-content [item]="item" [language]="language" *ngSwitchCase="item.type === 'article'">
</stapps-article-detail-content>
<stapps-video-detail-content [item]="item" [language]="language" *ngSwitchCase="item.type === 'video'">
</stapps-video-detail-content>
<stapps-semester-detail-content [item]="item" [language]="language" *ngSwitchCase="item.type === 'semester'">
</stapps-semester-detail-content>
<stapps-origin-detail [origin]="item.origin" ></stapps-origin-detail>
</div>
@@ -15,18 +15,28 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {IonRefresher} from '@ionic/angular'; 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'; import {DataProvider, DataScope} from '../data.provider';
@Component({ @Component({
selector: 'stapps-data-detail', selector: 'stapps-data-detail',
styleUrls: ['data-detail.scss'],
templateUrl: 'data-detail.html', templateUrl: 'data-detail.html',
}) })
export class DataDetailComponent { export class DataDetailComponent {
dataProvider: DataProvider; dataProvider: DataProvider;
item: SCThing; item: SCThing;
constructor(private route: ActivatedRoute, dataProvider: DataProvider) { language: SCLanguageCode;
constructor(private route: ActivatedRoute, dataProvider: DataProvider, translateService: TranslateService) {
this.dataProvider = dataProvider; 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 * Provides data item with given UID
+1 -8
View File
@@ -14,12 +14,5 @@
</ion-refresher-content> </ion-refresher-content>
</ion-refresher> </ion-refresher>
<stapps-data-list-item [item]="item"></stapps-data-list-item> <stapps-data-list-item [item]="item"></stapps-data-list-item>
<stapps-data-detail-content [item]="item"></stapps-data-detail-content>
<div [ngSwitch]="item.type">
<!-- <stapps-dish-detail-content [item]="item" *ngSwitchCase="'dish'"></stapps-dish-detail-content> -->
<!-- <span *ngSwitchDefault>
<p *ngIf="item.description">{{item.description}}</p>
</span> -->
</div>
</ion-content> </ion-content>
+11 -1
View File
@@ -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;
}
}
} }
@@ -16,9 +16,9 @@ import {Component, Input} from '@angular/core';
import {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '@openstapps/core'; import {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '@openstapps/core';
@Component({ @Component({
selector: 'stapps-offers-in-list', selector: 'stapps-academic-offers-detail',
templateUrl: 'offers-in-list.html', templateUrl: 'academic-offers-detail.html',
}) })
export class OffersInListComponent { export class AcademicOffersDetailComponent {
@Input() offers: Array<SCThingThatCanBeOfferedOffer<SCAcademicPriceGroup>>; @Input() offers: Array<SCThingThatCanBeOfferedOffer<SCAcademicPriceGroup>>;
} }
@@ -0,0 +1,36 @@
<ion-card>
<ion-card-header>Offers</ion-card-header>
<ion-card-content>
<div *ngFor="let offer of offers">
<p *ngIf="offer.inPlace">
<ion-icon name="pin"></ion-icon>
<a [routerLink]="['/data-detail', offer.inPlace.uid]">{{offer.inPlace.name}}</a>,&nbsp;
<span *ngIf="offer.availabilityStarts">
<ion-icon name="calendar"></ion-icon> {{offer.availabilityStarts | date}}
</span>
</p>
<ion-grid>
<ion-row *ngIf="offer.prices.student">
<ion-col>Students:</ion-col>
<ion-col width-20 text-right>
<p *ngIf="offer.prices.student"> {{offer.prices.student | currency:'EUR':'symbol':undefined:'de'}}</p>
</ion-col>
</ion-row>
<ion-row *ngIf="offer.prices.employee">
<ion-col>Employees:</ion-col>
<ion-col width-20 text-right>
<p *ngIf="offer.prices.employee"> {{offer.prices.employee | currency:'EUR':'symbol':undefined:'de'}}
</p>
</ion-col>
</ion-row>
<ion-row *ngIf="offer.prices.guest">
<ion-col>Guests:</ion-col>
<ion-col width-20 text-right>
<p *ngIf="offer.prices.guest">
{{offer.prices.guest | currency:'EUR':'symbol':undefined:'de'}}</p>
</ion-col>
</ion-row>
</ion-grid>
</div>
</ion-card-content>
</ion-card>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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<SCThingThatCanBeOfferedOffer<SCAcademicPriceGroup>>;
}
@@ -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 <https://www.gnu.org/licenses/>.
*/
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;
}
@@ -0,0 +1,43 @@
<ion-card>
<ion-card-header>Address</ion-card-header>
<ion-card-content>
<ion-grid>
<ion-row>
<ion-col>Street:</ion-col>
<ion-col width-60 text-right>
{{address.streetAddress}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>Postal code:</ion-col>
<ion-col width-60 text-right>
{{address.postalCode}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>City:</ion-col>
<ion-col width-60 text-right>
{{address.addressLocality}}
</ion-col>
</ion-row>
<ion-row *ngIf="address.addressRegion">
<ion-col>Region:</ion-col>
<ion-col width-60 text-right>
{{address.addressRegion}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>Country:</ion-col>
<ion-col width-60 text-right>
{{address.addressCountry}}
</ion-col>
</ion-row>
<ion-row *ngIf="address.postOfficeBoxNumber">
<ion-col>Post office box:</ion-col>
<ion-col width-60 text-right>
{{address.postOfficeBoxNumber}}
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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;
}
@@ -0,0 +1,25 @@
<ion-card *ngIf="origin.type === 'user'">
<ion-card-header>Origin(user)</ion-card-header>
<ion-card-content>
<p>Created: {{origin.created | amDateFormat:'DD. MMM YYYY'}}</p>
<p *ngIf="origin.updated">Updated: {{origin.updated | amDateFormat:'DD. MMM YYYY'}}</p>
<p *ngIf="origin.modified">Modified: {{origin.modified | amDateFormat:'DD. MMM YYYY'}}</p>
<p *ngIf="origin.maintainer">
Maintainer: <a [routerLink]="['/data-detail', origin.maintainer.uid]">{{origin.maintainer.name}}</a>
</p>
</ion-card-content>
</ion-card>
<ion-card *ngIf="origin.type === 'remote'">
<ion-card-header>Origin(remote)</ion-card-header>
<ion-card-content>
<p>Indexed: {{origin.indexed | amDateFormat:'DD. MMM YYYY'}}</p>
<p *ngIf="origin.modified">Modified: {{origin.modified | amDateFormat:'DD. MMM YYYY'}}</p>
<p *ngIf="origin.maintainer">
Maintainer: <a [routerLink]="['/data-detail', origin.maintainer.uid]">{{origin.maintainer.name}}</a>
</p>
<p *ngIf="origin.responsibleEntity">
Responsible: <a [routerLink]="['/data-detail', origin.responsibleEntity.uid]">{{origin.responsibleEntity.name}}</a>
</p>
</ion-card-content>
</ion-card>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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;
}
@@ -0,0 +1,7 @@
<div *ngIf="origin.type === 'user'">
<p>{{origin.created | amDateFormat:'DD. MMM YY'}}</p>
</div>
<div *ngIf="origin.type === 'remote'">
<p>{{origin.indexed | amDateFormat:'DD. MMM YY'}}</p>
</div>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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);
}
}
@@ -0,0 +1,27 @@
<ion-card>
<ion-card-header>{{title}}</ion-card-header>
<ion-card-content>
<ng-container *ngIf="isString(content) then text; else list">
</ng-container>
<ng-template #text>
<ng-container *ngIf="isMarkdown; else plainText">
<markdown [data]="content"></markdown>
</ng-container>
<ng-template #plainText>
<p>{{content}}</p>
</ng-template>
</ng-template>
<ng-template #list>
<ng-container *ngIf="isThing(content[0]) then thingList; else textList">
</ng-container>
<ng-template #thingList>
<a [routerLink]="['/data-detail', thing.uid]" *ngFor="let thing of content">
<p>{{thing.name}}</p>
</a>
</ng-template>
<ng-template #textList>
<p *ngFor="let text of content">{{text}}</p>
</ng-template>
</ng-template>
</ion-card-content>
</ion-card>
@@ -16,6 +16,7 @@
<stapps-date-series-list-item [item]="item" *ngSwitchCase="item.type === 'date series'"></stapps-date-series-list-item> <stapps-date-series-list-item [item]="item" *ngSwitchCase="item.type === 'date series'"></stapps-date-series-list-item>
<stapps-article-list-item [item]="item" *ngSwitchCase="item.type === 'article'"></stapps-article-list-item> <stapps-article-list-item [item]="item" *ngSwitchCase="item.type === 'article'"></stapps-article-list-item>
<stapps-video-list-item [item]="item" *ngSwitchCase="item.type === 'video'"></stapps-video-list-item> <stapps-video-list-item [item]="item" *ngSwitchCase="item.type === 'video'"></stapps-video-list-item>
<stapps-semester-list-item [item]="item" *ngSwitchCase="item.type === 'semester'"></stapps-semester-list-item>
<ion-grid *ngSwitchDefault> <ion-grid *ngSwitchDefault>
<ion-row> <ion-row>
<ion-col> <ion-col>
@@ -1,5 +1,5 @@
::ng-deep { ::ng-deep {
h2.name { h2.name {
font-weight: bold !important; font-weight: bold;
} }
} }
@@ -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 <https://www.gnu.org/licenses/>.
*/
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<SCThing>;
objectKeys = Object.keys;
translator: SCThingTranslator;
constructor() {
this.translator = new SCThingTranslator(this.language, 'de');
}
}
@@ -0,0 +1,6 @@
<stapps-simple-card [title]="'Categories'" [content]="translator.translate(item).categories()">
</stapps-simple-card>
<stapps-simple-card *ngIf="item.datePublished" [title]="'Published'"
[content]="item.datePublished | amDateFormat:'DD. MMM YYYY'"></stapps-simple-card>
<stapps-simple-card [title]="'Content'" [content]="translator.translate(item).articleBody()" [isMarkdown]="true">
</stapps-simple-card>
@@ -6,7 +6,7 @@
<stapps-long-inline-text [text]="item.keywords.join(', ')" [size]="30"></stapps-long-inline-text> <stapps-long-inline-text [text]="item.keywords.join(', ')" [size]="30"></stapps-long-inline-text>
</p> </p>
<ion-note> <ion-note>
{{item.categories.join(', ')}} {{item.type}}
</ion-note> </ion-note>
</ion-col> </ion-col>
<ion-col width-20 text-right> <ion-col width-20 text-right>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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<SCThing>;
objectKeys = Object.keys;
translator: SCThingTranslator;
constructor() {
this.translator = new SCThingTranslator(this.language, 'de');
}
}
@@ -0,0 +1,2 @@
<stapps-simple-card [title]="'Categories'" [content]="translator.translate(item).categories()">
</stapps-simple-card>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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<SCThing>;
objectKeys = Object.keys;
translator: SCThingTranslator;
constructor() {
this.translator = new SCThingTranslator(this.language, 'de');
}
}
@@ -0,0 +1,13 @@
<ion-card *ngIf="item.inPlace">
<ion-card-header>
Place
</ion-card-header>
<ion-card-content>
<ion-icon name="pin"></ion-icon> <a [routerLink]="['/data-detail', item.inPlace.uid]">{{item.inPlace.name}}</a>
<stapps-address-detail *ngIf="item.inPlace.address" [address]="item.inPlace.address"></stapps-address-detail>
</ion-card-content>
</ion-card>
<stapps-simple-card [title]="'Duration'" [content]="[item.duration | amDuration:'minutes']"></stapps-simple-card>
<stapps-simple-card *ngIf="item.performers" [title]="'Performers'" [content]="item.performers"></stapps-simple-card>
<stapps-academic-offers-detail *ngIf="item.offers" [offers]="item.offers"></stapps-academic-offers-detail>
<stapps-origin-detail [origin]="item.origin"></stapps-origin-detail>
@@ -4,12 +4,15 @@
<h2 class="name">{{item.name}}</h2> <h2 class="name">{{item.name}}</h2>
<p> <p>
<ion-icon name="calendar"></ion-icon> <ion-icon name="calendar"></ion-icon>
<span>{{item.frequency}}, {{item.dates[0] | date: 'shortDate'}} - {{item.dates[item.dates.length-1] | date: 'shortDate'}}</span> <span>
{{item.frequency}}, {{item.dates[0] | amDateFormat:'dddd'}}
<span>({{item.dates[0] | amDateFormat:'DD. MMM YYYY'}} - {{item.dates[item.dates.length - 1] | amDateFormat:'DD. MMM YYYY'}})</span>
</span>
</p> </p>
<ion-note *ngIf="item.event.type === 'academic event'">{{item.event.categories.join(', ')}}</ion-note> <ion-note *ngIf="item.event.type === 'academic event'">{{item.event.categories.join(', ')}}</ion-note>
</ion-col> </ion-col>
<ion-col width-20 text-right> <ion-col width-20 text-right>
<stapps-offers-in-list *ngIf="item.offers" [offers]="item.offers"></stapps-offers-in-list> <stapps-academic-offers-in-list *ngIf="item.offers" [offers]="item.offers"></stapps-academic-offers-in-list>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
@@ -13,8 +13,8 @@
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {LangChangeEvent, TranslateService} from '@ngx-translate/core'; import {SCDish, SCThing, SCTranslations} from '@openstapps/core';
import {SCDish, SCLanguageName} from '@openstapps/core'; import {SCThingTranslator} from '@openstapps/core';
@Component({ @Component({
selector: 'stapps-dish-detail-content', selector: 'stapps-dish-detail-content',
@@ -22,14 +22,10 @@ import {SCDish, SCLanguageName} from '@openstapps/core';
}) })
export class DishDetailContentComponent { export class DishDetailContentComponent {
@Input() item: SCDish; @Input() item: SCDish;
language: SCLanguageName; @Input() language: keyof SCTranslations<SCThing>;
objectKeys = Object.keys; objectKeys = Object.keys;
translator: SCThingTranslator;
constructor(translateService: TranslateService) { constructor() {
this.language = translateService.currentLang as SCLanguageName; this.translator = new SCThingTranslator(this.language, 'de');
translateService.onLangChange.subscribe((event: LangChangeEvent) => {
this.language = event.lang as SCLanguageName;
});
} }
} }
@@ -1,49 +1,58 @@
<ion-card *ngIf="item.description"> <stapps-simple-card [title]="'Categories'" [content]="translator.translate(item).categories()">
<ion-card-header>{{meta.getFieldTranslation(language, 'description')}}</ion-card-header> </stapps-simple-card>
<ion-card-content>{{item.description}}</ion-card-content>
</ion-card>
<ion-card *ngIf="item.categories">
<ion-card-header>{{meta.getFieldTranslation(language, 'categories')}}</ion-card-header>
<ion-card-content>{{item.categories.join(', ')}}</ion-card-content>
</ion-card>
<ion-card *ngIf="item.characteristics"> <ion-card *ngIf="item.characteristics">
<ion-card-header>{{meta.getFieldTranslation(language, 'characteristics')}}</ion-card-header> <ion-card-header>Characteristics</ion-card-header>
<ion-card-content>{{item.characteristics.join(', ')}}</ion-card-content> <ion-card-content *ngFor="let characteristic of translator.translate(item).characteristics()">
<p>
<img *ngIf="characteristic.image"
[src]="characteristic.image" /><span>&nbsp;{{characteristic.name}}</span>&nbsp;&nbsp;
</p>
</ion-card-content>
</ion-card> </ion-card>
<stapps-academic-offers-detail *ngIf="item.offers" [offers]="item.offers"></stapps-academic-offers-detail>
<ion-card *ngIf="item.additives"> <stapps-simple-card *ngIf="item.additives" [title]="'Additives'" [content]="translator.translate(item).additives().join(', ')">
<ion-card-header>{{meta.getFieldTranslation(language, 'additives')}}</ion-card-header> </stapps-simple-card>
<ion-card-content>{{item.additives.join(', ')}}</ion-card-content> <ion-card *ngIf="item.nutrition">
</ion-card> <ion-card-header>Average Nutrition Information</ion-card-header>
<!-- <ion-card *ngIf="item.place">
<ion-card-header>{{meta.getFieldTranslation(language, 'place')}}</ion-card-header>
<ion-card-content><a>{{item.place.name}}</a></ion-card-content>
</ion-card>
<ion-card>
<ion-card-header>{{meta.getFieldTranslation(language, 'price')}}</ion-card-header>
<ion-card-content> <ion-card-content>
<ion-grid *ngFor="let offer of item.offers"> <ion-grid>
<ion-row> <ion-row *ngIf="item.nutrition.calories">
<ion-col>Student</ion-col> <ion-col>Calories:</ion-col>
<ion-col>{{offer.prices.student | currency:'EUR':'symbol':undefined:'de'}}</ion-col> <ion-col width-20 text-right>
{{item.nutrition.calories}} kcal
</ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row *ngIf="item.nutrition.fatContent">
<ion-col>Mitarbeiter</ion-col> <ion-col>Fat content:</ion-col>
<ion-col>{{offer.prices.employee | currency:'EUR':'symbol':undefined:'de'}}</ion-col> <ion-col width-20 text-right>
{{item.nutrition.fatContent}} g <span *ngIf="item.nutrition.saturatedFatContent">(saturated:
{{item.nutrition.saturatedFatContent}} g)</span>
</ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row *ngIf="item.nutrition.carbohydrateContent">
<ion-col>Standard / Gäste</ion-col> <ion-col>Carbohydrate content:</ion-col>
<ion-col>{{offer.prices.guest | currency:'EUR':'symbol':undefined:'de'}}</ion-col> <ion-col width-20 text-right>
{{item.nutrition.carbohydrateContent}} g
</ion-col>
</ion-row>
<ion-row *ngIf="item.nutrition.saltContent">
<ion-col>Salt content:</ion-col>
<ion-col width-20 text-right>
{{item.nutrition.saltContent}} g
</ion-col>
</ion-row>
<ion-row *ngIf="item.nutrition.sugarContent">
<ion-col>Sugar content:</ion-col>
<ion-col width-20 text-right>
{{item.nutrition.sugarContent}} g
</ion-col>
</ion-row>
<ion-row *ngIf="item.nutrition.proteinContent">
<ion-col>Protein content:</ion-col>
<ion-col width-20 text-right>
{{item.nutrition.proteinContent}} g
</ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
</ion-card-content> </ion-card-content>
</ion-card> --> </ion-card>
<!--
<ion-card *ngIf="item.availabilityStarts">
<ion-card-header>Verfügbarkeit</ion-card-header>
<ion-card-content>{{item.availabilityStarts | date}}</ion-card-content>
</ion-card> -->
@@ -6,7 +6,7 @@
<p>{{item.categories.join(',')}}</p> <p>{{item.categories.join(',')}}</p>
</ion-col> </ion-col>
<ion-col width-20 text-right> <ion-col width-20 text-right>
<stapps-offers-in-list ng-if="item.offers" [offers]="item.offers"></stapps-offers-in-list> <stapps-academic-offers-in-list *ngIf="item.offers" [offers]="item.offers"></stapps-academic-offers-in-list>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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<SCThing>;
objectKeys = Object.keys;
translator: SCThingTranslator;
constructor() {
this.translator = new SCThingTranslator(this.language, 'de');
}
}
@@ -0,0 +1,6 @@
<stapps-simple-card *ngIf="item.type === 'academic event' && item.categories" [title]="'Categories'" [content]="translator.translate(item).categories()">
</stapps-simple-card>
<stapps-simple-card *ngIf="item.catalogs" [title]="'Catalogs'" [content]="item.catalogs"></stapps-simple-card>
<stapps-simple-card *ngIf="item.performers" [title]="'Performers'" [content]="item.performers"></stapps-simple-card>
<stapps-simple-card *ngIf="item.organizers" [title]="'Organizers'" [content]="item.organizers"></stapps-simple-card>
<stapps-simple-card *ngIf="item.type === 'academic event' && item.majors" [title]="'Majors'" [content]="item.majors"></stapps-simple-card>
@@ -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 * 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 * under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3. * Software Foundation, version 3.
@@ -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 <https://www.gnu.org/licenses/>.
*/
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<SCThing>;
objectKeys = Object.keys;
translator: SCThingTranslator;
constructor() {
this.translator = new SCThingTranslator(this.language, 'de');
}
}
@@ -0,0 +1 @@
<stapps-data-detail-content [item]="item.data"></stapps-data-detail-content>
@@ -5,9 +5,10 @@
<p *ngIf="item.data.description"> <p *ngIf="item.data.description">
<stapps-long-inline-text [text]="item.data.description" [size]="50"></stapps-long-inline-text> <stapps-long-inline-text [text]="item.data.description" [size]="50"></stapps-long-inline-text>
</p> </p>
<ion-note>{{item.data.type}}</ion-note> <ion-note>{{item.type}} ({{item.data.type}})</ion-note>
</ion-col> </ion-col>
<ion-col width-20 text-right> <ion-col width-20 text-right>
<stapps-origin-in-list [origin]="item.origin"></stapps-origin-in-list>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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<SCThing>;
objectKeys = Object.keys;
translator: SCThingTranslator;
constructor() {
this.translator = new SCThingTranslator(this.language, 'de');
}
}
@@ -0,0 +1,5 @@
<stapps-simple-card [title]="'Content'" [content]="item.message"></stapps-simple-card>
<stapps-simple-card [title]="'Audiences'" [content]="item.audiences"></stapps-simple-card>
<stapps-simple-card *ngIf="item.datePublished" [title]="'Published'" [content]="item.datePublished | amDateFormat:'DD. MMM YYYY'"></stapps-simple-card>
<stapps-simple-card *ngIf="item.authors" [title]="'Author(s)'" [content]="item.authors"></stapps-simple-card>
<stapps-simple-card *ngIf="item.publishers" [title]="'Publisher(s)'" [content]="item.publishers"></stapps-simple-card>
@@ -5,6 +5,7 @@
<p *ngIf="item.message"> <p *ngIf="item.message">
<stapps-long-inline-text [text]="item.message" [size]="80"></stapps-long-inline-text> <stapps-long-inline-text [text]="item.message" [size]="80"></stapps-long-inline-text>
</p> </p>
<ion-note>{{item.type}}</ion-note>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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<SCThing>;
objectKeys = Object.keys;
translator: SCThingTranslator;
constructor() {
this.translator = new SCThingTranslator(this.language, 'de');
}
}
@@ -0,0 +1,9 @@
<ion-card *ngIf="item.inPlace">
<ion-card-header>
Place
</ion-card-header>
<ion-card-content>
<ion-icon name="pin"></ion-icon> <a [routerLink]="['/data-detail', item.inPlace.uid]">{{item.inPlace.name}}</a>
<stapps-address-detail *ngIf="item.inPlace.address" [address]="item.inPlace.address"></stapps-address-detail>
</ion-card-content>
</ion-card>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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<SCThing>;
objectKeys = Object.keys;
translator: SCThingTranslator;
constructor() {
this.translator = new SCThingTranslator(this.language, 'de');
}
}
@@ -0,0 +1,38 @@
<ion-card *ngIf="item.workLocations">
<ion-card-header>
Contact information
</ion-card-header>
<ion-card-content>
<ng-container *ngIf="item.workLocations.length === 1">
<p *ngIf="item.workLocations[0].telephone">Tel: <a
[href]="'tel:' + item.workLocations[0].telephone">{{item.workLocations[0].telephone}}</a>
</p>
<p *ngIf="item.workLocations[0].email">Email: <a
[href]="'mailto:' + item.workLocations[0].email">{{item.workLocations[0].email}}</a></p>
<p *ngIf="item.workLocations[0].faxNumber">Fax: {{item.workLocations[0].faxNumber}}</p>
<p *ngIf="item.workLocations[0].url">URL: <a
[href]="item.workLocations[0].url">{{item.workLocations[0].url}}</a>
</p>
<p *ngIf="item.workLocations[0].areaServed">Office: <a
[routerLink]="[ '/data-detail', item.workLocations[0].areaServed.uid]">{{item.workLocations[0].areaServed.name}}</a>
</p>
</ng-container>
<ion-slides *ngIf="item.workLocations.length > 1" pager="true" class="work-locations">
<ion-slide *ngFor="let workLocation of item.workLocations">
<p *ngIf="workLocation.telephone">Tel: <a
[href]="'tel:' + workLocation.telephone">{{workLocation.telephone}}</a>
</p>
<p style="display:block !important" *ngIf="workLocation.email">Email: <a [href]="'mailto:' + workLocation.email">{{workLocation.email}}</a>
</p>
<p *ngIf="workLocation.faxNumber">Fax: {{workLocation.faxNumber}}</p>
<p *ngIf="workLocation.url">URL: <a [href]="workLocation.url">{{workLocation.url}}</a></p>
<p *ngIf="workLocation.areaServed">Office: <a
[routerLink]="[ '/data-detail', workLocation.areaServed.uid]">{{workLocation.areaServed.name}}</a>
</p>
<!-- Used for making the additional space, so that slide pager doesn't show over the text but under it -->
<!-- <div class="stapps-slide-bottom"></div> -->
</ion-slide>
</ion-slides>
</ion-card-content>
</ion-card>
<stapps-simple-card *ngIf="item.jobTitles" [title]="'Positions'" [content]="item.jobTitles"></stapps-simple-card>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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<SCThing>;
objectKeys = Object.keys;
translator: SCThingTranslator;
constructor() {
this.translator = new SCThingTranslator(this.language, 'de');
}
}
@@ -0,0 +1,15 @@
<ng-container *ngIf="item.type !== 'floor'">
<stapps-simple-card *ngIf="item.type !== 'floor' && item.categories" [title]="'Categories'" [content]="translator.translate(item).categories()"></stapps-simple-card>
<stapps-address-detail *ngIf="item.type !== 'floor' && item.address" [address]="item.address"></stapps-address-detail>
</ng-container>
<ng-container *ngIf="item.type !== 'building'">
<ion-card *ngIf="item.inPlace">
<ion-card-header>
Building:
</ion-card-header>
<ion-card-content>
<ion-icon name="pin"></ion-icon> <a [routerLink]="['/data-detail', item.inPlace.uid]">{{item.inPlace.name}}</a>
<stapps-address-detail *ngIf="item.inPlace.address" [address]="item.inPlace.address"></stapps-address-detail>
</ion-card-content>
</ion-card>
</ng-container>
@@ -13,7 +13,7 @@
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import {Component, Input} from '@angular/core'; 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'; import {DataListItem} from '../../list/data-list-item.component';
@Component({ @Component({
@@ -22,7 +22,7 @@ import {DataListItem} from '../../list/data-list-item.component';
}) })
export class PlaceListItem extends DataListItem { export class PlaceListItem extends DataListItem {
@Input() item: SCBuilding | SCRoom | SCPointOfInterest; @Input() item: SCBuilding | SCRoom | SCPointOfInterest | SCFloor;
ngOnInit() { ngOnInit() {
// TODO: translation // TODO: translation
@@ -6,7 +6,9 @@
<ion-note>{{item.type}}</ion-note> <ion-note>{{item.type}}</ion-note>
</ion-col> </ion-col>
<ion-col width-20 text-right *ngIf="item.type !== 'building'"> <ion-col width-20 text-right *ngIf="item.type !== 'building'">
<span *ngIf="item.inPlace"><ion-icon name="pin"></ion-icon> {{item.inPlace.name}}</span> <span *ngIf="item.inPlace">
<ion-icon name="pin"></ion-icon> {{item.inPlace.name}}
</span>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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<SCThing>;
objectKeys = Object.keys;
translator: SCThingTranslator;
constructor() {
this.translator = new SCThingTranslator(this.language, 'de');
}
}
@@ -0,0 +1,2 @@
<ion-card *ngIf="item.eventsStartDate && item.eventsEndDate">
<stapps-simple-card [title]="'Events'" [content]="(item.eventsStartDate | amDateFormat: 'DD. MMM YYYY') + ' - ' + (item.eventsEndDate | amDateFormat: 'DD. MMM YYYY')"></stapps-simple-card>
@@ -0,0 +1,12 @@
<ion-grid>
<ion-row>
<ion-col>
<h2 class="name">{{item.name}}</h2>
<p>
<ion-icon name="calendar"></ion-icon>
<span>{{item.startDate | amDateFormat: 'DD. MMM YYYY'}} - {{item.endDate | amDateFormat:'DD. MMM YYYY'}}</span>
</p>
<ion-note>{{item.type}}</ion-note>
</ion-col>
</ion-row>
</ion-grid>
@@ -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 <https://www.gnu.org/licenses/>.
*/
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<SCThing>;
objectKeys = Object.keys;
translator: SCThingTranslator;
constructor() {
this.translator = new SCThingTranslator(this.language, 'de');
}
}
@@ -0,0 +1,6 @@
<stapps-simple-card *ngIf="item.actors" [title]="'Actors'" [content]="item.actors"></stapps-simple-card>
<stapps-simple-card *ngIf="item.authors" [title]="'Authors'" [content]="item.authors"></stapps-simple-card>
<stapps-simple-card *ngIf="item.datePublished" [title]="'Authors'" [content]="item.authors"></stapps-simple-card>
<stapps-simple-card *ngIf="item.datePublished" [title]="'Published'"
[content]="item.datePublished | amDateFormat:'DD. MMM YYYY'"></stapps-simple-card>
<stapps-academic-offers-detail *ngIf="item.offers" [offers]="item.offers"></stapps-academic-offers-detail>
@@ -3,6 +3,7 @@
<ion-col> <ion-col>
<h2 class="name">{{item.name}}</h2> <h2 class="name">{{item.name}}</h2>
<p *ngIf="item.description"><stapps-long-inline-text [text]="item.description" [size]="30"></stapps-long-inline-text></p> <p *ngIf="item.description"><stapps-long-inline-text [text]="item.description" [size]="30"></stapps-long-inline-text></p>
<p *ngIf="item.duration">Duration: {{item.duration | amDuration:'seconds'}}</p>
<ion-note>{{item.type}}</ion-note> <ion-note>{{item.type}}</ion-note>
</ion-col> </ion-col>
</ion-row> </ion-row>
@@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License along with * You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import {Component, OnInit} from '@angular/core'; import {Component} from '@angular/core';
import {LangChangeEvent, TranslateService} from '@ngx-translate/core'; import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
import {SCSettingMeta, SCTranslations} from '@openstapps/core'; import {SCSettingMeta, SCTranslations} from '@openstapps/core';
import {SettingsCache, SettingsProvider} from '../settings.provider'; import {SettingsCache, SettingsProvider} from '../settings.provider';
@@ -21,7 +21,7 @@ import {SettingsCache, SettingsProvider} from '../settings.provider';
selector: 'stapps-settings-page', selector: 'stapps-settings-page',
templateUrl: 'settings-page.html', templateUrl: 'settings-page.html',
}) })
export class SettingsPageComponent implements OnInit { export class SettingsPageComponent {
categoriesOrder: string[]; categoriesOrder: string[];
// limit to languages that are available in StApps Core // limit to languages that are available in StApps Core
language: keyof SCTranslations<any>; language: keyof SCTranslations<any>;