82406970a408fd08dfb1388e75577eed3a34813b
[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         <div class='color_4'>
9             <span>[% l("You are now browsing") %]</span>
10             <strong>[% ctx.browsing_ou.name | html %]</strong>
11         </div>
12         <table class='data_grid bookshelf' width='100%'>
13             <thead>
14                 <tr>
15                     <td>
16                         <a class='classic_link' 
17                             href="[% mkurl('', {cnoffset => cnoffset - 1}) %]#cnbrowse"><b>[% l("&lt;&lt; Previous Page") %]</b></a>
18                     </td>
19                     <td colspan='1' align='center'>[% l("Shelf Browser") %]</td>
20                     <td>
21                         <a class='classic_link' 
22                             href="[% mkurl('', {cnoffset => cnoffset + 1}) %]#cnbrowse"><b>[% l("Next Page &gt;&gt;") %]</b></a>
23                     </td>
24                 </tr>
25             </thead>
26             <tbody>
27             [% tr_open = 0; FOR cn IN ctx.browsed_call_numbers %]
28                 [%- IF loop.index % 3 == 0; tr_open = 1 %]
29                 <tr class='cn_browse_row'>
30                 [% END -%]
31                     <td class='cn_browse_item' width='25%' valign='top'>
32                         [%  rec_attrs = {marc_xml => cn.record.marc};
33                             PROCESS get_marc_attrs args=rec_attrs;
34                             ident = rec_attrs.isbn_clean || rec_attrs.upc;
35                             IF ident %]
36                         <a href="[% mkurl(ctx.opac_root _ '/record/' _ cn.record.id, {}, 1) %]"><img height='60' width='50' 
37                             class='cn_browse_info' name='cn_browse_pic' border='0'
38                             src="[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident | uri %]" /></a>
39                         [% END %]
40                         <div class='cn_browse_info bold' name='cn_browse_cn'>[% cn.label | html %]</div>
41                         <div class='cn_browse_info'>
42                             <a name='cn_browse_title' class='classic_link' 
43                                 href="[% mkurl(ctx.opac_root _ '/record/' _ cn.record.id, {}, 1) %]">[% rec_attrs.title | html %]</a>
44                         </div>
45                         [% IF rec_attrs.author %]<div class='cn_browse_info'>
46                             <a name='cn_browse_author' class='classic_link'
47                                 href="[%-
48                                     authorquery = rec_attrs.author | replace('[,\.:;]', '');
49                                     mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, 1)
50                                     -%]">[% rec_attrs.author | html %]</a>
51                         </div>[% END %]
52                         <div class='cn_browse_info' name='cn_browse_lib'>[% cn.owning_lib.name | html %]</div>
53                     </td>
54                 [% IF loop.index % 3 == 2; tr_open = 0 %]
55                 </tr>
56                 [% END %]
57             [% END; IF tr_open %]</tr>[% END %]
58             </tbody>
59         </table>
60     </div>
61 </div>