/
resource-grid.component.html
36 lines (34 loc) · 2.19 KB
/
resource-grid.component.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!-- When withMultipleSelection is false and user can select only one resource at a time to view -->
<div class="resource-grid">
<div class="grid-card link"
*ngFor="let resource of resources.resources; let i = index;">
<mat-card [class.selected-resource]="selectedResourceIdx.indexOf(i) > -1">
<!-- TODO: add the representation preview here, mat-card-image can be used for images -->
<mat-card-header class="grid-card-header">
<mat-card-title-group class="res-class-header-text" (click)="selectResource({ checked: true, resIndex: i, resId: resource.id, resLabel: resource.label, isCheckbox: false})">
<mat-card-subtitle class="res-class-label">{{ resource.entityInfo.classes[resource.type].label }}</mat-card-subtitle>
<mat-card-title class="res-class-value">{{ resource.label }}</mat-card-title>
</mat-card-title-group>
<div fxFlex></div>
<!-- if withMultipleSelection is true, we display checkbox -->
<mat-card-title-group *ngIf="withMultipleSelection" class="res-class-header-actions">
<mat-checkbox #gridCkbox
id="{{ i }}"
(change)="selectResource({ checked: $event.checked, resIndex: i, resId: resource.id, resLabel: resource.label, isCheckbox: true})"
class="res-checkbox">
</mat-checkbox>
</mat-card-title-group>
</mat-card-header>
<div (click)="selectResource({ checked: true, resIndex: i, resId: resource.id, resLabel: resource.label, isCheckbox: false})">
<mat-card-content class="grid-card-content" *ngFor="let prop of resource.properties | keyvalue">
<div *ngFor="let val of prop.value">
<span class="res-prop-label">
{{ resource.entityInfo.properties[val.property].label }}
</span>
<div class="res-prop-value shorten-long-text" [innerHtml]="val.strval"></div>
</div>
</mat-card-content>
</div>
</mat-card>
</div>
</div>