LP1735768: adding labels to inputs in the public catalog
authorJane Sandberg <sandbej@linnbenton.edu>
Sat, 10 Nov 2018 20:32:04 +0000 (12:32 -0800)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 6 Aug 2019 01:10:50 +0000 (21:10 -0400)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
13 files changed:
Open-ILS/src/templates/opac/browse.tt2
Open-ILS/src/templates/opac/myopac/update_email.tt2
Open-ILS/src/templates/opac/myopac/update_password.tt2
Open-ILS/src/templates/opac/parts/advanced/global_row.tt2
Open-ILS/src/templates/opac/parts/advanced/numeric.tt2
Open-ILS/src/templates/opac/parts/advanced/search.tt2
Open-ILS/src/templates/opac/parts/anon_list.tt2
Open-ILS/src/templates/opac/parts/cart.tt2
Open-ILS/src/templates/opac/parts/login/form.tt2
Open-ILS/src/templates/opac/parts/place_hold.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2
Open-ILS/src/templates/opac/parts/sms_carrier_selector.tt2
Open-ILS/src/templates/opac/parts/sms_number_textbox.tt2

index dbaaa35..21c3e65 100644 (file)
@@ -52,6 +52,7 @@
                             id="browse-search-class" browse_only=1 plural=1 %]
 
                         [% control_bterm = BLOCK %]<input type="text" name="bterm" id="browse-term"
