connect/src/app/searchPages/searchUtils/searchPageTableView.compone...

187 lines
13 KiB
HTML

<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
<div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div [class]="'uk-background-norepeat uk-background-cover uk-section uk-flex uk-flex-middle '+searchFormClass" >
<div class="uk-width-1-1">
<div class="uk-width-1-1">
<search-form [isDisabled]="disableForms" [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)" [placeholderText]="formPlaceholderText"></search-form>
</div>
<div class="uk-width-1-1 uk-light">
<div *ngIf="isFiltered()" class = "uk-container uk-text-center ">
<span *ngIf = "searchUtils.keyword.length > 0">Keywords: <span>{{searchUtils.keyword}}<a (click) = "clearKeywords() " [class]="(disableForms)?'uk-icon-button uk-disabled':'uk-icon-button'"><span class=" clickable " aria-hidden="true"><span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="1"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg>
</span></span></a></span>
</span>
<span *ngFor="let filter of filters " >
<span *ngIf = "filter.countSelectedValues > 0"> {{filter.title}}:
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; " >{{value.name}}<a (click) = "removeFilter(value, filter) " [class]="(disableForms)?'uk-icon-button uk-disabled':'uk-icon-button'"><span class=" clickable" aria-hidden="true"><span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="1"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg>
</span></span></a>
<span *ngIf="!end">, </span>
</span>
</span>
</span>
<a (click)="clearFilters()" [class]="(disableForms)?'uk-disabled uk-link-muted':''">
Clear All
</a>
</div>
</div>
</div>
</div>
<div class="uk-container">
<helper position="top"></helper>
<div class="uk-width-2-3@m uk-width-2-3@l uk-width-1-1@s">
<div class="uk-offcanvas-content uk-hidden@m">
<a href="#offcanvas-usage" uk-toggle><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="6" y="4" width="12" height="1"></rect><rect x="6" y="9" width="12" height="1"></rect><rect x="6" y="14" width="12" height="1"></rect><rect x="2" y="4" width="2" height="1"></rect><rect x="2" y="9" width="2" height="1"></rect><rect x="2" y="14" width="2" height="1"></rect></svg></a>
<div id="offcanvas-usage" uk-offcanvas>
<div class="uk-offcanvas-bar">
<button class="uk-offcanvas-close" type="button" uk-close></button>
<div class="uk-text-large">Filter By:</div>
<search-filter *ngFor="let filter of filters " [addShowMore]=false [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
</div>
</div>
</div>
</div>
<div class="uk-grid uk-width-1-1">
<div class="helper-left-right search-filters uk-width-1-6@m uk-visible@m">
<helper position="left"></helper>
<search-filter *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
</div>
<div class="uk-width-expand@m uk-width-1-1@s uk-first-column custom-dataTable-content" >
<div *ngIf="searchUtils.totalResults > 0" class="uk-align-center uk-margin-remove-bottom">
<div class="searchPaging uk-panel uk-margin-top uk-grid uk-margin-bottom">
<span class="uk-h6 uk-width-1-1@s uk-width-1-2@m">
{{searchUtils.totalResults}} content providers, page {{searchUtils.page}} of {{(totalPages())}}
</span>
<span class="float-children-right-at-medium margin-small-top-at-small uk-width-1-1@s uk-width-1-2@m">
<paging-no-load [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [size]="rowsOnPage" (pageChange)="goTo($event.value, false)"></paging-no-load>
</span>
</div>
</div>
<div *ngIf="searchViewLink" class="uk-width-1-1@s uk-hidden@m">
<p>
<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="2" y="2" width="3" height="3"></rect><rect x="8" y="2" width="3" height="3"></rect><rect x="14" y="2" width="3" height="3"></rect><rect x="2" y="8" width="3" height="3"></rect><rect x="8" y="8" width="3" height="3"></rect><rect x="14" y="8" width="3" height="3"></rect><rect x="2" y="14" width="3" height="3"></rect><rect x="8" y="14" width="3" height="3"></rect><rect x="14" y="14" width="3" height="3"></rect></svg></span>
<a routerLinkActive="router-link-active" [class]="(disableForms)?'uk-disabled uk-link-muted':''" [routerLink]=searchViewLink >
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="table" ratio="1"><rect x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg></span>
</a>
</p>
</div>
<div *ngIf="searchUtils.totalResults <= 0" class="errors-in-searchTableView">
<errorMessages [status]="[searchUtils.status]" [type]="'results'"></errorMessages>
</div>
<div class="uk-overflow-container ">
<!-- #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage"
[mfData]="results | contentProvidersDatatable : [searchUtils, filters, triggerPipe, cd]"
dtInstance="dtInstanceCallback"
-->
<table datatable class="uk-table uk-table-striped divider-table" [dtOptions]="dtOptions" id="dpTable" [dtTrigger]="dtTrigger" >
<thead >
<tr>
<!-- Name Type Country Institution Compatibility -->
<th class="uk-text-left">Name
<!--svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<polygon fill="#767779" points="4 1 1 6 7 6"></polygon>
<polygon fill="#767779" points="4 13 1 8 7 8"></polygon>
</svg-->
</th>
<th class="uk-text-center"> Type
</th>
<th class="uk-text-center"> Country
</th>
<th class="uk-text-center"> Institution
</th>
<th class="uk-text-center"> Compatibility
</th>
</tr>
</thead>
<tbody>
<tr class="uk-table-middle" *ngFor="let dataprovider of results">
<td class="uk-width-1-5 uk-text-left">
<a [queryParams]="{datasourceId: dataprovider.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider">
<span *ngIf="dataprovider.title.name"
[innerHTML]="dataprovider.title.name">
</span>
<span *ngIf="!dataprovider.title.name">
[no title available]
</span>
</a>
</td>
<td class="uk-width-1-5 uk-text-center">
<span *ngIf="dataprovider.type">{{dataprovider.type}}</span>
<span *ngIf="!dataprovider.type">-</span>
</td>
<td class="uk-width-1-5 uk-text-center">
<span *ngFor="let country of dataprovider['countries'].slice(0,5) let i = index">{{country}}{{(i < ( dataprovider['countries'].slice(0,5).length-1))?", ":""}}{{(i == dataprovider['countries'].slice(0,5).length-1 && dataprovider['countries'].length > 5)?"...":""}}</span>
<span *ngIf="dataprovider.countries.length == 0">-</span>
</td>
<td class="uk-width-1-5 uk-text-center">
<span *ngFor="let org of dataprovider['organizations'].slice(0,5) let i = index">
<a *ngIf="org.id" [queryParams]="{organizationId: org.id}" routerLinkActive="router-link-active" routerLink="/search/organization">{{org.name}}</a><span *ngIf="!org.id">{{org.name}}</span>{{(i < ( dataprovider['organizations'].slice(0,5).length-1))?", ":""}}{{(i == dataprovider['organizations'].slice(0,5).length-1 && dataprovider['organizations'].length > 5)?"...":""}}
</span>
<span *ngIf="dataprovider.organizations.length == 0">-</span>
</td>
<td class="uk-width-1-5 uk-text-center">
<span *ngIf="dataprovider.compatibility">{{dataprovider.compatibility}}</span>
<span *ngIf="!dataprovider.compatibility">-</span>
</td>
</tr>
</tbody>
<!-- <thead *ngIf="searchUtils.totalResults > 0">
<tr><td colspan="5" class="uk-padding-remove-horizontal">
<span class="uk-h6">
{{searchUtils.totalResults}} content providers, page {{searchUtils.page}} of {{(totalPages())}}
</span>
<paging-no-load class="uk-float-right" [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [size]="rowsOnPage" (pageChange)="goTo($event.value, false)"></paging-no-load>
</td></tr>
</thead> -->
</table>
</div>
<div *ngIf="searchUtils.totalResults > 0" class="uk-align-center uk-margin-remove-bottom">
<div class="searchPaging uk-panel uk-margin-top uk-grid uk-margin-bottom">
<span class="uk-h6 uk-width-1-1@s uk-width-1-2@m">
{{searchUtils.totalResults}} content providers, page {{searchUtils.page}} of {{(totalPages())}}
</span>
<span class="float-children-right-at-medium margin-small-top-at-small uk-width-1-1@s uk-width-1-2@m">
<paging-no-load [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [size]="rowsOnPage" (pageChange)="goTo($event.value, false)"></paging-no-load>
</span>
</div>
</div>
<helper class="uk-hidden@m" position="left" styleName="uk-width-1-1@s"></helper>
<helper class="uk-hidden@m" position="right" styleName="uk-width-1-1@s"></helper>
</div>
<div *ngIf="searchViewLink" class="helper-left-right uk-width-1-6@m uk-visible@m">
<p>
<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="2" y="2" width="3" height="3"></rect><rect x="8" y="2" width="3" height="3"></rect><rect x="14" y="2" width="3" height="3"></rect><rect x="2" y="8" width="3" height="3"></rect><rect x="8" y="8" width="3" height="3"></rect><rect x="14" y="8" width="3" height="3"></rect><rect x="2" y="14" width="3" height="3"></rect><rect x="8" y="14" width="3" height="3"></rect><rect x="14" y="14" width="3" height="3"></rect></svg></span>
<a routerLinkActive="router-link-active" [class]="(disableForms)?'uk-disabled uk-link-muted':''" [routerLink]=searchViewLink >
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="table" ratio="1"><rect x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg></span>
</a>
</p>
<helper position="right"></helper>
</div>
</div>
<helper position="bottom"></helper>
</div>
<modal-search-filter [filter]="currentFilter" [showResultCount]=showResultCount (modalChange)="filterChanged($event)"></modal-search-filter>
</div>
</div>
</div>