LP#1268636 alt tags and cleanup continued
authorBill Erickson <berick@esilibrary.com>
Mon, 23 Dec 2013 16:39:50 +0000 (11:39 -0500)
committerBill Erickson <berick@esilibrary.com>
Tue, 11 Feb 2014 14:24:05 +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/parts/header.tt2
Open-ILS/src/templates/opac/parts/homesearch.tt2
Open-ILS/src/templates/opac/parts/record/awards.tt2
Open-ILS/src/templates/opac/parts/record/cnbrowse.tt2
Open-ILS/src/templates/opac/parts/record/copy_table.tt2
Open-ILS/src/templates/opac/parts/record/extras.tt2
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

index 9a2858c..1d93bc4 100644 (file)
     IF ENV.OILS_NOVELIST_URL;
         want_dojo = 1;
     END;
+
+    # Recommend max length for image alt text is 75 for screen
+    # reader support / WCAG compliance.  This macro trims the text 
+    # to this length and and produces a full alt="abc" attribute.
+    MACRO img_alt(text) BLOCK;
+        IF text.length >= 75;
+            text = text.substr(71, text.length, '...');
+        END;
+        text = text.replace('\s*$', ''); # remove trailing whitespace
+        HTML.attributes(alt => text);
+    END;
 %]
index 6987676..6fce85f 100644 (file)
@@ -1,4 +1,4 @@
 <div id="homesearch_main_logo">
     <img src="[% ctx.media_prefix %]/opac/images/main_logo.png" 
-      alt="[% l('Evergreen Logo') %]"/>
+        [% img_alt(l('Evergreen Logo')) %]/>
 </div>
index 915b0e0..d4460e8 100644 (file)
@@ -1,19 +1,18 @@
 <div class='rdetail_extras_div'> 
     <div style="margin-bottom:20px;"></div>
 
-        <!-- Chilifresh patron reviews -->
-        <strong>[% l('Patron Reviews:') %]</strong>
-        <div style="margin-bottom:20px;">
-            <span class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </span>
-            <div id="chili_review_[% attrs.isbn_clean | html %]" style="display: none;" align="center" width="100%"></div>
-        </div>
+    <!-- Chilifresh patron reviews -->
+    <strong>[% l('Patron Reviews:') %]</strong>
+    <div style="margin-bottom:20px;">
+        <span class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </span>
+        <div id="chili_review_[% attrs.isbn_clean | html %]" style="display: none;" align="center" width="100%"></div>
+    </div>
 
-        <!-- Novelist suggestions-->
-        [% IF ENV.OILS_NOVELIST_URL %] 
-            <div id='novelist-loading'>[% l('Loading...') %]</div>
-            <div data-novelist-novelistselect="[% attrs.isbn_clean || attrs.upc %]"></div>
-        [% END %]
+    <!-- Novelist suggestions-->
+    [% IF ENV.OILS_NOVELIST_URL %] 
+        <div id='novelist-loading'>[% l('Loading...') %]</div>
+        <div data-novelist-novelistselect="[% attrs.isbn_clean || attrs.upc %]"></div>
+    [% END %]
 
-    </div>
 </div>
 
index a00fbf0..51ef1ad 100644 (file)
             <thead>
                 <tr>
                     <td>
-                        <a class='classic_link' 
-                            href="[% mkurl('', {cnoffset => cnoffset - 1}) %]#cnbrowse"><b>[% l("&lt;&lt; Previous Page") %]</b></a>
+                        <a class='classic_link lbl1
+                            href="[% mkurl('', {cnoffset => cnoffset - 1}) %]#cnbrowse">[% l("&lt;&lt; Previous Page") %]</a>
                     </td>
                     <td colspan='1' align='center'>[% l("Shelf Browser") %]</td>
                     <td>
-                        <a class='classic_link' 
-                            href="[% mkurl('', {cnoffset => cnoffset + 1}) %]#cnbrowse"><b>[% l("Next Page &gt;&gt;") %]</b></a>
+                        <a class='classic_link lbl1
+                            href="[% mkurl('', {cnoffset => cnoffset + 1}) %]#cnbrowse">[% l("Next Page &gt;&gt;") %]</a>
                     </td>
                 </tr>
             </thead>
@@ -33,7 +33,8 @@
                         [%  rec_attrs = {marc_xml => cn.record.marc};
                             PROCESS get_marc_attrs args=rec_attrs; %]
                         <a href="[% mkurl(ctx.opac_root _ '/record/' _ cn.record.id, {$loc_name => loc_value}, 1) %]"><img height='60' width='50' 
