Bug 40330: Conform and add labels to the OPAC

Test plan:

Enable the system preference: marcflavour: choose UNIMAR,
PrivacyPolicyConsent, ILLModule, TagsEnabled, OpacCloud.

1- Apply the patch
2- Go to the OPAC, log in to a patron account. Go to personal details,
   check the html code of the date of birth field, and notice that there
   is a aria-hidden="false".
3- Inspect the search bar, and notice in the library select, there is a
   label with a for attribute which match the id.
4- Search a record, click on "save to list" and check the Category
   select, inspect if the label has a for attribute and match the select
   id.
5- Go to interlibrary Loan Request in the user menu, Check if the "Note"
   field has a label for attribute which match the id.
6- Go to Consent, check if the checkbox has a label for "Yes" and "No".
7- Go to Suggestions and check that the checkbox has the same id as the
   label in the Summary column.
8- Go to "Tag Cloud", inspect the HTML code of the "Tags to show from
   other users" label, notice that there is a for attribute which match
   the id of the input tag. and check if in the html code there is an
   aria-label with the term of the tag.
9- Go to Subject Cloud, check the html code, and notice that there is a
   label that surounds the input tag.
10- Go to Advanced Search, click on "More options", and check that all
    the additional options have a label with a for attribute which match
    the id of the select.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 59a8b35f8c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
nina martinez 2025-07-03 13:38:35 +02:00 committed by Paul Derscheid
parent 94a50dd6e6
commit 865801e609
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
9 changed files with 39 additions and 36 deletions

View File

@ -96,7 +96,7 @@
instance.clear();
})
.addClass("fa fa-fw fa-times")
.attr("aria-hidden", true)
.attr("aria-hidden", false)
.attr("aria-label", _("Clear date"))
)
.keydown(function (e) {

View File

@ -312,6 +312,7 @@
[% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 && AllPublicBranches.size > 1 ) %]
<div class="col-sm col-md-3 col-lg-2 order-3 order-sm-4">
<label for="select_library" class="visually-hidden">Search the catalog in:</label>
<select name="limit" id="select_library" class="form-select">
<option value="">All libraries</option>

View File

@ -1,8 +1,8 @@
<fieldset>
<legend>Coded fields</legend>
<p>
<label>Audience</label>
<select name="limit" class="subtype">
<label for="audience">Audience</label>
<select id="audience" name="limit" class="subtype">
<option value="" selected="selected">Any</option>
<option value="aud:a">juvenile, general</option>
<option value="aud:b">pre-primary (0-5)</option>
@ -15,8 +15,8 @@
</select>
</p>
<p>
<label>Physical presentation</label>
<select name="limit" class="subtype">
<label for="physical_presentation">Physical presentation</label>
<select id="physical_presentation" name="limit" class="subtype">
<option value="" selected="selected">Any</option>
<option value="Material-type:r">regular print</option>
<option value="Material-type:d">large print</option>
@ -32,8 +32,8 @@
</select>
</p>
<p>
<label>Literary genre</label>
<select name="limit" class="subtype">
<label for="literary_genre">Literary genre</label>
<select id="literary_genre" name="limit" class="subtype">
<option value="" selected="selected">Any</option>
<option value="Literature-Code:a">fiction</option>
<option value="Literature-Code:b">drama</option>
@ -49,8 +49,8 @@
</select>
</p>
<p>
<label>Biography</label>
<select name="limit" class="subtype">
<label for="biography">Biography </label>
<select id="biography" name="limit" class="subtype">
<option value="">Any</option>
<option value="Biography-code:y">not a biography</option>
<option value="Biography-code:a">autobiography</option>
@ -60,8 +60,8 @@
</select>
</p>
<p>
<label>Illustration</label>
<select name="limit" class="subtype">
<label for="illustration">Illustration</label>
<select id="illustration" name="limit" class="subtype">
<option value="">Any</option>
<option value="Illustration-Code:a">illustrations</option>
<option value="Illustration-Code:b">maps</option>
@ -82,8 +82,8 @@
</select>
</p>
<p>
<label>Content</label>
<select name="limit" class="subtype">
<label for="content">Content</label>
<select id="content" name="limit" class="subtype">
<option value="">Any</option>
<option value="ctype:a">bibliography</option>
<option value="ctype:b">catalogue</option>
@ -111,8 +111,8 @@
</select>
</p>
<p>
<label>Video types</label>
<select name="limit" class="subtype">
<label for="video_types">Video types </label>
<select id="video_types" name="limit" class="subtype">
<option value="">Any</option>
<option value="Video-mt:a">motion picture</option>
<option value="Video-mt:b">visual projection</option>
@ -124,8 +124,8 @@
<fieldset>
<legend>Serials</legend>
<p>
<label>Serial type</label>
<select name="limit" class="subtype">
<label for="serial_type">Serial type </label>
<select id="serial_type" name="limit" class="subtype">
<option value="">Any type</option>
<option value="Type-Of-Serial:a">Periodical</option>
<option value="Type-Of-Serial:b">Monographic series</option>
@ -137,8 +137,8 @@
</select>
</p>
<p>
<label>Periodicity</label>
<select name="limit" class="subtype">
<label for="periodicity">Periodicity</label>
<select id="periodicity" name="limit" class="subtype">
<option value="">Any</option>
<option value="Frequency-code:a">Daily</option>
<option value="Frequency-code:b">Semiweekly</option>
@ -161,8 +161,8 @@
</select>
</p>
<p>
<label>Regularity</label>
<select name="limit" class="subtype">
<label for="regularity">Regularity </label>
<select id="regularity" name="limit" class="subtype">
<option value="">Any regularity</option>
<option value="Regularity-code:a">regular</option>
<option value="Regularity-code:b">normalised irregular</option>
@ -174,7 +174,8 @@
<fieldset>
<legend>Picture</legend>
<select name="limit" class="subtype">
<label for="graphics-type" class="sr-only">Graphics type</label>
<select id="graphics-type" name="limit" class="subtype">
<option value="">Any</option>
<option value="Graphics-type:a">collage</option>
<option value="Graphics-type:b">drawing</option>
@ -187,7 +188,8 @@
<option value="Graphics-type:k">technical drawing</option>
<option value="Graphics-type:z">other non-projected graphic type</option>
</select>
<select name="limit" class="subtype">
<label for="graphics-support" class="sr-only">Graphics support</label>
<select id="graphics-support" name="limit" class="subtype">
<option value="">Any</option>
<option value="Graphics-support:a">canvas</option>
<option value="Graphics-support:b">bristol board</option>

View File

@ -98,7 +98,7 @@
<legend>Add to a new list:</legend>
<label for="newvirtualshelf">List name:</label>
<input type="text" name="newvirtualshelf" id="newvirtualshelf" size="40" />
<label for="category">Category:</label>
<label for="public">Category:</label>
<select name="public" id="public">
<option value="0">Private</option>
[% IF (OpacAllowPublicListCreation) %]

View File

@ -207,7 +207,7 @@
<li>
<label for="notesopac">Notes:</label>
[% IF !request.completed %]
<textarea name="notesopac" rows="5" cols="50">[% request.notesopac | html %]</textarea>
<textarea id="notesopac" name="notesopac" rows="5" cols="50">[% request.notesopac | html %]</textarea>
[% ELSE %]
[% request.notesopac | html %]
[% END %]

View File

@ -57,14 +57,14 @@
[% END %]
<fieldset>
[% IF consent.given_on %]
<input type="radio" name="check_[% consent_type | html %]" value="1" checked="checked" /> Yes<br />
<input type="radio" name="check_[% consent_type | html %]" value="0" /> No
<label><input type="radio" name="check_[% consent_type | html %]" value="1" checked="checked" /> Yes</label><br />
<label><input type="radio" name="check_[% consent_type | html %]" value="0" /> No</label>
[% ELSIF consent.refused_on %]
<input type="radio" name="check_[% consent_type | html %]" value="1" /> Yes<br />
<input type="radio" name="check_[% consent_type | html %]" value="0" checked="checked" /> No
<label> <input type="radio" name="check_[% consent_type | html %]" value="1" /> Yes</label><br />
<label><input type="radio" name="check_[% consent_type | html %]" value="0" checked="checked" /> No </label>
[% ELSE %]
<input type="radio" name="check_[% consent_type | html %]" value="1" /> Yes<br />
<input type="radio" name="check_[% consent_type | html %]" value="0" /> No
<label><input type="radio" name="check_[% consent_type | html %]" value="1" /> Yes</label><br />
<label><input type="radio" name="check_[% consent_type | html %]" value="0" /> No</label>
[% END %]
[% IF consent.given_on %]
<p class="consent_info"><strong>Your consent was registered on [% consent.given_on | html %].</strong></p>

View File

@ -449,7 +449,7 @@
[% END %]
<td>
<p>
<label for="id[% suggestions_loo.suggestionid | html %]">
<label for="id[% suggestion.suggestionid | html %]">
[% IF suggestion.biblionumber %]
<strong><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% suggestion.biblionumber | uri %]">[% suggestion.title | html %]</a></strong>
[% ELSE %]

