Show format icons in results and record detail pages
authorsenator <lebbeous@esilibrary.com>
Tue, 22 Mar 2011 22:00:11 +0000 (18:00 -0400)
committersenator <lebbeous@esilibrary.com>
Tue, 22 Mar 2011 22:05:06 +0000 (18:05 -0400)
Open-ILS/web/css/skin/default/opac/style.css
Open-ILS/web/templates/default/opac/parts/header.tt2
Open-ILS/web/templates/default/opac/parts/marc_misc.tt2
Open-ILS/web/templates/default/opac/parts/record/summary.tt2
Open-ILS/web/templates/default/opac/parts/result/table.tt2

index 33040f4..5d402f9 100644 (file)
@@ -967,3 +967,4 @@ a.dash-link:hover { text-decoration: underline !important; }
     border-bottom: 1px dotted #666;
 }
 .list-create-table-buttons input[type=image] { margin-top: 2px; }
+.result_table_format_cell { padding: 0px 10px; text-align: center; }
index aa34ab5..10788fa 100644 (file)
     is_advanced = CGI.param("_adv").size;
 
     formats = [  # XXX KCLS-specific
-        {'code' => 'a', 'name' => 'Book', 'image' => 'media_book.jpg'},
-        {'code' => 'i', 'name' => 'Book on cassette', 'image' => 'media_bookoncasset.jpg'},
-        {'code' => 'n', 'name' => 'Book on CD', 'image' => 'media_bookoncd.jpg'},
+        {'code' => 'a', 'name' => 'Book', 'image' => 'media_book.png'},
+        {'code' => 'i', 'name' => 'Book on cassette', 'image' => 'media_bookoncassette.png'},
+        {'code' => 'n', 'name' => 'Book on CD', 'image' => 'media_bookoncd.png'},
         {'code' => 'x', 'name' => 'Download music', 'image' => 'media_downloadmusic.jpg'},
         {'code' => 'y', 'name' => 'Download video', 'image' => 'media_downloadvideo.jpg'},
         {'code' => 'h', 'name' => 'DVD', 'image' => 'media_dvd.jpg'},
-        {'code' => 'w', 'name' => 'eBook - Audio', 'image' => 'media_eaudio.jpg'},
-        {'code' => 'v', 'name' => 'eBook - Text', 'image' => 'media_ebooktext.jpg'},
-        {'code' => 'e', 'name' => 'Equipment', 'image' => 'media_equipment.jpg'},
-        {'code' => 'f', 'name' => 'Films', 'image' => 'media_films.jpg'},
+        {'code' => 'w', 'name' => 'eBook - Audio', 'image' => 'media_eaudio.png'},
+        {'code' => 'v', 'name' => 'eBook - Text', 'image' => 'media_ebooktext.png'},
+        {'code' => 'e', 'name' => 'Equipment', 'image' => 'media_equipment.png'},
+        {'code' => 'f', 'name' => 'Films', 'image' => 'media_films.png'},
         {'code' => 'o', 'name' => 'Kit', 'image' => 'media_kit.jpg'},
         {'code' => 'q', 'name' => 'Large print', 'image' => 'media_largeprint.jpg'},
-        {'code' => 'b', 'name' => 'Magazine', 'image' => 'media_magazines.jpg'},
+        {'code' => 'b', 'name' => 'Magazine', 'image' => 'media_magazines.png'},
         {'code' => 'd', 'name' => 'Microform', 'image' => 'media_microform.jpg'},
         {'code' => 'k', 'name' => 'Music cassette', 'image' => 'media_musiccassette.jpg'},
-        {'code' => 'j', 'name' => 'Music CD', 'image' => 'media_musiccd.jpg'},
-        {'code' => 'l', 'name' => 'Music LP', 'image' => 'media_musicrecord.jpg'},
+        {'code' => 'j', 'name' => 'Music CD', 'image' => 'media_musiccd.png'},
+        {'code' => 'l', 'name' => 'Music LP', 'image' => 'media_musicrecord.png'},
         {'code' => 'p', 'name' => 'Newspaper', 'image' => 'media_newspaper.jpg'},
         {'code' => 't', 'name' => 'Online', 'image' => 'media_online.jpg'},
         {'code' => 'u', 'name' => 'Player', 'image' => 'media_eaudio.jpg'},
         {'code' => 'c', 'name' => 'Printed music / scores', 'image' => 'media_printedmusic.jpg'},
-        {'code' => '2', 'name' => 'Read along with cassette', 'image' => 'media_cassettewithbook.jpg'},
-        {'code' => '5', 'name' => 'Read along with CD', 'image' => 'media_cdwithbook.jpg'},
+        {'code' => '2', 'name' => 'Read along with cassette', 'image' => 'media_cassettewithbook.png'},
+        {'code' => '5', 'name' => 'Read along with CD', 'image' => 'media_cdwithbook.png'},
         {'code' => 'm', 'name' => 'Software', 'image' => 'media_software.jpg'},
-        {'code' => 'g', 'name' => 'Video', 'image' => ''},
+        {'code' => 'g', 'name' => 'Video', 'image' => 'media_films.png'},
         {'code' => 'r', 'name' => '3-D Object', 'image' => 'media_3dobject.jpg'},
         {'code' => 'z', 'name' => 'Map', 'image' => 'media_map.jpg'},
         {'code' => 's', 'name' => 'Slide set', 'image' => 'media_slide.jpg'}
index 8f56196..8c1c4a7 100644 (file)
@@ -26,8 +26,8 @@
         # KCLS-specific stuff; needs to change
         args.mattype = xml.findnodes('//*[@tag="998"]/*[@code="d"]').textContent;
         args.kcls_cn = xml.findnodes('//*[@tag="092" or @tag="099"]/*').textContent;
-        mattype = attrs.mattype;
+        mattype = args.mattype;
         args.format = ctx.find_citm(mattype).value;
-        args.format_icon = icon_by_mattype.$mattype;
+        args.format_icon = icon_by_format.$mattype;
     END;
 %]
