Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[64235] [Accessibility] Provide alternative link texts for pagination links (#19374)

Behrokh Satarnejad2cb0168b980b
diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml
index d52c6c8239a..75d40ec8ca6 100644
--- a/config/locales/js-en.yml
+++ b/config/locales/js-en.yml
@@ -697,7 +697,8 @@ en:
pagination:
no_other_page: "You are on the only page."
- pagination_controls: "Pagination controls"
+ page_navigation: "Pagination navigation"
+ per_page_navigation: 'Items per page selection'
pages:
next: "Next page"
previous: "Previous page"
diff --git a/frontend/src/app/shared/components/table-pagination/table-pagination.component.html b/frontend/src/app/shared/components/table-pagination/table-pagination.component.html
index 406c866a654..6ddd6c0d4d9 100644
--- a/frontend/src/app/shared/components/table-pagination/table-pagination.component.html
+++ b/frontend/src/app/shared/components/table-pagination/table-pagination.component.html
@@ -1,5 +1,5 @@
<div class="op-pagination" *ngIf="pagination && isVisible && pagination.total">
- <nav class="op-pagination--pages" [attr.aria-label]="text.pagination_controls">
+ <nav class="op-pagination--pages" [attr.aria-label]="text.page_navigation">
<ul class="op-pagination--items op-pagination--items_start" role="presentation">
<li [hidden]="pagination.page === 1 || !showPageSelections" class="op-pagination--item">
@@ -48,7 +48,7 @@
[textContent]="pageNumber"
></button>
</li>
- <li *ngIf="postPageNumbers.length" class="op-pagination--space">…</li>
+ <li *ngIf="postPageNumbers.length" class="op-pagination--space" role="separator">…</li>
</ng-container>
<ng-container *ngIf="postPageNumbers.length">
@@ -91,21 +91,19 @@
</nav>
<div class="op-pagination--options" *ngIf="showPerPageOptions()">
- <nav [attr.aria-label]="text.pagination_controls">
+ <nav [attr.aria-label]="text.per_page_navigation">
<ul
class="op-pagination--items op-pagination--items_end"
role="presentation">
<li
class="op-pagination--label"
- title="{{ text.per_page }}"
- role="presentation"
+ [attr.aria-label]="text.per_page"
[textContent]="text.per_page">
</li>
<li
*ngFor="let perPageOption of perPageOptions"
class="op-pagination--item"
- [ngClass]="{ 'op-pagination--item_current': perPageOption === pagination.perPage }"
- role="presentation">
+ [ngClass]="{ 'op-pagination--item_current': perPageOption === pagination.perPage }">
<span *ngIf="perPageOption !== pagination.perPage">
<button
class="op-pagination--item-link"
diff --git a/frontend/src/app/shared/components/table-pagination/table-pagination.component.ts b/frontend/src/app/shared/components/table-pagination/table-pagination.component.ts
index 027a7e98ffa..1db8e1d32f4 100644
--- a/frontend/src/app/shared/components/table-pagination/table-pagination.component.ts
+++ b/frontend/src/app/shared/components/table-pagination/table-pagination.component.ts
@@ -65,7 +65,8 @@ export class TablePaginationComponent extends UntilDestroyedMixin implements OnI
label_next: this.I18n.t('js.pagination.pages.next'),
per_page: this.I18n.t('js.label_per_page'),
no_other_page: this.I18n.t('js.pagination.no_other_page'),
- pagination_controls: this.I18n.t('js.pagination.pagination_controls'),
+ page_navigation: this.I18n.t('js.pagination.page_navigation'),
+ per_page_navigation: this.I18n.t('js.pagination.per_page_navigation'),
page_number: (num:number) => this.I18n.t('js.pagination.pages.page_number', { number: num }),
show_per_page: (num:number) => this.I18n.t('js.pagination.pages.show_per_page', { number: num }),
};