Bug 39497: update 'Lists' page tabs attributes
On the Koha OPAC, the 'Lists' page contains tabs which aren't clearly marked as such (no relevant attribute set on the element). This means that screen readers will not recognise the tabs as such, and screen reader users will not be made aware that these are available. Since the 'Advanced Search' page contains tabs that are correctly identified and described by screen readers, update the HTML atributes for the tabs on the 'Lists' page so that it matches theirs. Note: this is a quick and simple fix aiming to meet accessibility requirements. Another approach could be to implement wrappers (as in advsearch.tt), but it seems a bigger refactor of opac-shelves.tt may be needed to allow that. Test plan: 0) Before testing, ensure that the relevant patron has a few public and private lists. 1) Log in on the Koha OPAC 3) Navigate to Home > koha > Lists 2) Notice that, when the page first load, the 'Your Lists' tab panel is displayed (functionality is preserved) 3) Select 'Public lists', and notice that the tab panel now matches that (again, functionality is preserved) 4) Either inspect the page's HTML or run a Lighthouse test, and check that all aria attribute required by screen readers are present (aria attributes assumed to be required are aria-controls, aria-selected, and aria-labelledby. It is also assumed that 'role' attributes are needed) Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
6d973c9701
commit
e0b3afb2c3
|
|
@ -715,34 +715,40 @@
|
|||
[% ELSIF op == 'list' %]
|
||||
<h1>Lists</h1>
|
||||
<div class="toptabs">
|
||||
<ul class="nav nav-tabs" id="list-tabs">
|
||||
<ul class="nav nav-tabs" id="list-tabs" role="tablist">
|
||||
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
|
||||
[% IF !public %]
|
||||
<li id="privateshelves_tab" class="nav-item">
|
||||
<a class="nav-link active" id="your_lists" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0">Your lists</a>
|
||||
</li>
|
||||
[% ELSE %]
|
||||
<li id="privateshelves_tab" class="nav-item">
|
||||
<a class="nav-link" id="your_lists" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0">Your lists</a>
|
||||
</li>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF public %]
|
||||
<li id="publicshelves_tab" class="nav-item">
|
||||
<a class="nav-link active" id="public_lists" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1">Public lists</a>
|
||||
<li id="privateshelves_tab" class="nav-item" role="presentation">
|
||||
<a
|
||||
class="[% !public ? 'nav-link active' : 'nav-link' %]"
|
||||
id="your_lists"
|
||||
href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0"
|
||||
data-tabname="your_lists"
|
||||
aria-controls="privateshelves"
|
||||
role="tab"
|
||||
aria-selected="[% !public ? 'true' : 'false' | html %]"
|
||||
>Your lists</a
|
||||
>
|
||||
</li>
|
||||
[% ELSE %]
|
||||
<li id="publicshelves_tab" class="nav-item">
|
||||
<a class="nav-link" id="public_lists" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1">Public lists</a>
|
||||
<li id="publicshelves_tab" class="nav-item" role="presentation">
|
||||
<a
|
||||
class="[% public ? 'nav-link active' : 'nav-link' %]"
|
||||
id="public_lists"
|
||||
href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1"
|
||||
data-tabname="public_lists"
|
||||
aria-controls="publicshelves"
|
||||
role="tab"
|
||||
aria-selected="[% public ? 'true' : 'false' | html %]"
|
||||
>Public lists</a
|
||||
>
|
||||
</li>
|
||||
[% END %]
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
[% IF !public %]
|
||||
<div id="privateshelves" class="tab-pane active"> </div>
|
||||
<div id="privateshelves" class="tab-pane active" role="tabpanel" aria-labelledby="your_lists"> </div>
|
||||
[% ELSE %]
|
||||
<div id="publicshelves" class="tab-pane active"> </div>
|
||||
<div id="publicshelves" class="tab-pane active" role="tabpanel" aria-labelledby="public_lists"> </div>
|
||||
[% END %]
|
||||
|
||||
[% IF !public || Koha.Preference('OpacAllowPublicListCreation') %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue