Newer
Older
<accordion-group (isOpenChange)="initDatatable()" #ag [panelClass]="'custom-accordion'" class="my-2">
<button class="btn btn-link btn-block clearfix" accordion-heading>
<div class="pull-left float-left">
Datatable
<span *ngIf="ag.isOpen"><i class="fas fa-chevron-up"></i></span>
<span *ngIf="!ag.isOpen"><i class="fas fa-chevron-down"></i></span>
</div>
</button>
<div *ngIf="!searchMeta" class="text-center">
<i class="fas fa-circle-notch fa-spin fa-3x"></i>
<span class="sr-only">Loading...</span>
</div>
<table class="table table-striped table-bordered">
<th *ngFor="let attribute of searchMeta.attributes_selected" scope="col">
{{ attribute.label }}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let datum of searchData">
<td *ngFor="let attribute of searchMeta.attributes_selected">
<div *ngIf="datum[attribute.label]" [ngSwitch]="getAttributeRenderer(attribute.name)">
<img [src]="getAttributeUriAction(attribute.name, datum[attribute.label])">
<div *ngSwitchCase="'thumbnail'">
<button class="btn btn-link"
(click)="openModal('thumbnail', attribute.name, datum[attribute.label])">
<img [src]="getAttributeUriAction(attribute.name, datum[attribute.label])"
<div *ngSwitchCase="'ext-link'">
<a [href]="getAttributeUriAction(attribute.name, datum[attribute.label])"
target="_blank">
{{ datum[attribute.name] }}</a>
</div>
<div *ngSwitchCase="'int-link'">
<a routerLink="/detail/{{ datasetName }}/{{ datum[attribute.label] }}">
<div *ngSwitchCase="'ext-btn'">
<a [href]="getAttributeUriAction(attribute.name, datum[attribute.label])"
target="_blank" class="btn btn-outline-primary btn-sm">
{{ datum[attribute.label] }}</a>
</div>
<div *ngSwitchCase="'int-btn'">
<a routerLink="/detail/{{ datasetName }}/{{ datum[attribute.label] }}"
class="btn btn-outline-primary btn-sm">
<div *ngSwitchCase="'fancybox'">
<button class="btn btn-outline-primary btn-sm"
(click)="openModal('fancybox', attribute.name, datum[attribute.label])">
{{ datum[attribute.label] }}
<a [href]="getAttributeUriAction(attribute.name, datum[attribute.label])"
target="_blank" class="btn btn-outline-primary btn-sm">
<i class="fa fa-download" aria-hidden="true"></i>
</a>
</div>
<div *ngSwitchCase="'json'" class="text-center">
<button class="btn btn-outline-primary btn-sm"
(click)="openModal('json', attribute.name, datum[attribute.label])">
<pagination [totalItems]="searchMeta.total_items" [boundaryLinks]="true" [rotate]="true" [maxSize]="5"
(pageChanged)="getSearchData.emit($event.page)"></pagination>
<app-modal *ngIf="modalData.isOpen" [bsModalRef]="bsModalRef" [type]="modalData.type" [data]="modalData.data"