[Library | Trunk]: Paging bold numbers

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60278 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2021-01-22 14:36:06 +00:00
parent 3be32603df
commit 3ac191b39c
5 changed files with 68 additions and 65 deletions

View File

@ -174,11 +174,11 @@
<div class="uk-panel uk-margin-small-top uk-grid uk-flex uk-flex-middle">
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase"
*ngIf="openaireResultsNum > 0">
{{openaireResultsNum|number}}
<span class="uk-text-bold">{{openaireResultsNum|number}}</span>
<span class="uk-text-muted uk-text-uppercase"> projects, page </span>
{{openaireResultsPage | number}}
<span class="uk-text-bold">{{openaireResultsPage | number}}</span>
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{(totalPages(openaireResultsNum)|number)}}
<span class="uk-text-bold">{{(totalPages(openaireResultsNum)|number)}}</span>
</div>
<div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand uk-padding-remove-left">
<paging-no-load class="uk-float-right" [currentPage]="openaireResultsPage"

View File

@ -198,11 +198,11 @@
<div class="uk-panel uk-margin-small-top uk-grid uk-flex uk-flex-middle">
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase"
*ngIf="openaireResultsNum > 0">
{{openaireResultsNum|number}}
<span class="uk-text-bold">{{openaireResultsNum|number}}</span>
<span class="uk-text-muted uk-text-uppercase"> research outcomes, page </span>
{{openaireResultsPage | number}}
<span class="uk-text-bold">{{openaireResultsPage | number}}</span>
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{(countTotalPages(openaireResultsNum)|number)}}
<span class="uk-text-bold">{{(countTotalPages(openaireResultsNum)|number)}}</span>
</div>
<div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand uk-padding-remove-left" *ngIf=" openaireResultsStatus != errorCodes.LOADING">
<paging-no-load class="uk-float-right" [currentPage]="openaireResultsPage"

View File

