feat(data): add data detail templates

Additionally clean up the code
This commit is contained in:
Jovan Krunić
2019-04-10 15:01:00 +02:00
parent 75ca8c8a73
commit 5855accc16
58 changed files with 1015 additions and 91 deletions

View File

@@ -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',

View File

@@ -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(),
],

View File

@@ -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;
}

View File

@@ -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>

View File

@@ -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

View File

@@ -14,12 +14,5 @@
</ion-refresher-content>
</ion-refresher>
<stapps-data-list-item [item]="item"></stapps-data-list-item>
<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>
<stapps-data-detail-content [item]="item"></stapps-data-detail-content>
</ion-content>

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;
}
}
}

View File

@@ -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<SCThingThatCanBeOfferedOffer<SCAcademicPriceGroup>>;
}

View File

@@ -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>

View File

@@ -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>>;
}

View File

@@ -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;
}

View File

@@ -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>

View File

@@ -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;
}

View File

@@ -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>

View File

@@ -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;
}

View File

@@ -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>

View File

@@ -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);
}
}

View File

@@ -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>

View File

@@ -16,6 +16,7 @@
<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-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-row>
<ion-col>

View File

@@ -1,5 +1,5 @@
::ng-deep {
h2.name {
font-weight: bold !important;
font-weight: bold;
}
}

View File

@@ -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');
}
}

View File

@@ -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>

View File

@@ -6,7 +6,7 @@
<stapps-long-inline-text [text]="item.keywords.join(', ')" [size]="30"></stapps-long-inline-text>
</p>
<ion-note>
{{item.categories.join(', ')}}
{{item.type}}
</ion-note>
</ion-col>
<ion-col width-20 text-right>

View File

@@ -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');
}
}

View File

@@ -0,0 +1,2 @@
<stapps-simple-card [title]="'Categories'" [content]="translator.translate(item).categories()">
</stapps-simple-card>

View File

@@ -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');
}
}

View File

@@ -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>

View File

@@ -4,12 +4,15 @@
<h2 class="name">{{item.name}}</h2>
<p>
<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>
<ion-note *ngIf="item.event.type === 'academic event'">{{item.event.categories.join(', ')}}</ion-note>
</ion-col>
<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-row>
</ion-grid>

View File

@@ -13,8 +13,8 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
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<SCThing>;
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');
}
}

View File

@@ -1,49 +1,58 @@
<ion-card *ngIf="item.description">
<ion-card-header>{{meta.getFieldTranslation(language, 'description')}}</ion-card-header>
<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>
<stapps-simple-card [title]="'Categories'" [content]="translator.translate(item).categories()">
</stapps-simple-card>
<ion-card *ngIf="item.characteristics">
<ion-card-header>{{meta.getFieldTranslation(language, 'characteristics')}}</ion-card-header>
<ion-card-content>{{item.characteristics.join(', ')}}</ion-card-content>
<ion-card-header>Characteristics</ion-card-header>
<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 *ngIf="item.additives">
<ion-card-header>{{meta.getFieldTranslation(language, 'additives')}}</ion-card-header>
<ion-card-content>{{item.additives.join(', ')}}</ion-card-content>
</ion-card>
<!-- <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>
<stapps-academic-offers-detail *ngIf="item.offers" [offers]="item.offers"></stapps-academic-offers-detail>
<stapps-simple-card *ngIf="item.additives" [title]="'Additives'" [content]="translator.translate(item).additives().join(', ')">
</stapps-simple-card>
<ion-card *ngIf="item.nutrition">
<ion-card-header>Average Nutrition Information</ion-card-header>
<ion-card-content>
<ion-grid *ngFor="let offer of item.offers">
<ion-row>
<ion-col>Student</ion-col>
<ion-col>{{offer.prices.student | currency:'EUR':'symbol':undefined:'de'}}</ion-col>
<ion-grid>
<ion-row *ngIf="item.nutrition.calories">
<ion-col>Calories:</ion-col>
<ion-col width-20 text-right>
{{item.nutrition.calories}} kcal
</ion-col>
</ion-row>
<ion-row>
<ion-col>Mitarbeiter</ion-col>
<ion-col>{{offer.prices.employee | currency:'EUR':'symbol':undefined:'de'}}</ion-col>
<ion-row *ngIf="item.nutrition.fatContent">
<ion-col>Fat content:</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-col>Standard / Gäste</ion-col>
<ion-col>{{offer.prices.guest | currency:'EUR':'symbol':undefined:'de'}}</ion-col>
<ion-row *ngIf="item.nutrition.carbohydrateContent">
<ion-col>Carbohydrate content:</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-grid>
</ion-card-content>
</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> -->
</ion-card>

View File

@@ -6,7 +6,7 @@
<p>{{item.categories.join(',')}}</p>
</ion-col>
<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-row>
</ion-grid>

View File

@@ -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');
}
}

View File

@@ -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>

View File

@@ -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.

View File

@@ -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');
}
}

View File

@@ -0,0 +1 @@
<stapps-data-detail-content [item]="item.data"></stapps-data-detail-content>

View File

@@ -5,9 +5,10 @@
<p *ngIf="item.data.description">
<stapps-long-inline-text [text]="item.data.description" [size]="50"></stapps-long-inline-text>
</p>
<ion-note>{{item.data.type}}</ion-note>
<ion-note>{{item.type}} ({{item.data.type}})</ion-note>
</ion-col>
<ion-col width-20 text-right>
<stapps-origin-in-list [origin]="item.origin"></stapps-origin-in-list>
</ion-col>
</ion-row>
</ion-grid>

View File

@@ -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');
}
}

View File

@@ -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>

View File

@@ -5,6 +5,7 @@
<p *ngIf="item.message">
<stapps-long-inline-text [text]="item.message" [size]="80"></stapps-long-inline-text>
</p>
<ion-note>{{item.type}}</ion-note>
</ion-col>
</ion-row>
</ion-grid>

View File

@@ -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');
}
}

View File

@@ -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>

View File

@@ -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');
}
}

View File

@@ -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>

View File

@@ -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');
}
}

View File

@@ -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>

View File

@@ -13,7 +13,7 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
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

View File

@@ -6,7 +6,9 @@
<ion-note>{{item.type}}</ion-note>
</ion-col>
<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-row>
</ion-grid>

View File

@@ -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');
}
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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');
}
}

View File

@@ -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>

View File

@@ -3,6 +3,7 @@
<ion-col>
<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.duration">Duration: {{item.duration | amDuration:'seconds'}}</p>
<ion-note>{{item.type}}</ion-note>
</ion-col>
</ion-row>

View File

@@ -12,7 +12,7 @@
* 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, 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<any>;