+                            aria-label="[% l('Browse term') %]"
                             value="[% CGI.param('bterm') | html %]" />[% END %]
                         [% control_locg = INCLUDE build_org_selector id='browse-context'
                             show_loc_groups=1
index a729953..34e4420 100644 (file)
@@ -28,8 +28,8 @@
     [% END %]
     <table> 
         <tr><td>[% l('Current Email') %]</td><td>[% ctx.user.email | html %]</td></tr>
-        <tr><td>[% l('Current Password') %]</td><td><input type='password' name='current_pw'/></td></tr>
-        <tr><td>[% l('New Email') %]</td><td><input type='text' name='email' value='[% ctx.invalid_email | html %]'/></td></tr>
+        <tr><td><label for="current_pw">[% l('Current Password') %]</label></td><td><input type='password' name='current_pw' id='current_pw' /></td></tr>
+        <tr><td><label for="new_email">[% l('New Email') %]</label></td><td><input type='text' name='email' id='new_email' value='[% ctx.invalid_email | html %]'/></td></tr>
         <tr><td colspan='2' align='center'><input value="[% l('Submit') %]" type='submit'/></td></tr>
     </table>
 </form>
index bef8b99..d86d8e1 100644 (file)
@@ -30,9 +30,9 @@
 
 <form method='post' id='account-update-email' autocomplete='off'>
     <table> 
-        <tr><td>[% l('Current Password') %]</td><td><input type='password' name='current_pw'/></td></tr>
-        <tr><td>[% l('New Password') %]</td><td><input type='password' name='new_pw'/></td></tr>
-        <tr><td>[% l('New Password Again') %]</td><td><input type='password' name='new_pw2'/></td></tr>
+        <tr><td><label for="current_pw">[% l('Current Password') %]</label></td><td><input type='password' name='current_pw' id='current_pw' /></td></tr>
+        <tr><td><label for="new_pw">[% l('New Password') %]</label></td><td><input type='password' name='new_pw' id='new_pw' /></td></tr>
+        <tr><td><label for="new_pw2">[% l('New Password Again') %]</label></td><td><input type='password' name='new_pw2'id='new_pw2' /></td></tr>
         <tr><td colspan='2' align='center'><input value="[% l('Submit') %]" type='submit'/></td></tr>
     </table>
 </form>
index 59b8c4e..32a550a 100644 (file)
@@ -45,7 +45,7 @@
             <option value="[% o.value %]" [% c == o.value ? ' selected="selected"' : '' %]>[% o.label %]</option>
             [% END %]
         </select>
-        <input title="[% l('Search term') %]"
+        <input title="[% l('Search term') %]" aria-label="[% l('Search term') %]"
           type='text' size='18' name='query' value="[% q | html %]" x-webkit-speech [% IF loop.index == 0 %] autofocus [% END %] />
         <a href="javascript:;" class="row-remover"
             title="[% l('Remove row') %]" alt="[% l('Remove row') %]"
index 9cc197a..15acf1e 100644 (file)
@@ -17,7 +17,7 @@
                     <option value="item_barcode">[% l('Item Barcode') %]</option>
                 </select>
        
-                <input type="text" name="query" size="16" autofocus placeholder='[% l("Identifier") %]' />
+                <input type="text" name="query" size="16" autofocus placeholder='[% l("Identifier") %]' aria-label='[% l("Identifier") %]' />
            <br/>
             [%- lib_select_id="numeric_search_library" -%]
             <label for="[% lib_select_id %]"><strong>[% l("Search Library:") %]</strong>
index e2cfed5..7ac166d 100644 (file)
                             <br/>
                             <div id='adv_special_block'>
                             [% END %]
-                                <input title="[% l('Search date') %]"
+                                <input title="[% l('Search date') %]" aria-label="[% l('Search date') %]"
                                   name='date1' type='text' size='4' maxlength='4' value="[% CGI.param('date1') | html %]" />
                                 <span id='adv_global_pub_date_2_span' class='[% CGI.param("pubdate") == "between" ? "" : "hide_me" %]'>
-                                   [% l("and") %] <input name='date2'
+                                   [% l("and") %] <input name='date2' aria-label="[% l('Secondary search date') %]"
                                     title="[% l('Secondary search date') %]" type='text' size='4' maxlength='4' value="[% CGI.param('date2') | html %]" />
                                 </span>
                             [% IF !ctx.exclude_electronic_checkbox %]
index 56fbd6c..ed0b546 100644 (file)
@@ -16,7 +16,7 @@
         <input type="hidden" name="orig_referrer" value="[% CGI.referer | html %]" />
         <input type="hidden" name="redirect_to" value="[% mkurl('', {}, ['list_none_selected', 'cart_none_selected']) %]" />
         <div class="bbag-action" style="clear:both;">
-            <select name="action">
+            <select name="action" aria-label="[% l('Actions for these items') %]">
                 <option>[% l('-- Actions for these items --') %]</option>
                 <option value="place_hold">[% l('Place hold') %]</option>
                 <option value="print">[% l('Print title details') %]</option>
@@ -33,7 +33,7 @@
             </select>
             [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
             <input class="opac-button" type="submit" value="[% l('Go') %]" />
-            <input type="checkbox" name="clear_cart">[% l('Clear entire basket when action complete') %]</input>
+            <input type="checkbox" name="clear_cart" id="clear_cart" /><label for="clear_cart">[% l('Clear entire basket when action complete') %]</label>
             [% IF CGI.param('cart_none_selected') %]
                 <span class="error">[% l('No items were selected') %]</span>
             [% END %]
@@ -43,7 +43,8 @@
                 <thead id="acct_list_header_anon">
                     <tr>
                         <td class='list_checkbox'>
-                            <input type="checkbox" checked="checked" onclick="
+                            <input type="checkbox" checked="checked"
+                                aria-label="[% l('Select all records') %]" onclick="
                                 var inputs=document.getElementsByTagName('input'); 
                                 for (i = 0; i < inputs.length; i++) { 
                                     if (inputs[i].name == 'record' && !inputs[i].disabled) inputs[i].checked = this.checked;}"/>
@@ -59,7 +60,7 @@
                         PROCESS get_marc_attrs args=attrs %]
                     <tr>
                         <td class="list_checkbox">
-                            <input type="checkbox" checked="checked" name="record" value="[% item %]" />
+                            <input type="checkbox" checked="checked" name="record" value="[% item %]" aria-label="[% l('Select record') %]" />
                         </td>
                         <td class="list_entry" data-label="[% l('Title') %]"><a href="[% mkurl(ctx.opac_root _ '/record/' _ item, {}, ['edit_notes', 'id']) %]">[% attrs.title | html %]</a></td>
                         <td class="list_entry" data-label="[% l('Author(s)') %]"><a href="[%-
index ae587bc..8451413 100644 (file)
@@ -1,6 +1,6 @@
 <div id="record_basket">
   <div id="basket_actions">
-    <select id="select_basket_action">
+    <select id="select_basket_action" aria-label="[% l('Select basket action') %]">
       <option value="">[% l('-- Basket Actions --') %]</option>
       <option value="[% mkurl(ctx.opac_root _ '/mylist', {}) %]">[% l('View Basket') %]</option>
       <option value="[% mkurl(ctx.opac_root _ '/mylist/move', { action => 'place_hold', entire_list => 1 }) %]">[% l('Place Holds') %]</option>
index 3146d5b..fa391f0 100644 (file)
@@ -50,7 +50,7 @@
             %]
             <input type='hidden' name='redirect_to' value='[% redirect | html %]'/>
             <input type="checkbox" name="persist" id="login_persist" /><label for="login_persist"> [% l('Stay logged in?') %]</label>