@ -5,12 +5,12 @@ import {Component, Input, Output, EventEmitter} from '@angular/core';
template: `
<div class="paging-hr searchPaging uk-margin-small-bottom">
<div class="uk-panel uk-margin-small-top uk-grid uk-flex uk-flex-middle">
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase" *ngIf="type && totalResults">
{{totalResults | number}}
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase" *ngIf="type && totalResults">
<span class="uk-text-bold">{{totalResults | number}}</span>
<span class="uk-text-muted uk-text-uppercase"> {{type}}, page </span>
{{page}}
<span class="uk-text-bold">{{page}}</span>
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{paging.getTotalPages()}}
<span class="uk-text-bold">{{paging.getTotalPages()}}</span>
</div>
<div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand">
<paging-no-load #paging [currentPage]="page"

View File

@ -43,11 +43,11 @@
<div class="uk-panel uk-margin-small-top uk-grid uk-flex uk-flex-middle">
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase"
*ngIf="results && searchUtils.totalResults > 0">
{{searchUtils.totalResults|number}}
<span class="uk-text-bold">{{searchUtils.totalResults|number}}</span>
<span class="uk-text-muted uk-text-uppercase"> {{type}}, page </span>
{{searchUtils.page | number}}
<span class="uk-text-bold">{{searchUtils.page | number}}</span>
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{(totalPages()|number)}}
<span class="uk-text-bold">{{(totalPages()|number)}}</span>
</div>
<div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand" *ngIf=" searchUtils.status != errorCodes.LOADING">
<paging-no-load [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [size]="searchUtils.size" (pageChange)="goTo($event.value)"></paging-no-load>

View File

@ -2,26 +2,26 @@ import {Component, Input} from '@angular/core';
import {ErrorCodes} from '../../utils/properties/errorCodes';
@Component({
selector: 'search-paging',
template: `
<div class= "paging-hr searchPaging uk-margin-small-bottom"
selector: 'search-paging',
template: `
<div class="paging-hr searchPaging uk-margin-small-bottom"
*ngIf="(results && searchUtils.totalResults > 0) || (!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING)">
<div class="uk-panel uk-margin-small-top uk-grid uk-flex uk-flex-middle">
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase"
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase"
*ngIf="results && searchUtils.totalResults > 0">
{{searchUtils.totalResults|number}}
<span class="uk-text-bold">{{searchUtils.totalResults|number}}</span>
<span class="uk-text-muted uk-text-uppercase"> {{type}}, page </span>
{{searchUtils.page | number}}
<span class="uk-text-bold">{{searchUtils.page | number}}</span>
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{(totalPages(searchUtils.totalResults)|number)}}
<span class="uk-text-bold">{{(totalPages(searchUtils.totalResults)|number)}}</span>
</div>
<div class="uk-width-1-1@s uk-width-1-2@m"
<div class="uk-width-1-1@s uk-width-1-2@m"
*ngIf="!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING">
{{oldTotalResults|number}}
<span class="uk-text-bold">{{oldTotalResults|number}}</span>
<span class="uk-text-muted uk-text-uppercase"> {{type}}, page </span>
{{searchUtils.page | number}}
<span class="uk-text-bold">{{searchUtils.page | number}}</span>
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{(totalPages(oldTotalResults)|number)}}
<span class="uk-text-bold">{{(totalPages(oldTotalResults)|number)}}</span>
</div>
<!--div class="uk-width-1-1@s uk-width-1-2@m" *ngIf="results && searchUtils.totalResults > 0">
{{searchUtils.totalResults|number}} {{type}}, page {{searchUtils.page | number}} of {{(totalPages(searchUtils.totalResults)|number)}}
@ -29,55 +29,58 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
<div class="uk-width-1-1@s uk-width-1-2@m" *ngIf="!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING">
{{oldTotalResults|number}} {{type}}, page {{searchUtils.page | number}} of {{(totalPages(oldTotalResults)|number)}}
</div-->
<div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand" *ngIf="results && searchUtils.totalResults > searchUtils.size">
<paging [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [baseUrl]="baseUrl"
[size]="searchUtils.size" [parameterNames] = "parameterNames" [parameterValues] = "parameterValues"
[isDisabled]="isDisabled">
<div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand"
*ngIf="results && searchUtils.totalResults > searchUtils.size">
<paging [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [baseUrl]="baseUrl"
[size]="searchUtils.size" [parameterNames]="parameterNames" [parameterValues]="parameterValues"
[isDisabled]="isDisabled">
</paging>
</div>
<div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand" *ngIf="!loadPaging && oldTotalResults > searchUtils.size && searchUtils.status == errorCodes.LOADING">
<paging [currentPage]="searchUtils.page" [totalResults]="oldTotalResults" [baseUrl]="baseUrl"
[size]="searchUtils.size" [parameterNames] = "parameterNames" [parameterValues] = "parameterValues"
[isDisabled]="isDisabled">
<div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand"
*ngIf="!loadPaging && oldTotalResults > searchUtils.size && searchUtils.status == errorCodes.LOADING">
<paging [currentPage]="searchUtils.page" [totalResults]="oldTotalResults" [baseUrl]="baseUrl"
[size]="searchUtils.size" [parameterNames]="parameterNames" [parameterValues]="parameterValues"
[isDisabled]="isDisabled">
</paging>
</div>
</div>
</div>
`
`
})
export class SearchPagingComponent {
@Input() isDisabled: boolean = false;
@Input() searchUtils;
@Input() results;
@Input() baseUrl;
@Input() type;
@Input() parameterNames:string[];
@Input() parameterValues:string[];
@Input() loadPaging: boolean = true;
@Input() oldTotalResults: number = 0;
public totalResults: number = 0;
public errorCodes:ErrorCodes = new ErrorCodes();
// @Input() totalResults:number = 0;
constructor () {}
ngOnInit() {
// this.totalResults = this.searchUtils.totalResults;
// if(!this.loadPaging && this.totalResults == 0) {
// this.totalResults = this.oldTotalResults;
// }
@Input() isDisabled: boolean = false;
@Input() searchUtils;
@Input() results;
@Input() baseUrl;
@Input() type;
@Input() parameterNames: string[];
@Input() parameterValues: string[];
@Input() loadPaging: boolean = true;
@Input() oldTotalResults: number = 0;
public totalResults: number = 0;
public errorCodes: ErrorCodes = new ErrorCodes();
// @Input() totalResults:number = 0;
constructor() {
}
ngOnInit() {
// this.totalResults = this.searchUtils.totalResults;
// if(!this.loadPaging && this.totalResults == 0) {
// this.totalResults = this.oldTotalResults;
// }
}
totalPages(totalResults: number): number {
let totalPages: any = totalResults / (this.searchUtils.size);
if (!(Number.isInteger(totalPages))) {
totalPages = (parseInt(totalPages, 10) + 1);
}
totalPages(totalResults: number): number {
let totalPages:any = totalResults/(this.searchUtils.size);
if(!(Number.isInteger(totalPages))) {
totalPages = (parseInt(totalPages, 10) + 1);
}
return totalPages;
}
return totalPages;
}
}