OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/frontend/app/components/table-pagination/table-pagination.component....

94 lines
3.3 KiB

Angular 4 support and upgraded timeline header directive (#5984) * Added Angular4 dependency and initial setup * Angular 4 transition: timeline header directive * removed superfluous require declaration * moved Angular4 dependencies to vendor.js * Angular4: upgraded timeline relations directive * Fixes karma tests. However, logging seems to be broken now. * Angular4: upgraded directive wpTimelineStaticElements * dev rebase * WIP Angular 4+ transition * converted WorkPackageTableTimelineGrid to Angular4+ * start migrating WorkPackageTimelineTableController to Angular4+ * completed migration of component tree WorkPackageTimelineTableController * Fix Pagination directive * set any to scope for TS warnings * Convert wp-table-pagination * merged changes from Oliver * begin migrating WorkPackagesTableController * begin migrating WorkPackagesTableController * Apply karma fix to PR * Fix pagination options * WIP Angular migration wp-table.directive * Angular4 migration - table sums * Angular4 migration: fixed error message when no sums are displayed * Angular4 migration: removed superfluous Angular1 registration * WIP Angular4 migration * WIP Angular4 migration - removed unused directives - start migartion sortHeader directive * WIP Angular4 migration - sortHeader directive * WIP Angular4 migration: sort header * Angular4 migration: implemented dropDown directive for Angular4 * merged origin/dev * updated package-lock.json * use shrinkwrap instead of package-lock * Angular4 migration: fixed accessible_by_keyboard directive * WIP #26714 * reformat code * fixes #26714 pass projectIdentifier to wpTable * cleanup * fixes #26716 * WIP Angular4 migration: added support for test execution * wpTablePagination: convertered reasonable tests to Angular4 * merged dev branch, updated dependencies * fixed #26727 * Replace openproject initialization in head * fixed #26728 * Replace time entries and messages ng1 controllers * Remove unused timeline reference * Fix OP Helpers for member page * Fix initial cached paged options * Fixed broken inlineCreate * Only nil-check for table, projectIdentifier CAN be null
7 years ago
<div class="pagination" *ngIf="pagination && pagination.total">
<nav class="pagination--pages">
<ul class="pagination--items">
<li [hidden]="pagination.page == 1" class="pagination--item">
<a (click)="showPage(pagination.page - 1)"
rel="prev start"
[attr.aria-label]="text.label_previous"
data-click-on-keypress="[13, 32]"
id= "pagination--prev-link"
role="link">&#60;</a>
</li>
<ng-container *ngIf="prePageNumbers.length > 0">
<li *ngFor="let pageNumber of prePageNumbers"
class="pagination--item">
<a (click)="showPage(pageNumber)"
rel="next"
data-click-on-keypress="[13, 32]"
role="link"
[textContent]="pageNumber"></a>
</li>
<li class="pagination--space"></li>
</ng-container>
<ng-container *ngIf="pageNumbers.length > 1">
<li *ngFor="let pageNumber of pageNumbers"
[ngClass]="{ '-current': pageNumber == pagination.page }"
class="pagination--item pagination-number">
<em *ngIf="pageNumber == pagination.page">{{ pageNumber }}</em>
<a *ngIf="pageNumber != pagination.page"
(click)="showPage(pageNumber)"
data-click-on-keypress="[13, 32]"
rel="next"
role="link"
[textContent]="pageNumber"></a>
</li>
<li *ngIf="postPageNumbers.length" class="pagination--space"></li>
</ng-container>
<ng-container *ngIf="postPageNumbers.length">
<li *ngFor="let pageNumber of postPageNumbers" class="pagination--item pagination-number">
<a (click)="showPage(pageNumber)"
rel="next"
data-click-on-keypress="[13, 32]"
role="link"
[textContent]="pageNumber"></a>
</li>
</ng-container>
<li [hidden]="!(pagination.total && pagination.page < pageNumbers[pageNumbers.length - 1])"
class="pagination--item">
<a (click)="showPage(pagination.page + 1)"
rel="next"
class="pagination--next-link"
[attr.aria-label]="text.label_next"
data-click-on-keypress="[13, 32]"
id="pagination--next-link"
role="link">&#62;</a>
</li>
<li class="pagination--range">
<span [textContent]="currentRange"></span>
<span *ngIf="pageNumbers.length === 1"
id="pagination-empty-text"
tabindex="0"
class="hidden-for-sighted"
[textContent]="text.no_other_page"></span>
</li>
</ul>
</nav>
<div class="pagination--options" *ngIf="perPageOptions.length > 0 && pagination.total > perPageOptions[0]">
<ul class="pagination--items">
<li class="pagination--label" [textContent]="text.per_page" title="{{ text.per_page }}"></li>
<li *ngFor="let perPageOption of perPageOptions"
[ngClass]="{ '-current': perPageOption == pagination.perPage }"
class="pagination--item">
<span *ngIf="perPageOption != pagination.perPage">
<a (click)="selectPerPage(perPageOption)"
data-click-on-keypress="[13, 32]"
role="link"
[textContent]="perPageOption"></a>
</span>
<span *ngIf="perPageOption == pagination.perPage">{{ perPageOption }}</span>
</li>
</ul>
</div>
</div>