-                            class='cn_browse_info' name='cn_browse_pic' border='0'
+                            class='cn_browse_info' name='cn_browse_pic' border='0' 
+                            [% img_alt(l('Go to record [_1]', rec_attrs.title)) %]
                             src="[% ctx.media_prefix %]/opac/extras/ac/jacket/small/r/[% cn.record.id | uri %]" /></a>
                         <div class='cn_browse_info bold' name='cn_browse_cn'>[% cn.label | html %]</div>
                         <div class='cn_browse_info'>
index f6ec522..b6576ca 100644 (file)
@@ -236,12 +236,12 @@ END; # FOREACH bib
                 [%- more_copies_limit = 50 %] [%# TODO: config %]
                 [%- IF  ctx.copy_limit != more_copies_limit AND copies.size >= ctx.copy_limit %]
                     <div class="rdetail_show_copies">
-                        <img src="[% ctx.media_prefix %]/images/plus_sign.png" />
+                        <img src="[% ctx.media_prefix %]/images/plus_sign.png" alt="[% l('Show more copies icon') %]"/>
                         <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]">[% l('Show more copies') %]</a>
                     </div>
                 [%- ELSIF ctx.copy_limit == more_copies_limit %]
                     <div  class="rdetail_show_copies">
-                        <img src="[% ctx.media_prefix %]/images/minus_sign.png" />
+                        <img src="[% ctx.media_prefix %]/images/minus_sign.png" alt="[% l('Show fewer copies icon') %]"/>
                         <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]">[% l('Show fewer copies') %]</a>
                     </div>
                 [%- END %]
index f4779b0..39baa41 100644 (file)
@@ -85,7 +85,7 @@
                         arrow = arrow_right;
                     END;
                 %]
-                <a name='[% name %]' href='[% href %]' class="rdetail_extras_lbl">[% arrow %] [% extra.label %]</a>
+                <a name='[% name %]' href='[% href %]' class="rdetail_extras_lbl">[% arrow %] [% extra.label | html %]</a>
             </div>
         </div>
         <div class='rdetail_extras_div'>
index c6e3b7c..cc23978 100644 (file)
@@ -46,8 +46,9 @@
             <div class="rdetail_aux_utils place_hold">
                 <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
                     {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]" 
-                class="no-dec"><img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" /><span 
-                class="place_hold">[% l('Place Hold') %]</span></a>
+                class="no-dec"><img src="[% ctx.media_prefix %]/images/green_check.png" 
+                    [% img_alt(l('Place Hold on [_1]', attrs.title)) %]/>
+                <span class="place_hold">[% l('Place Hold') %]</span></a>
             </div>
             [%- END -%]
             <div class="rdetail_aux_utils toggle_list">
@@ -65,7 +66,7 @@
             [% END %]
             </div>
             <div class="rdetail_aux_utils">
-                <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
+                <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="[% l('Print / Email Actions Image') %]" />
                 <a href="[% mkurl(ctx.opac_root _ '/record/print/' _ ctx.bre_id) %]" class="no-dec">[% l('Print') %]</a> /
                 <a href="[% mkurl(ctx.opac_root _ '/record/email/' _ ctx.bre_id) %]" class="no-dec">[% l('Email') %]</a>
             </div>
index 5faed1d..7c71576 100644 (file)
                                             <td class='result_table_title_cell' name='result_table_title_cell'>
                                                <div class="result_metadata">
                                                     <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% rec.id %]'></abbr>
-                                                    <a class='record_title' name='record_[% rec.id %]' name='item_title'
+                                                    <a class='record_title search_link' name='record_[% rec.id %]'
                                                         href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
                                                         [% HTML.attributes(title => l('Display record details for "[_1]"', attrs.title)) %]
-                                                        class='search_link'>[% attrs.title | html %]</a>
+                                                        >[% attrs.title | html %]</a>
 [%-
 FOR entry IN attrs.graphic_titles;
     FOR alt IN entry.graphic;
@@ -330,7 +330,7 @@ END;
                                                                 href="[% ctx.ext_proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
                                                                     ENV.OILS_CONTENT_CAFE_USER %]&amp;Password=[%-
                                                                     ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&amp;Options=Y">
-                                                                <img src='[% ctx.media_prefix %]/images/starz.png' alt="[% l('Ratings Stars') %]"/> 
+                                                                <img src='[% ctx.media_prefix %]/images/starz.png' alt="[% l('Ratings Icon') %]"/> 
                                                                 <span class="results_reviews">[% l('Reviews &amp; More') %]</span>
                                                             </a>
                                                         </div>