Retrieve AC jackets by record ID collab/bshum/syndetics-by-id
authorJeff Godin <jgodin@tadl.org>
Wed, 25 Jul 2012 18:02:00 +0000 (14:02 -0400)
committerBen Shum <bshum@biblio.org>
Wed, 12 Dec 2012 15:50:37 +0000 (10:50 -0500)
Retrieve AC jackets by record ID. Breaks unless your server-side handler and AC
module have been taught how to use AC by record ID.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Add onerror handler to hide broken jacket images

Use an onerror handler to hide broken jacket images, for those cases
where we receive a 404 instead of a 1x1 placeholder.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Include jacket image even if we lack an ISBN/UPC

Conditional output of the jacket image <img> tag breaks local added
content overrides by record ID. Make the inclusion of the jacket
image unconditional.  We may next want to include onerror handlers
to hide the element if it 404s.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/templates/opac/parts/record/cnbrowse.tt2
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

index 661c132..d250ea1 100644 (file)
@@ -36,7 +36,8 @@
                             IF ident %]
                         <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'
-                            src="[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident | uri %]" /></a>
+                            onerror='this.style.display="none";'
+                            src="[% ctx.media_prefix %]/opac/extras/ac/jacket/small/r/[% cn.record.id | uri %]" /></a>
                         [% END %]
                         <div class='cn_browse_info bold' name='cn_browse_cn'>[% cn.label | html %]</div>
                         <div class='cn_browse_info'>
index a5767a1..0cfe721 100644 (file)
 [%-# This holds the record summary information %]
 <div id="rdetail_summary_header">
     <div id="rdetail_image_div">
-        [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
-        <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/[% ident | uri %]'><img
+        <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/r/[% ctx.bre_id | uri %]'><img
             alt="[% l('Image of item') %]" id='rdetail_image'
-            src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/[% ident | uri %]' /></a>
-        [% END %]
+            onerror="this.style.display='none';"
+            src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' /></a>
         <br />
     </div>
 
index b63ec88..15a7b1f 100644 (file)
                                                     result_count; result_count = result_count + 1
                                                 %].</td>
                                             <td class='result_table_pic_header'>
-                                                [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
+                                                [% ident = attrs.isbn_clean || attrs.upc; %]
                                                 <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"><img alt="[% l('Image of item') %]"
                                                         name='item_jacket' class='result_table_pic' width="55"
-                                                        src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident | uri %]' /></a><br />
-                                                [% END %]
+                                                        onerror='this.style.display="none";'
+                                                        src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/r/[% rec.id | uri %]' /></a><br />
                                             </td>
                                             <td class='result_table_title_cell' name='result_table_title_cell'>
                                                 <div class="bold">