refactor: clean up data-detail-content template

This commit is contained in:
Rainer Killinger
2021-06-18 13:13:40 +02:00
parent 95b183b1bb
commit 4cf27b2c32

View File

@@ -1,83 +1,19 @@
<ion-item class="ion-text-wrap" lines="inset">
<ion-thumbnail slot="start" class="ion-margin-end">
<ion-icon color="medium" [attr.name]="item.type | dataIcon"></ion-icon>
</ion-thumbnail>
<ion-grid>
<ion-row>
<ion-col>
<div class="ion-text-wrap">
<h2 class="name">{{ 'name' | thingTranslate: item }}</h2>
<ion-note>{{ 'type' | thingTranslate: item }}</ion-note>
</div>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
<stapps-simple-card
*ngIf="item.description"
[title]="'Description'"
[content]="item.description"
></stapps-simple-card>
<stapps-simple-card *ngIf="item.description" [title]="'description' | propertyNameTranslate: item | titlecase" [content]="'description' | thingTranslate: item"></stapps-simple-card>
<div [ngSwitch]="true">
<stapps-article-detail-content
[item]="item"
*ngSwitchCase="item.type === 'article'"
></stapps-article-detail-content>
<stapps-catalog-detail-content
[item]="item"
*ngSwitchCase="item.type === 'catalog'"
></stapps-catalog-detail-content>
<stapps-date-series-detail-content
[item]="item"
*ngSwitchCase="item.type === 'date series'"
></stapps-date-series-detail-content>
<stapps-dish-detail-content
[item]="item"
*ngSwitchCase="item.type === 'dish'"
></stapps-dish-detail-content>
<stapps-event-detail-content
[item]="item"
*ngSwitchCase="item.type === 'academic event'"
></stapps-event-detail-content>
<stapps-event-detail-content
[item]="item"
*ngSwitchCase="item.type === 'sport course'"
></stapps-event-detail-content>
<stapps-favorite-detail-content
[item]="item"
*ngSwitchCase="item.type === 'favorite'"
></stapps-favorite-detail-content>
<stapps-message-detail-content
[item]="item"
*ngSwitchCase="item.type === 'message'"
></stapps-message-detail-content>
<stapps-person-detail-content
[item]="item"
*ngSwitchCase="item.type === 'person'"
></stapps-person-detail-content>
<stapps-place-detail-content
[item]="item"
*ngSwitchCase="item.type === 'building'"
></stapps-place-detail-content>
<stapps-place-detail-content
[item]="item"
*ngSwitchCase="item.type === 'floor'"
></stapps-place-detail-content>
<stapps-place-detail-content
[item]="item"
*ngSwitchCase="item.type === 'point of interest'"
></stapps-place-detail-content>
<stapps-place-detail-content
[item]="item"
*ngSwitchCase="item.type === 'room'"
></stapps-place-detail-content>
<stapps-semester-detail-content
[item]="item"
*ngSwitchCase="item.type === 'semester'"
></stapps-semester-detail-content>
<stapps-video-detail-content
[item]="item"
*ngSwitchCase="item.type === 'video'"
></stapps-video-detail-content>
<stapps-origin-detail [origin]="item.origin"></stapps-origin-detail>
<stapps-article-detail-content [item]="item" *ngSwitchCase="item.type === 'article'"></stapps-article-detail-content>
<stapps-catalog-detail-content [item]="item" *ngSwitchCase="item.type === 'catalog'"></stapps-catalog-detail-content>
<stapps-date-series-detail-content [item]="item" *ngSwitchCase="item.type === 'date series'"></stapps-date-series-detail-content>
<stapps-dish-detail-content [item]="item" *ngSwitchCase="item.type === 'dish'"></stapps-dish-detail-content>
<stapps-event-detail-content [item]="item" *ngSwitchCase="item.type === 'academic event'"></stapps-event-detail-content>
<stapps-event-detail-content [item]="item" *ngSwitchCase="item.type === 'sport course'"></stapps-event-detail-content>
<stapps-favorite-detail-content [item]="item" *ngSwitchCase="item.type === 'favorite'"></stapps-favorite-detail-content>
<stapps-message-detail-content [item]="item" *ngSwitchCase="item.type === 'message'"></stapps-message-detail-content>
<stapps-person-detail-content [item]="item" *ngSwitchCase="item.type === 'person'"></stapps-person-detail-content>
<stapps-place-detail-content [item]="item" *ngSwitchCase="item.type === 'building'"></stapps-place-detail-content>
<stapps-place-detail-content [item]="item" *ngSwitchCase="item.type === 'floor'"></stapps-place-detail-content>
<stapps-place-detail-content [item]="item" *ngSwitchCase="item.type === 'point of interest'"></stapps-place-detail-content>
<stapps-place-detail-content [item]="item" *ngSwitchCase="item.type === 'room'"></stapps-place-detail-content>
<stapps-semester-detail-content [item]="item" *ngSwitchCase="item.type === 'semester'"></stapps-semester-detail-content>
<stapps-video-detail-content [item]="item" *ngSwitchCase="item.type === 'video'"></stapps-video-detail-content>
<stapps-origin-detail [origin]="item.origin" ></stapps-origin-detail>
</div>