Bug 25244: Add specific aria-label to search results
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 29 Jun 2020 14:55:17 +0000 (15:55 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 20 Jul 2020 15:45:31 +0000 (17:45 +0200)
This patch adds an arai-lebel to the select checkboxes on the search
results page of the OPAC.

Test plan
1/ Perform a search that will yield some results
2/ Inspect the 'checkbox' on the left side of the results table
3/ Note that there is no arai-label
4/ Apply patch
5/ Refresh the search results page
6/ Inspect the 'checkbox' on the left side of the results table
7/ Note that the aria-label now appears and contains relavant
information
8/ Signoff

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Bug 25244: (follow-up) QA corrections

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt

index b9d1423..3fd522c 100644 (file)
                                     [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
                                         <tr>
                                             [% # Cell 1: Checkbox %]
+                                            [% IF ( SEARCH_RESULT.title ) %]
+                                                [% check_title = SEARCH_RESULT.title %]
+                                            [% ELSE %]
+                                                [% check_title = SEARCH_RESULT.biblionumber %]
+                                            [% END %]
                                             <td class="select selectcol">
                                                 [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
-                                                    <input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" /> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
+                                                    <input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" aria-label="Select search result: [% check_title | html %]" /> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
                                                 [% ELSE %]
                                                     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
-                                                        <input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" /> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
+                                                        <input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" aria-label="Select search result: [% check_title | html %]"/> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
                                                     [% ELSE %]
                                                         [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
                                                             [% UNLESS ( SEARCH_RESULT.norequests ) %]
-                                                                [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]<input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" /> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
+                                                                [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]<input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" aria-label="Select search result: [% check_title | html %]"/> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
                                                                 [% END %]
                                                             [% END %]
                                                         [% END # IF RequestOnOpac %]