index f151888..c60c248 100644 (file)
                                     </div>
                                 </div>
                                 <div style="float:right;margin-right:17px;">
-                                    <img id="rdetail_tor_pic" alt="[% l('Format') %]" class="hide_me" src="" />
+                                    [% IF attrs.format %]
+                                    <img alt="[% attrs.format %]"
+                                        src="[% ctx.media_prefix %]/images/[% attrs.format_icon %]" />
+                                    [% END %]
                                 </div>
                             </div>
                         </td>
                                 <strong id="rdetail_ed_lbl">[% IF attrs.edition; l("Edition"); END %]</strong>
                             </td>
                             <td valign="top" id='rdetail_edition'>[% attrs.edition %]</td>
-                            <td nowrap='nowrap' valign="top">
-                                <strong id="rdetail_form_lbl">[% IF attrs.format; l("Format"); END %]</strong>
-                            </td>
-                            <td valign="top">
-                                [% IF attrs.format %]
-                                <img alt="[% l('Format') %]" class='tor_pic'
-                                    title="[% attrs.format %]"
-                                    src="[% ctx.media_prefix _ '/images/' _ attrs.format_icon %]" />
-                                [%  END %]
-                            </td>
                         </tr>
                         <tr>
                             <td nowrap='nowrap' valign="top">
index 90b2548..6dfb7b8 100644 (file)
                                             <td nowrap='nowrap' name="copy_count_cell"
                                                 class='copy_count_cell hide_me' width="1"> </td>
                                             <td name='result_table_format_cell'
-                                                class='result_table_format_cell' align="center" width="1"
-                                                style="padding:0px 10px;">
-                                                <img alt="Format" src="" class="hide_me" name="" />
+                                                class='result_table_format_cell' width="1">
+                                                [% IF attrs.format %]
+                                                <img alt="[% attrs.format %]" src="[% ctx.media_prefix %]/images/[% attrs.format_icon %]" />
+                                                [% END %]
                                                 <span class='hide_me opac-auto-031'>
                                                     <span>[% l("Match Score: ") %] </span>
                                                     <span name='relevancy_span'> </span>