-            <input type="submit" value="[% l('Log in') %]" alt="[% l('Log in') %]" class="opac-button" />
+            <input type="submit" value="[% l('Log in') %]" class="opac-button" />
         </div>
         <input id="client_tz_id" name="client_tz" type="hidden" />
     </form>
index c4e7e25..f2d1bba 100644 (file)
@@ -105,7 +105,8 @@ function maybeToggleNumCopies(obj) {
             <label for="hold_usr_is_requestor_not">
                 [% l("Place hold for patron by barcode:") %]
             </label>
-            <input type="text" name="hold_usr" id="hold_usr_input" 
+            <input type="text" name="hold_usr" id="hold_usr_input"
+              aria-label="[% l('Barcode') %]"
               value="[% usr_barcode | html %]" 
               onchange="staff_hold_usr_barcode_changed();" 
               onpaste="setTimeout(staff_hold_usr_barcode_changed,1);" 
@@ -260,11 +261,13 @@ function maybeToggleNumCopies(obj) {
                 [% END %]
             </blockquote>
             <blockquote>
+                <label for="hold_suspend">
                 [% IF ctx.hold_data.size == 1;
                       l('Suspend this hold?');
                   ELSE;
                       l('Suspend these holds?');
                   END %]
+                </label>
                 <img src="[% ctx.media_prefix %]/images/question-mark.png[% ctx.cache_key %]"
                      alt="[% l('Suspend Hold Help') %]"
                      title="[% l('A suspended hold will retain its place in the queue, but will not be fulfilled until it has been activated.') %]" />
@@ -279,7 +282,7 @@ function maybeToggleNumCopies(obj) {
             </blockquote>
         </p>
         [% IF CGI.param('from_basket') %]
-          <blockquote><input type="checkbox" name="clear_cart">[% l('Clear basket after holds are requested?') %]</input></blockquote>
+          <blockquote><input type="checkbox" name="clear_cart" id="clear_cart" /><label for="clear_cart">[% l('Clear basket after holds are requested?') %]</label></blockquote>
         [% END %]
         <input id="place_hold_submit" type="submit" name="submit" 
             value="[% l('Submit') %]" title="[% l('Submit') %]"
index 63b4980..21652c4 100644 (file)
                                                 <input type="checkbox" id="select-[% rec.bre_id %]" name="selected_record"
                                                     [% IF is_selected %] checked="checked" [% END %]
                                                     title="[% l('Add to Basket') %]"
+                                                    aria-label="[% l('Add to Basket') %]"
                                                     class="result_record_selector hidden" value="[% rec.bre_id %]"></input>
                                                 [% END %]
                                                 [% result_count; result_count = result_count + 1 %].
index 0a6d5a9..95ba8ff 100644 (file)
@@ -17,8 +17,8 @@
         });
     END;
 %]
-[% IF NOT sms_carrier_hide_label; l('Mobile carrier:'); END; %]
-<select name="sms_carrier">
+[% IF NOT sms_carrier_hide_label; '<label for="sms_carrier">' _ l('Mobile carrier:') _ '</label>'; END; %]
+<select name="sms_carrier" id="sms_carrier" [% IF sms_carrier_hide_label; 'aria-label="' _ l('Mobile carrier') _ '"'; END; %]>
     <option value="">[% l('Please select your mobile carrier') %]</option>
     [% FOR carrier IN carriers.sort('name','region') -%]
     <option value='[% carrier.id | html %]'[%
index e8d7eb8..395b5a3 100644 (file)
@@ -1,4 +1,5 @@
-[% IF NOT sms_number_hide_label; l('Mobile number:'); END; %]
+[% IF NOT sms_number_hide_label; '<label for="sms_notify">' _ l('Mobile number:') _ '</label>'; END; %]
 <input type="text" name="sms_notify" [% setting = 'opac.default_sms_notify';
-IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/>
+IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]
+[% IF sms_number_hide_label; 'aria-label="' _ l('Mobile number') _ '"'; END; %] id="sms_notify" />
 [% IF NOT sms_number_hide_hint; l('Hint: use the full 10 digits of your phone #, no spaces, no dashes'); END; %]