View File

@ -109,7 +109,7 @@
<form method="get" action="opac-tags.pl" class="row">
<div class="col-auto gx-2 ms-2 my-1">
<label>
<label for="limit-tag">
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
<span>Tags to show from other users:</span>
[% ELSE %]
@ -118,7 +118,7 @@
</label>
</div>
<div class="col-auto gx-2 my-1">
<input type="text" name="limit" class="form-control form-control-sm" maxlength="4" size="4" value="[% limit or '100' | html %]" />
<input id="limit-tag" type="text" name="limit" class="form-control form-control-sm" maxlength="4" size="4" value="[% limit or '100' | html %]" />
</div>
<div class="col-auto gx-2 my-1">
<input type="submit" value="OK" class="btn btn-sm btn-primary" />
@ -185,7 +185,7 @@
data-title="[% MY_TAG.title | html %]"
data-tagname="[% MY_TAG.term | html %]"
data-tagid="[% MY_TAG.tag_id | html %]"
aria-label="[% check_title | html %]"
aria-label="[% MY_TAG.term | html %]"
/>
</td>
<td class="tagterm">

View File

@ -38,7 +38,7 @@
<fieldset>
<legend>Show</legend>
<form class="form-inline" action="/cgi-bin/koha/opac-tags_subject.pl" method="get">
<p>up to <input type="text" name="number" value="[% number | html %]" size="4" maxlength="4" /> subjects <input type="submit" class="btn btn-primary" value="OK" /></p>
<label>up to <input type="text" name="number" value="[% number | html %]" size="4" maxlength="4" /> </label> <label>subjects <input type="submit" class="btn btn-primary" value="OK" /></label>
</form>
</fieldset>