mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
feat: add basic templates for data list items
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 StApps
|
||||
* 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.
|
||||
@@ -17,7 +17,8 @@ import {SCThings} from '@openstapps/core';
|
||||
|
||||
@Component({
|
||||
selector: 'stapps-data-list-item',
|
||||
templateUrl: 'data-list-item.html'
|
||||
styleUrls: ['data-list-item.scss'],
|
||||
templateUrl: 'data-list-item.html',
|
||||
})
|
||||
export class DataListItem implements OnInit {
|
||||
@Input() item: SCThings;
|
||||
|
||||
@@ -1,17 +1,32 @@
|
||||
<ion-item text-wrap button="true" lines="inset" [routerLink]="['/data-detail', item.uid]">
|
||||
<ion-thumbnail slot="start">
|
||||
<img src="../../../assets/imgs/logo.png">
|
||||
<img class="stapps-{{item.type}}-thumbnail" src="{{item.image}}" onError="this.src='../../assets/imgs/logo.png';" alt="{{item.name}}" />
|
||||
</ion-thumbnail>
|
||||
<ion-label [ngSwitch]="item.type" lines="full">
|
||||
<div>
|
||||
<stapps-dish-list-item [item]="item" *ngSwitchCase="'Dish'"></stapps-dish-list-item>
|
||||
|
||||
<stapps-event-list-item [item]="item" *ngSwitchCase="'Event'"></stapps-event-list-item>
|
||||
|
||||
<span *ngSwitchDefault>
|
||||
{{item.name}}<br/>
|
||||
<ion-note>{{item.type}}</ion-note>
|
||||
</span>
|
||||
</div>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-label [ngSwitch]="true" lines="full">
|
||||
<div>
|
||||
<stapps-dish-list-item [item]="item" *ngSwitchCase="item.type === 'dish'"></stapps-dish-list-item>
|
||||
<stapps-place-list-item [item]="item"
|
||||
*ngSwitchCase="item.type === 'building' || item.type === 'point of interest' || item.type === 'room' || item.type === 'floor'">
|
||||
</stapps-place-list-item>
|
||||
<stapps-event-list-item [item]="item" *ngSwitchCase="item.type === 'academic event' || item.type === 'sport course'"></stapps-event-list-item>
|
||||
<stapps-person-list-item [item]="item" *ngSwitchCase="item.type === 'person'"></stapps-person-list-item>
|
||||
<stapps-favorite-list-item [item]="item" *ngSwitchCase="item.type === 'favorite'"></stapps-favorite-list-item>
|
||||
<stapps-catalog-list-item [item]="item" *ngSwitchCase="item.type === 'catalog'"></stapps-catalog-list-item>
|
||||
<stapps-message-list-item [item]="item" *ngSwitchCase="item.type === 'message'"></stapps-message-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-video-list-item [item]="item" *ngSwitchCase="item.type === 'video'"></stapps-video-list-item>
|
||||
<ion-grid *ngSwitchDefault>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<h2 class="name">{{item.name}}</h2>
|
||||
<p *ngIf="item.description">
|
||||
<stapps-long-inline-text [text]="item.description" [size]="50"></stapps-long-inline-text>
|
||||
</p>
|
||||
<ion-note>{{item.type}}</ion-note>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</div>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
|
||||
5
src/app/modules/data/list/data-list-item.scss
Normal file
5
src/app/modules/data/list/data-list-item.scss
Normal file
@@ -0,0 +1,5 @@
|
||||
::ng-deep {
|
||||
h2.name {
|
||||
font-weight: bold !important;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user