Bug 41177: Add aria-disabled to breadcrumbs

This patch adds aria-disabled and tabindex = -1 to a breadcrumb, if it
is the current page. This aids in accesssibility, and is generally good
practice.

== TO TEST: ==
a)  Visit any page on the OPAC, and inspect the breadcrumb pertinent to
the current page
    *)  Notice the lack of aria-disabled and tabindex on the inspected
    element
== APPLY PATCH ==
b)  repeat step a
    *)  Notice how there is now an aria-disabled and tabindex = -1
    *)  Notice you cannot tab on to the final breadcrumb anymore
c)  Ensure other breadcrumbs are unaffected and still work as links
== SIGN OFF ==

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d5f8f70326)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Jake Deery 2025-10-23 12:10:30 +01:00 committed by Paul Derscheid
parent 485e4e1cc9
commit 906b475665
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
15 changed files with 15 additions and 15 deletions

View File

@ -551,7 +551,7 @@
[% IF content.trim %]
[% IF ( bc_active ) %]
<li class="breadcrumb-item active" aria-current="page">
<a href="#"> [% content | $raw %] </a>
<a href="#" aria-disabled="true" tabindex="-1"> [% content | $raw %] </a>
</li>
[% ELSE %]
<li class="breadcrumb-item"> [% content | $raw %] </li>

View File

@ -64,7 +64,7 @@
[% IF ( languages_loo.group_enabled ) %]
[% IF ( languages_loo.current ) %]
<li class="nav-item">
<a class="nav-link active currentlanguage" aria-current="page" href="#">
<a class="nav-link active currentlanguage" href="#" aria-current="page" aria-disabled="true" tabindex="-1">
[% IF ( languages_loo.native_description ) %]
[% languages_loo.native_description | html %]
[% ELSE %]

View File

@ -25,7 +25,7 @@
[% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %]
[% IF ( PAGE_NUMBER.highlight ) %]
<li class="page-item active" aria-current="page">
<a href="#" class="page-link">[% PAGE_NUMBER.pg | html %]</a>
<a href="#" class="page-link" aria-disabled="true" tabindex="-1">[% PAGE_NUMBER.pg | html %]</a>
</li>
[% ELSE %]
<li class="page-item">

View File

@ -26,7 +26,7 @@
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="#" aria-current="page">About Koha</a>
<a href="#" aria-current="page" aria-disabled="true" tabindex="-1">About Koha</a>
[% END %]
[% END %]
[% END %]

View File

@ -34,7 +34,7 @@
<a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
[% END %]
[% WRAPPER breadcrumb_item %]
<a href="#" aria-current="page">
<a href="#" aria-current="page" aria-disabled="true" tabindex="-1">
<span>Record overlay rules</span>
</a>
[% END %]

View File

@ -19,7 +19,7 @@
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="#" aria-current="page"> [% tx("Error {error_number}", {error_number = errno }) | html %] </a>
<a href="#" aria-current="page" aria-disabled="true" tabindex="-1"> [% tx("Error {error_number}", {error_number = errno }) | html %] </a>
[% END %]
[% END #/ WRAPPER breadcrumbs %]
[% END #/ WRAPPER sub-header.inc %]

View File

@ -16,7 +16,7 @@
[% FOREACH number IN numbers %]
[% IF ( startfrom == number.startfrom ) %]
<li class="page-item active" aria-current="page">
<a href="#" class="page-link">[% number.number | html %]</a>
<a href="#" class="page-link" aria-disabled="true" tabindex="-1">[% number.number | html %]</a>
</li>
[% ELSE %]
<li class="page-item">

View File

@ -159,7 +159,7 @@
[% BLOCK breadcrumb_item %]
[% IF ( bc_active ) %]
<li class="breadcrumb-item active">
<a href="#" aria-current="page"> [% content | $raw %] </a>
<a href="#" aria-current="page" aria-disabled="true" tabindex="-1"> [% content | $raw %] </a>
</li>
[% ELSE %]
<li class="breadcrumb-item"> [% content | $raw %] </li>

View File

@ -27,7 +27,7 @@
<a href="/cgi-bin/koha/opac-routing-lists.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Your payment</a>
<a href="#" aria-current="page" aria-disabled="true" tabindex="-1">Your payment</a>
</li>
</ol>
</nav>

View File

@ -23,7 +23,7 @@
<a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Your alert subscriptions</a>
<a href="#" aria-current="page" aria-disabled="true" tabindex="-1">Your alert subscriptions</a>
</li>
</ol>
</nav>

View File

@ -60,7 +60,7 @@
[% END %]
[% ELSE %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<a href="#" aria-current="page">Interlibrary loan requests</a>
<a href="#" aria-current="page" aria-disabled="true" tabindex="-1">Interlibrary loan requests</a>
[% END %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]

View File

@ -31,7 +31,7 @@
<a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Editing checkout note for '[% title | html %]' [% author | html %]</a>
<a href="#" aria-current="page" aria-disabled="true" tabindex="-1">Editing checkout note for '[% title | html %]' [% author | html %]</a>
</li>
</ol>
</nav>

View File

@ -31,7 +31,7 @@
<a class="previous-page" href="">Catalog search for '[% q | html %]'</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">OverDrive search for '[% q | html %]'</a>
<a href="#" aria-current="page" aria-disabled="true" tabindex="-1">OverDrive search for '[% q | html %]'</a>
</li>
</ol>
</nav>

View File

@ -21,7 +21,7 @@
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="#" aria-current="page">About Koha</a>
<a href="#" aria-current="page" aria-disabled="true" tabindex="-1">About Koha</a>
[% END %]
[% END %]
[% END %]

View File

@ -21,7 +21,7 @@
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="#" aria-current="page">About Koha</a>
<a href="#" aria-current="page" aria-disabled="true" tabindex="-1">About Koha</a>
[% END %]
[% END %]
[% END %]