kpac : record details
authorBill Erickson <berick@esilibrary.com>
Thu, 26 Jan 2012 23:05:46 +0000 (18:05 -0500)
committerMike Rylander <mrylander@gmail.com>
Mon, 30 Jul 2012 19:00:44 +0000 (15:00 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Conflicts:
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm
Open-ILS/src/templates/kpac/detailed.tt2
Open-ILS/src/templates/kpac/parts/breadcrumb.tt2
Open-ILS/src/templates/kpac/parts/searchbox.tt2
Open-ILS/src/templates/kpac/search_results.tt2

index 67e6369..bd5a22e 100644 (file)
@@ -15,6 +15,7 @@ our $ac_types = ['toc',  'anotes', 'excerpt', 'summary', 'reviews'];
 #   record : bre object
 sub load_record {
     my $self = shift;
+    my %kwargs = @_;
     my $ctx = $self->ctx;
     $ctx->{page} = 'record';  
 
@@ -46,7 +47,7 @@ sub load_record {
     }
     $self->timelog("past staff saved searches");
 
-    $self->fetch_related_search_info($rec_id);
+    $self->fetch_related_search_info($rec_id) unless $kwargs{no_search};
     $self->timelog("past related search info");
 
     # Check for user and load lists and prefs
index 266c821..f6fb060 100644 (file)
@@ -34,7 +34,7 @@ sub load {
     return $self->load_rresults if $path =~ m|kpac/search_results|; # inherited from tpac
 
     # note: sets page=record
-    return $self->load_simple("detailed") if $path =~ m|kpac/detailed|;
+    return $self->load_record(no_search => 1) if $path =~ m|kpac/detailed|;
 
     # ----------------------------------------------------------------
     #  Everything below here requires SSL
index 3af5b49..478e5b3 100644 (file)
-[%  PROCESS "opac/parts/header.tt2";
-    PROCESS "kpac/parts/grid.tt2";
+[%  
+    PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2"; # MARC 
     WRAPPER "kpac/parts/subpage.tt2";
-    ctx.page_title = l('Item Details') %]
+    attrs = {marc_xml => ctx.marc_xml};
+    PROCESS get_marc_attrs args=attrs;
+    ctx.page_title = attrs.title | html 
+%]
 
   <!-- did somebody order the div salad? -->
 <div class="item_detail_header">
-    <div class="item_detail_image"><a href="javascript:;"><img alt="item image" src="[% ctx.media_prefix %]/images/kpac/item_image.jpg" /></a></div>
-    
+
+    <div class="item_detail_image">
+        [%  ident = attrs.isbn_clean || attrs.upc; 
+            href = ctx.media_prefix _ '/images/kpac/item_image.jpg';
+            IF ident; href = ctx.media_prefix _ '/opac/extras/ac/jacket/medium/' _ ident; END %]
+         <a href="[% href | url %]"><img 
+            alt="[% l('Image of item') %]" width="167" src='[% href | url %]' /></a><br />
+    </div>
+
     <div class="item_detail_info">
-      <div class="item_detail_name">Book Name</div>
-      <div class="item_detail_author">by Author Name</div>
-      <div class="item_detail_icon_rate">
-        <div class="item_icon_wrapper">
-          <div class="item_icon">&nbsp;<img alt="book" src="[% ctx.media_prefix %]/images/kpac/icon_book.png" />&nbsp; <!-- put a single &nbsp; around each side of the image - for vertical centering --></div>
-          <div class="item_icon_type_text">Book</div>
-        </div>
-        
-        <div class="item_detail_rate_wrapper">
-          <div class="item_detail_rate_starts"><img alt="rating" src="[% ctx.media_prefix %]/images/kpac/stars!.png" /></div>
-          <div class="item_detail_rate_link"><a href="javascript:;">Rate this</a></div>
-          <div class="clear">&nbsp;</div>
-          <div class="item_detail_cn_wrapper">
-            <div class="item_detail_callnumber">Call Number</div>
-            <div class="item_detail_extra_info">Publisher, Year, Size</div>
-          </div>
+        <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">
+                <!-- TODO chilifresh, etc. -->
+                <div class="item_detail_rate_starts"><img alt="rating" src="[% ctx.media_prefix %]/images/kpac/stars!.png" /></div>
+                <div class="item_detail_rate_link"><a href="javascript:;">Rate this</a></div>
+                <div class="clear">&nbsp;</div>
+
+                <div class="item_detail_cn_wrapper">
+                    <div class="item_detail_callnumber">[% attrs.holdings.0.label | html %]</div>
+                    <div class="item_detail_extra_info">
+                        [% l('[_1], [_2]', attrs.publisher, attrs.pubdate) | html %] <!-- TODO fix commas, etc. -->
+                        [% IF attrs.phys_desc %]<br/>[% attrs.phys_desc | html; END %]
+                    </div>
+                </div>
+            </div>
+            <div class="clear">&nbsp;</div>
         </div>
-        <div class="clear">&nbsp;</div>
-      </div>
     </div>
+
     <div class="item_detail_header_buttons">
-      <div class="item_detail_getit_btn"><a href=""><img alt="get it" src="[% ctx.media_prefix %]/images/kpac/get_it_btn.png" /></a></div>
-      <div class="item_detail_goback_btn"><a href=""><img alt="go back" src="[% ctx.media_prefix %]/images/kpac/go_back_btn.png" /></a></div>
+        <div class="item_detail_getit_btn"><a href="[% mkurl(ctx.kpac_root _ '/checkout') %]"><img 
+            alt="[% l('Get it') | html %]" src="[% ctx.media_prefix %]/images/kpac/get_it_btn.png" /></a>
+        </div>
+        <div class="item_detail_goback_btn">
+            <a href="[% mkurl(ctx.kpac_root _ '/search_results') %]"><img 
+                alt="[% l('Go Back') | html %]" src="[% ctx.media_prefix %]/images/kpac/go_back_btn.png" /></a>
+        </div>
     </div>
     <div class="clear">&nbsp;</div>
-  </div>
-  <div class="sub_header">You can find this item at these locations:</div>
-  <div class="item_detail_location_wrapper">
-    <table cellpadding="0" cellspacing="0" border="0" class="item_location_table">
-      <tbody>
-        <tr class="header">
-          <td class="location">Location</td>
-          <td class="loc_info">&nbsp;</td>
-          <td class="status">Status</td>
-          <td class="callnumber">Call Number</td>
-        </tr>
-        <tr>
-          <td class="location">Bellevue Library</td>
-          <td class="loc_info"><a href="javascript:;">View Library Info</a></td>
-          <td class="status">Check Shelf</td>
-          <td class="callnumber">J613.71 CRE</td>
-        </tr>
-        <tr class="gray">
-          <td class="location">Burien Library</td>
-          <td class="loc_info"><a href="javascript:;">View Library Info</a></td>
-          <td class="status">Check Shelf</td>
-          <td class="callnumber">J613.71 CRE</td>
-        </tr>
-        <tr>
-          <td class="location">Newport Library</td>
-          <td class="loc_info"><a href="javascript:;">View Library Info</a></td>
-          <td class="status">Due: 03-13-10</td>
-          <td class="callnumber">J613.71 CRE</td>
-        </tr>
-        <tr class="gray">
-          <td class="location">Redmond Library</td>
-          <td class="loc_info"><a href="javascript:;">View Library Info</a></td>
-          <td class="status">Check Shelf</td>
-          <td class="callnumber">J613.71 CRE</td>
-        </tr>
-      </tbody>
-    </table>
-  </div>
-  <div class="sub_header">About this item:</div>
-  <div class="item_detail_desc">
-    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam <a href="javascript:;">nonummy</a> nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit</p>
-  </div>
-  <div class="item_detail_extras_tabs">
-    <a href="javascript:;">Reviews</a>
-    <div class="selected">Rate this Item</div>
-    <a href="javascript:;">About the Author</a>
-    <div class="clear">&nbsp;</div>
-  </div>
-  <div class="item_detail_rating_top">
-    <table cellpadding="0" cellspacing="0" border="0" class="item_avg_rate_table"><tr>
-      <td class="avg_rate">Average Rating</td>
-      <td class="stars"><img alt="rating" src="[% ctx.media_prefix %]/images/kpac/stars!.png" /></td>
-      <td class="total_rates">out of 132 reviews</td>
-    </tr></table>
-    <div class="clear">&nbsp;</div>
-  </div>
-  <div class="item_detail_rating">
+</div>
+
+<div class="sub_header">You can find this item at these locations:</div>
+    <div class="item_detail_location_wrapper">
+        <table cellpadding="0" cellspacing="0" border="0" class="item_location_table">
+            <tbody>
+                <tr class="header">
+                    <td class="location">Location</td>
+                    <td class="loc_info">&nbsp;</td>
+                    <td class="status">Status</td>
+                    <td class="callnumber">Call Number</td>
+                </tr>
+                <tr>
+                    <td class="location">Bellevue Library</td>
+                    <td class="loc_info"><a href="javascript:;">View Library Info</a></td>
+                    <td class="status">Check Shelf</td>
+                    <td class="callnumber">J613.71 CRE</td>
+                </tr>
+            </tbody>
+        </table>
+    </div>
+    <div class="sub_header">About this item:</div>
+    <div class="item_detail_desc">
+        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam <a href="javascript:;">nonummy</a> nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit</p>
+    </div>
+
+    <div class="item_detail_extras_tabs">
+        <a href="javascript:;">Reviews</a>
+        <div class="selected">Rate this Item</div>
+        <a href="javascript:;">About the Author</a>
+        <div class="clear">&nbsp;</div>
+    </div>
+
+    <div class="item_detail_rating_top">
+        <table cellpadding="0" cellspacing="0" border="0" class="item_avg_rate_table">
+            <tr>
+                <td class="avg_rate">Average Rating</td>
+                <td class="stars"><img alt="rating" src="[% ctx.media_prefix %]/images/kpac/stars!.png" /></td>
+                <td class="total_rates">out of 132 reviews</td>
+            </tr>
+        </table>
+        <div class="clear">&nbsp;</div>
+    </div>
+
+<div class="item_detail_rating">
     <div class="review_box_top">&nbsp;</div>
     <div class="review_box_body">
-      <div class="input_boxes">
-        <table cellpadding="0" cellspacing="0" border="0"><tr>
-          <td class="review_name_cell"><input type="text" class="review_name" style="color:#aaa;" value=" Name " onfocus="if(this.value==' Name '){this.value='';this.style.color='#424242';}" onblur="if(this.value==''){this.value=' Name '; this.style.color='#aaa';}" /></td>
-          <td class="review_email_cell"><input type="text" class="review_email" style="color:#aaa;" value=" Email Address " onfocus="if(this.value==' Email Address '){this.value='';this.style.color='#424242';}" onblur="if(this.value==''){this.value=' Email Address '; this.style.color='#aaa';}" /></td>
-          <td class="rating_msg_box">Your email address will not<br />be displayed to other users.</td>
-        </tr></table>
-      </div>
-      <div class="item_detail_rating2">
-        <table cellpadding="0" cellspacing="0" border="0" class="item_avg_rate_table2"><tr>
-          <td class="rate">Rating</td>
-          <td class="stars"><img alt="rating" src="[% ctx.media_prefix %]/images/kpac/stars!_gray.png" /></td>
-          <td class="scale">1 = Poor, 5 = Awesome</td>
-        </tr></table>
-        
-      </div>
-      <div class="review_comment_box"><textarea class="review_comment" style="color:#aaa;" onfocus="if(this.value==' Write the reasons for your rating here. '){this.value='';this.style.color='#424242';}" onblur="if(this.value==''){this.value=' Write the reasons for your rating here. '; this.style.color='#aaa';}"> Write the reasons for your rating here. </textarea></div>
-      <div class="clear">&nbsp;</div>
+        <div class="input_boxes">
+            <table cellpadding="0" cellspacing="0" border="0">
+                <tr>
+                    <td class="review_name_cell"><input type="text" class="review_name" style="color:#aaa;" value=" Name " onfocus="if(this.value==' Name '){this.value='';this.style.color='#424242';}" onblur="if(this.value==''){this.value=' Name '; this.style.color='#aaa';}" /></td>
+                    <td class="review_email_cell"><input type="text" class="review_email" style="color:#aaa;" value=" Email Address " onfocus="if(this.value==' Email Address '){this.value='';this.style.color='#424242';}" onblur="if(this.value==''){this.value=' Email Address '; this.style.color='#aaa';}" /></td>
+                    <td class="rating_msg_box">Your email address will not<br />be displayed to other users.</td>
+                </tr>
+            </table>
+        </div>
+        <div class="item_detail_rating2">
+            <table cellpadding="0" cellspacing="0" border="0" class="item_avg_rate_table2"><tr>
+                    <td class="rate">Rating</td>
+                    <td class="stars"><img alt="rating" src="[% ctx.media_prefix %]/images/kpac/stars!_gray.png" /></td>
+                    <td class="scale">1 = Poor, 5 = Awesome</td>
+                </tr>
+            </table>
+        </div>
+        <div class="review_comment_box"><textarea class="review_comment" style="color:#aaa;" onfocus="if(this.value==' Write the reasons for your rating here. '){this.value='';this.style.color='#424242';}" onblur="if(this.value==''){this.value=' Write the reasons for your rating here. '; this.style.color='#aaa';}"> Write the reasons for your rating here. </textarea></div>
+        <div class="clear">&nbsp;</div>
     </div>
     <div class="review_submit_box"><a href="javascript:;"><img alt="submit review" src="[% ctx.media_prefix %]/images/kpac/review_submit_btn.png" /></a></div>
-  </div>
+</div>
   
-  <div class="sub_navigation1">
-    <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr>
-      <td><a href="javascript:;"><img src="[% ctx.media_prefix %]/images/kpac/go_back_btn.png" /></a></td>
-      <td width="100%" class="nav_mid_bg"></td>
-      <td class="to_top_btn"><a href="javascript:;"><img src="[% ctx.media_prefix %]/images/kpac/to_top_btn.png" /></a></td>
-    </tr></table>
+<div class="sub_navigation1">
+    <table cellpadding="0" cellspacing="0" border="0" width="100%">
+        <tr>
+            <td><a href="javascript:;"><img src="[% ctx.media_prefix %]/images/kpac/go_back_btn.png" /></a></td>
+            <td width="100%" class="nav_mid_bg"></td>
+            <td class="to_top_btn"><a href="javascript:;"><img src="[% ctx.media_prefix %]/images/kpac/to_top_btn.png" /></a></td>
+        </tr>
+    </table>
 </div>
   
 [% END %]
index 4fa27cc..8f59e24 100644 (file)
 
             <!-- record title -->
             <div class="bread_green_mid">&nbsp;</div>
-            <a href="javascript:;">book name</a>
+            [%  title = '';
+                IF attrs AND attrs.title;
+                    title = attrs.title.substr(15, -1, '...');
+                END
+            %]
+            <a href="javascript:;">[% title | html %]</a>
 
             <!-- Get it -->
             <div class="bread_green_last">&nbsp;</div>
index d53cb9e..b7a1a62 100644 (file)
@@ -1,5 +1,6 @@
 <div class="sub_sidebar_header">[% l('New Search') %]</div>
 <form action="[% ctx.kpac_root _ '/search_results' %]">
+    <input type='hidden' name='trail' value="[% CGI.param('trail') | html %]"/>
     <div class="sub_sidebar_search_wrapper">
         <input type="text" name='query' value="[% CGI.param('query') | html %]"
             [% seed = l(' Enter Text... ') | html %]
index f059dc9..582307e 100644 (file)
@@ -48,7 +48,7 @@
                 &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 class="item_icon_type_text">[% attrs.format_label %]</div>
         </div>
         <div class="clear">&nbsp;</div>
     </div>