LP#1268636 avoid empty <ul>'s in browse
authorBill Erickson <berick@esilibrary.com>
Mon, 30 Dec 2013 21:14:19 +0000 (16:14 -0500)
committerBill Erickson <berick@esilibrary.com>
Tue, 11 Feb 2014 14:24:06 +0000 (09:24 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/templates/opac/browse.tt2
Open-ILS/src/templates/opac/parts/advanced/expert.tt2
Open-ILS/src/templates/opac/parts/advanced/numeric.tt2

index 9e48c92..9e7b91f 100644 (file)
                         [% l('Browse for [_1] starting with [_2] in [_3]', control_qtype, control_bterm, control_locg) %]
 
                        <input id='search-submit-go' type="submit" value="[% l('Browse') %]" alt="[% l('Browse') %]" class="opac-button"/>
-                        <img id="browse-submit-spinner" src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif" class="hidden" style="width: 16px; height: 16px;" alt="" />
+                        <img id="browse-submit-spinner" 
+                        src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif" 
+                        class="hidden" style="width: 16px; height: 16px;" 
+                        alt="[% l('Search in progress icon') %]" />
                     </form>
                 </div>
 
                     <a class="opac-button" href="[% mkurl('', {bpivot => ctx.forward_pivot}) %]" onclick="$('browse-pager-spinner-[% id %]').className = '';">[%l ('Next') %] &rarr;</a>
                     [% END %]
 
-                    <img id="browse-pager-spinner-[% id %]" src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif" class="hidden" style="width: 16px; height: 16px;" alt="" />
+                    <img id="browse-pager-spinner-[% id %]" 
+                        src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif" 
+                        class="hidden" style="width: 16px; height: 16px;" 
+                        alt="[% l('Search in progress icon') %]" />
                 </div>
                 [% END %]
 
                                 [% END %]
                             </span>
 
-                            <ul class="browse-result-authority-headings">
+                            [% auth_headings_ul_added = 0 %];
                                 [% seenit = {}; # for headings we've rendered
                                    FOR a IN result.sees;
                                     PROCESS authority_notes authority=a;
                                             # defined when h.target is.
 
                                             IF h.target AND h.target_count AND result.list_authorities.grep('^' _ h.target _ '$').size == 0;
-                                                id = h.target; NEXT IF seenit.$id; seenit.$id = 1; %]
+                                                id = h.target; NEXT IF seenit.$id; seenit.$id = 1; 
+                                                IF !auth_headings_ul_added;
+                                                    # only add a <ul> if we have at least one <li> (WCAG 2.0)
+                                                    auth_headings_ul_added = 1; %]
+                                                <ul class="browse-result-authority-headings"> 
+                                                [% END %]
+
                                                 <li><span class="browse-result-authority-field-name">[% field.name %]</span>
                                                 <a href="[% mkurl(ctx.opac_root _ '/browse', {bterm => h.heading}, ['bpivot']) %]">[% h.heading | html %]</a>
                                                 <span class="browse-result-authority-bib-links">([% h.target_count %])</span>
                                             # defined when h.target is.
 
                                             IF h.target AND h.target_count AND result.list_sees.grep('^' _ h.target _ '$').size == 0 AND !h.main_entry;
-                                                id = h.target; NEXT IF seenit.$id; seenit.$id = 1; %]
+                                                id = h.target; NEXT IF seenit.$id; seenit.$id = 1; 
+                                                IF !auth_headings_ul_added;
+                                                    # only add a <ul> if we have at least one <li> (WCAG 2.0)
+                                                    auth_headings_ul_added = 1; %]
+                                                <ul class="browse-result-authority-headings"> 
+                                                [% END %]
                                                 <li><span class="browse-result-authority-field-name">[% field.name %]</span>
                                                 <a href="[% mkurl(ctx.opac_root _ '/results', {query => 'identifier|authority_id[' _ h.target _ ']'}) %]">[% h.heading | html %]</a>
                                                 <span class="browse-result-authority-bib-links">([% h.target_count %])</span>
                                         [% END %]
                                     [% END %]
                                 [% END %]
-                            </ul>
+                            [% IF auth_headings_ul_added %]</ul>[% END %]
                         </li>
                     [% END %]
                     </ul>
index 5212209..8b8849d 100644 (file)
                 <td>
                     <a href="javascript:;" class="row-remover"
                         title="[% l('Remove row') %]" alt="[% l('Remove row') %]"
-                        onclick='return killRowIfAtLeast(1, this);'><img src="[% ctx.media_prefix %]/images/adv_row_close_btn.png" /></a>
+                        onclick='return killRowIfAtLeast(1, this);'>
+                        <img src="[% ctx.media_prefix %]/images/adv_row_close_btn.png" 
+                            alt="[% l('Remove Search Row') %]"/>
+                    </a>
                 </td>
             </tr>
         </tbody>
index 9e27156..4fa45f1 100644 (file)
@@ -14,7 +14,6 @@
                     <option value="identifier|tcn">[% l('TCN') %]</option>
                     <option value="item_barcode">[% l('Item Barcode') %]</option>
                 </select>
-                </label>
        
                 <input type="text" name="query" size="16" autofocus placeholder='[% l("Identifier") %]' />
            <br/>