openaire-library/utils/rangeFilter/rangeFilter.component.html

80 lines
4.3 KiB
HTML

<div class="uk-margin-small-bottom">
<div class="uk-margin-small-top uk-margin-bottom uk-flex uk-flex-middle">
<h6 class="uk-margin-remove-bottom">{{_formatTitle(filter.title)}}</h6>
<a *ngIf="filter.selectedFromValue || filter.selectedToValue" (click)="clearFilter()"
[class.uk-disabled]="isDisabled" class="uk-text-small uk-margin-left">
Clear
</a>
</div>
<div aria-expanded="false">
<div>
<div class="uk-animation-fade uk-text-small">
<div>
<div #input class="uk-width-4-5" input [formInput]="rangeForm" type="year-range" [yearRange]="yearRange" [extendEnter]="onEnter"
inputClass="flat small background">
<div action (click)="yearChanged()" class="action-icon"
[class.disabled]="disabled || isDisabled">
<icon name="chevron_right" [flex]="true"></icon>
<span class="visually-hidden">GO</span>
</div>
</div>
<div class="uk-flex uk-flex-middle uk-flex-wrap">
<div *ngIf="showQuickButtons" class="uk-width-1-1">
<div class="uk-margin-small uk-margin-top uk-text-left">
<ul class="uk-text-small uk-grid uk-grid-small uk-grid-divider" uk-grid>
<li>
<a *ngIf="actionRoute" [routerLink]="getRoute()"
[queryParams]="getParams(0,(stringToNum(filter.selectedToValue) ==
currentYear
&&stringToNum(filter.selectedFromValue) == currentYear))"
[class]="'uk-text-center '
+ ((stringToNum(filter.selectedFromValue) == currentYear && stringToNum(filter.selectedToValue) == currentYear) ? ' uk-text-bold' : '')
"
(click)="yearChanged(0)"
>This year</a>
<a *ngIf="!actionRoute"
[class]="'uk-text-center '
+ ((stringToNum(filter.selectedFromValue) == currentYear && stringToNum(filter.selectedToValue) == currentYear) ? ' uk-text-bold' : '')
"
(click)="yearChanged(0)"
>This year</a>
</li>
<li><a *ngIf="actionRoute" [routerLink]="getRoute()"
[queryParams]="getParams(4,(stringToNum(filter.selectedToValue) == currentYear
&&stringToNum(filter.selectedFromValue) == currentYear-4))"
[class]="'uk-text-center '
+ ((stringToNum(filter.selectedToValue) == currentYear && stringToNum(filter.selectedFromValue) == currentYear-4) ? ' uk-text-bold' : '')
"
(click)="yearChanged(4)"
>Last 5 years</a>
<a *ngIf="!actionRoute"
[class]="'uk-text-center '
+ ((stringToNum(filter.selectedToValue) == currentYear && stringToNum(filter.selectedFromValue) == currentYear-4) ? ' uk-text-bold' : '')
"
(click)="yearChanged(4)"
>Last 5 years</a>
</li>
<li><a *ngIf="actionRoute" [routerLink]="getRoute()"
[queryParams]="getParams(9,(stringToNum(filter.selectedToValue) == currentYear &&stringToNum(filter.selectedFromValue) == currentYear-9))"
[class]="'uk-text-center '
+ ((stringToNum(filter.selectedToValue) == currentYear && stringToNum(filter.selectedFromValue) == currentYear-9) ? ' uk-text-bold' : '')
"
(click)="yearChanged(9)"
>Last 10 years</a>
<a *ngIf="!actionRoute"
[class]="'uk-text-center '
+ ((stringToNum(filter.selectedToValue) == currentYear && stringToNum(filter.selectedFromValue) == currentYear-9) ? ' uk-text-bold' : '')
"
(click)="yearChanged(9)"
>Last 10 years</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>