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

80 lines
4.3 KiB
HTML
Raw Normal View History

<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">
2022-03-15 12:13:28 +01:00
<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))"
2022-03-15 12:13:28 +01:00
[class]="'uk-text-center '
+ ((stringToNum(filter.selectedFromValue) == currentYear && stringToNum(filter.selectedToValue) == currentYear) ? ' uk-text-bold' : '')
"
(click)="yearChanged(0)"
>This year</a>
<a *ngIf="!actionRoute"
2022-03-15 12:13:28 +01:00
[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))"
2022-03-15 12:13:28 +01:00
[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"
2022-03-15 12:13:28 +01:00
[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))"
2022-03-15 12:13:28 +01:00
[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"
2022-03-15 12:13:28 +01:00
[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>