a00fbf0ea1b42089f6ddce82536df97bbfb9c124
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / record / cnbrowse.tt2
1 [% 
2     cnoffset = CGI.param('cnoffset');
3     cnoffset = cnoffset.match('^-?\d+$') ? cnoffset : 0; # verify cnoffset is a sane value
4 %]
5
6 <div id='cn_browse' class='cn_browser'>
7     <div id='cn_browse_div'> 
8         <p class='color_4'>
9             [% l("You are now browsing [_1]", ctx.browsing_ou.name) | html %]
10         </p>
11         <table class='data_grid bookshelf' width='100%'>
12             <thead>
13                 <tr>
14                     <td>
15                         <a class='classic_link' 
16                             href="[% mkurl('', {cnoffset => cnoffset - 1}) %]#cnbrowse"><b>[% l("&lt;&lt; Previous Page") %]</b></a>
17                     </td>
18                     <td colspan='1' align='center'>[% l("Shelf Browser") %]</td>
19                     <td>
20                         <a class='classic_link' 
21                             href="[% mkurl('', {cnoffset => cnoffset + 1}) %]#cnbrowse"><b>[% l("Next Page &gt;&gt;") %]</b></a>
22                     </td>
23                 </tr>
24             </thead>
25             <tbody>
26             [%- tr_open = 0;
27                 PROCESS get_library;
28                 FOR cn IN ctx.browsed_call_numbers;
29                   IF loop.index % 3 == 0; tr_open = 1 %]
30                 <tr class='cn_browse_row'>
31                 [% END -%]
32                     <td class='cn_browse_item' width='25%' valign='top'>
33                         [%  rec_attrs = {marc_xml => cn.record.marc};
34                             PROCESS get_marc_attrs args=rec_attrs; %]
35                         <a href="[% mkurl(ctx.opac_root _ '/record/' _ cn.record.id, {$loc_name => loc_value}, 1) %]"><img height='60' width='50' 
36                             class='cn_browse_info' name='cn_browse_pic' border='0'
37                             src="[% ctx.media_prefix %]/opac/extras/ac/jacket/small/r/[% cn.record.id | uri %]" /></a>
38                         <div class='cn_browse_info bold' name='cn_browse_cn'>[% cn.label | html %]</div>
39                         <div class='cn_browse_info'>
40                             <a name='cn_browse_title' class='classic_link record_title'
41                                 href="[% mkurl(ctx.opac_root _ '/record/' _ cn.record.id, {$loc_name => loc_value}, 1) %]">[% rec_attrs.title | html %]</a>
42                         </div>
43                         [% IF rec_attrs.author %]<div class='cn_browse_info'>
44                             <a name='cn_browse_author' class='classic_link record_author'
45                                 href="[%-
46                                     authorquery = rec_attrs.author | replace('[,\.:;]', '');
47                                     mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery, $loc_name => loc_value}, 1)
48                                     -%]">[% rec_attrs.author | html %]</a>
49                         </div>[% END %]
50                         <div class='cn_browse_info' name='cn_browse_lib'>[% cn.owning_lib.name | html %]</div>
51                     </td>
52                 [% IF loop.index % 3 == 2; tr_open = 0 %]
53                 </tr>
54                 [% END %]
55             [% END; IF tr_open %]</tr>[% END %]
56             </tbody>
57         </table>
58     </div>
59 </div>