Bug 39492: Accessibility - add aria label to the OPAC browse shelf link

An accessibility audit highlighted that the browse shelf link on a
record's holding page does not provide enough context for visually
impaired users. The suggested solution was to add aria labels to provide
context.

Test plan:
1. Ensure that you have at least one item with a call number.
2. Navigate to the records's page and scroll down to the holdings table.
3. Right click and choose inspect on the 'Browse shelf' link and note
   that there is not an aria label.
4. Apply the patch.
5. Refresh the page and repeat step 3.
6. Note that there is now an aria label that adds context to the browse shelf
   link - it now includes the title of the record, for example:
   ...aria-label="Browse Shelf for Programming Perl /"...

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Alexander Blanchard 2025-04-02 14:31:05 +00:00 committed by Katrin Fischer
parent b7c32d4fae
commit ef8b901431
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 8 additions and 3 deletions

View File

@ -1425,11 +1425,16 @@
[% ITEM_RESULT.itemcallnumber | html %]
[% IF ( OPACShelfBrowser ) %]
[% IF ( ITEM_RESULT.itemnumber == starting_itemnumber ) %]
(<a class="close_shelf" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber | html %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber | html %]#[% tab | html %]"
>Browse shelf<span class="sr-only">(Opens below)</span></a
(<a
class="close_shelf"
href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber | html %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber | html %]#[% tab | html %]"
aria-label="Browse Shelf for [% title %]"
>Browse shelf???<span class="sr-only">(Opens below)</span></a
>)
[% ELSE %]
(<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber | uri %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber | uri %]#[% tab | uri %]"
(<a
href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber | uri %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber | uri %]#[% tab | uri %]"
aria-label="Browse Shelf for [% title %]"
>Browse shelf<span class="sr-only">(Opens below)</span></a
>)
[% END %]