Adds B4 Book Log icon and link to KPAC search results page and
authorTerran McCanna <tmccanna@georgialibraries.org>
Tue, 26 May 2015 13:09:27 +0000 (09:09 -0400)
committerTerran McCanna <tmccanna@georgialibraries.org>
Tue, 26 May 2015 13:09:27 +0000 (09:09 -0400)
KPAC item details page.

(This is a PINES-only customization.)

Open-ILS/src/templates/kpac/parts/record_row.tt2
Open-ILS/src/templates/kpac/record.tt2

index 38c39ad..feef90e 100644 (file)
             [% l('[_1], [_2]', attrs.publisher, attrs.pubdate) | html %] <!-- TODO fix commas, etc. -->
             [% IF attrs.phys_desc %]<br/>[% attrs.phys_desc | html; END %]
         </div>
+               
+        [%- IF attrs.format_label %]
+            [% FOR format IN attrs.all_formats %]
+                       <div class="item_icon_wrapper">
+                               <div class="item_icon">
+                                   <img title="[% format.label | html %]" 
+                    alt="[% format.label | html %]" 
+                    src="[% format.icon %]" /><br/>
+                    [% format.label | html %]
+                               </div>
+                       </div>
+            [% END %]
+                       
+                       <!-- link to add to b4 book log -->
+                       <div class="item_icon_wrapper">
+                               <div class="item_icon">
+                                       <script type="text/javascript">
+                                               var a = escape("[% attrs.title %]");
+                                               var b = escape("[% attrs.author %]");
+                                               var b4link = "http://b4.georgialibraries.org/cat_add.php?title=" + a + "&author=" + b;
+                                               document.write("<a href='" + b4link + "'>");
+                                       </script>
+                                       <img src="[% ctx.media_prefix %]/images/kpac/b4only.png" alt="Add to B4 Book Log" /><br/>
+                                       Add to B4<br/>Book Log</a>
+                               </div>  
+                       </div>  
+                       
+                   <div class="clear">&nbsp;</div>
+           [% END %]
+       
         [% IF show_actions %]
         <div class="item_detail_actions">
             <div class="button"><a href="[% mkurl(ctx.kpac_root _ '/record/' _ rec_id) %]"><img 
         </div>
         [% END %]
     </div>
-    <div class="item_icon_wrapper">
-        <div class="item_icon">
-            &nbsp;<img width="35" alt="[% attrs.format_label %]" src="[% attrs.format_icon %]" />&nbsp; 
-            <!-- put a single &nbsp; around each side of the image - for vertical centering -->
-        </div>
-        <div class="item_icon_type_text">[% attrs.format_label %]</div>
-    </div>
     <div class="clear">&nbsp;</div>
 </div>
 
index 514c45f..1b28d94 100644 (file)
@@ -4,7 +4,7 @@
     WRAPPER "kpac/parts/subpage.tt2";
     attrs = {marc_xml => ctx.marc_xml};
     PROCESS get_marc_attrs args=attrs;
-    ctx.page_title = attrs.title | html 
+    ctx.page_title = attrs.title | html
 %]
 
 <div class="item_detail_header">
         <div class="item_detail_name">[% attrs.title | html %]</div>
         <div class="item_detail_author">[% l('by [_1]', attrs.author) | html %]</div>
         <div class="item_detail_icon_rate">
-            <div class="item_icon_wrapper">
-                <div class="item_icon">
-                    &nbsp;<img width="35" alt="[% attrs.format_label %]" src="[% attrs.format_icon %]" />&nbsp; 
-                    <!-- put a single &nbsp; around each side of the image - for vertical centering -->
-                </div>
-                <div class="item_icon_type_text">[% attrs.format_label %]</div>
-            </div>
+            
 
             <div class="item_detail_rate_wrapper">
                 <div class="item_detail_rate_starts">
                 </div>
             </div>
             <div class="clear">&nbsp;</div>
+
+            [%- IF attrs.format_label %]
+                [% FOR format IN attrs.all_formats %]
+                                   <div class="item_icon_wrapper">
+                                       <div class="item_icon">
+                                           <img title="[% format.label | html %]" 
+                            alt="[% format.label | html %]" 
+                            src="[% format.icon %]" /><br/>
+                            [% format.label | html %]
+                                           </div>
+                                       </div>
+                [% END %]
+            [% END %]
+                           <!-- link to add to b4 book log -->
+                           <div class="item_icon_wrapper">
+                               <div class="item_icon">
+                                       <script type="text/javascript">
+                                                       var a = escape("[% attrs.title %]");
+                                                       var b = escape("[% attrs.author %]");
+                                                       var b4link = "http://b4.georgialibraries.org/cat_add.php?title=" + a + "&author=" + b;
+                                                       document.write("<a href='" + b4link + "'>");
+                                               </script>
+                                               <img src="[% ctx.media_prefix %]/images/kpac/b4only.png" alt="Add to B4 Book Log" /><br/>
+                                               Add to B4<br/>Book Log</a>
+                                   </div>
+                           </div>
+            </div>
         </div>
     </div>