openaire-library/searchPages/searchUtils/searchFilter.component.html

146 lines
9.3 KiB
HTML

<div *ngIf= "filter.values.length >0" class="uk-margin-small-bottom">
<div class="uk-margin-small-top uk-margin-bottom uk-grid uk-flex uk-flex-bottom">
<h5 class="uk-margin-bottom-remove" title = "{{filter.title}}">{{_formatTitle(filter.title,filter.values.length)}}</h5>
<a *ngIf="filter.countSelectedValues>0" (click)="clearFilter()" class="portal-link">
Clear
</a>
</div>
<div aria-expanded="false">
<div>
<ng-container>
<!-- <div *ngFor = "let value of getSelectedValues(filter,'num')" class="uk-animation-fade filterItem searchFilterItem uk-text-small">-->
<!-- <div title = "{{value.name}}">-->
<!-- <ng-container *ngIf="filter.filterType == 'checkbox' || filter.filterType == 'radio'">-->
<!-- <input *ngIf="filter.filterType == 'checkbox'" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />-->
<!-- <input *ngIf="filter.filterType == 'radio'" type="radio" (click)="uniqueFilterChange(value)"-->
<!-- [name]=filter.filterId checked/>-->
<!-- {{' '+_formatName(value)}}-->
<!-- <span *ngIf = "showResultCount === true" >-->
<!-- {{' ('+(value.number|number)+')'}}</span>-->
<!-- </ng-container>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div *ngFor = "let value of getNotSelectedValues(filter,'num').slice(0,(!addShowMore?getNotSelectedValues(filter,'num').length:filterValuesNum-getSelectedValues(filter,'num').length))" class = "uk-animation-fade filterItem searchFilterItem uk-text-small">-->
<!-- <div title = "{{value.name}}" [class]="(isDisabled || (showResultCount && value.number === 0))?'uk-text-muted':''" >-->
<!-- <input *ngIf="filter.filterType == 'checkbox'" [disabled]="isDisabled || (showResultCount && value.number === 0)" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />-->
<!-- <input *ngIf="filter.filterType == 'radio'" [disabled]="isDisabled || (showResultCount && value.number === 0)" type="radio" (click)="uniqueFilterChange(value)"-->
<!-- [name]=filter.filterId value=false />-->
<!-- {{' '+ _formatName(value) }}-->
<!-- <span *ngIf = "showResultCount === true" [class]="(isDisabled || value.number === 0)?'uk-text-muted':''" >-->
<!-- {{' ('+(value.number|number)+')'}}-->
<!-- </span>-->
<!-- </div>-->
<!-- </div>-->
<div *ngFor="let value of getSelectedAndTopValues(filter, filterValuesNum)"
class="uk-animation-fade filterItem searchFilterItem uk-text-small">
<div title = "{{value.name}}">
<label *ngIf="filter.filterType == 'checkbox' || filter.filterType == 'radio'">
<input *ngIf="filter.filterType == 'checkbox'" type="checkbox"
[disabled]="isDisabled || (showResultCount && value.number === 0)"
[(ngModel)]="value.selected" (ngModelChange)="filterChange(value.selected)" />
<input *ngIf="filter.filterType == 'radio'" type="radio"
[disabled]="isDisabled || (showResultCount && value.number === 0)"
[name]=filter.filterId [value]="true" [(ngModel)]="value.selected" (click)="uniqueFilterChange(value)"/>
{{' '+_formatName(value)}}
<span *ngIf = "showResultCount === true" >
{{' ('+(value.number|number)+')'}}
</span>
</label>
</div>
</div>
</ng-container>
<div *ngIf=" addShowMore && (filter.values.length) > filterValuesNum">
<a
[class]="((isDisabled)?'uk-disabled uk-link-muted ':' portal-link ') + ' uk-margin-small-top'"
[attr.uk-toggle]="'target: #toggle-'+filter.filterId" (click)="toggle()">
<span *ngIf="!isOpen">+ View all</span>
<!-- <span *ngIf="isOpen">- View less</span>-->
</a>
<div hidden [id]="'toggle-'+filter.filterId" class="uk-text-small uk-margin-small-bottom">
<div class="">
<span class="uk-text-meta uk-margin-small-left">Top 100 values are
shown in the filters</span>
<div class="uk-grid uk-margin-small-left uk-flex uk-flex-bottom">
<input class="uk-input uk-margin-small-top uk-form-small uk-width-2-3@m uk-width-3-5@s text-input-box "
name="filter-keyword"
placeholder="Search..." type="text" [(ngModel)]="keyword">
<span *ngIf = "showResultCount === true"
class="uk-width-1-3@m uk-width-2-5@s uk-padding-small uk-padding-remove-vertical uk-padding-remove-right">
<span class="uk-width-1-4 uk-text-muted"> Sort by:</span>
<select [(ngModel)]="sortBy"
class=" uk-width-expand uk-select uk-hidden@m uk-form-small"
id="form-horizontal-select" name="select_order">
<option value="num">Results number</option>
<option value="name">Name</option>
</select>
<mat-select [(ngModel)]="sortBy"
class="uk-width-expand matSelection uk-visible@m"
id="form-horizontal-select1" name="select_order"
[disableOptionCentering]="true" panelClass="matSelectionPanel">
<mat-option value="num">Results number</mat-option>
<mat-option value="name">Name</mat-option>
</mat-select>
</span>
</div>
</div>
<div class="uk-modal-body uk-overflow-auto uk-height-max-small uk-padding-remove
uk-margin-small-left uk-margin-small-right uk-margin-small-top uk-width-1-1">
<!-- <ng-container *ngFor = "let value of getSelectedValues(filter, sortBy)">-->
<!-- <div *ngIf="filterKeywords(value.name)" class = "uk-animation-fade filterItem searchFilterItem">-->
<!-- <div title = "{{value.name}}">-->
<!-- <input *ngIf="filter.filterType == 'checkbox'" [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />-->
<!-- <input *ngIf="filter.filterType == 'radio'" [disabled]="isDisabled" type="radio" (click)="uniqueFilterChange(value)"-->
<!-- [name]=filter.filterId checked/>-->
<!-- {{' ' + _formatName(value) + ' '}}-->
<!-- <span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number|number}})</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </ng-container>-->
<!-- <ng-container *ngFor = "let value of getNotSelectedValues(filter, sortBy)">-->
<!-- <div *ngIf="filterKeywords(value.name)" class = "uk-animation-fade filterItem searchFilterItem">-->
<!-- <div title = "{{value.name}}">-->
<!-- <input *ngIf="filter.filterType == 'checkbox'" [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />-->
<!-- <input *ngIf="filter.filterType == 'radio'" [disabled]="isDisabled" type="radio" (click)="uniqueFilterChange(value)"-->
<!-- [name]=filter.filterId value=false />-->
<!-- {{' ' + _formatName(value) + ' '}}-->
<!-- <span *ngIf = "showResultCount === true" > ({{value.number|number}})</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </ng-container>-->
<ng-container *ngFor="let value of sort(filter.values)">
<div *ngIf="filterKeywords(value.name)" title = "{{value.name}}"
class="uk-animation-fade filterItem searchFilterItem uk-text-small">
<label *ngIf="filter.filterType == 'checkbox' || filter.filterType == 'radio'">
<input *ngIf="filter.filterType == 'checkbox'" type="checkbox"
[disabled]="isDisabled || (showResultCount && value.number === 0)"
[(ngModel)]="value.selected" (ngModelChange)="filterChange(value.selected)" />
<input *ngIf="filter.filterType == 'radio'" type="radio"
[disabled]="isDisabled || (showResultCount && value.number === 0)"
[name]=filter.filterId [value]="true" [(ngModel)]="value.selected" (click)="uniqueFilterChange(value)"/>
{{' '+_formatName(value)}}
<span *ngIf = "showResultCount === true" >
{{' ('+(value.number|number)+')'}}</span>
</label>
</div>
</ng-container>
</div>
</div>
<a [class]="(isDisabled)?'uk-disabled uk-link-muted ':' portal-link '"
[attr.uk-toggle]="'target: #toggle-'+filter.filterId" (click)="toggle()">
<span *ngIf="isOpen">- View less</span>
</a>
</div>
</div>
</div>
</div>