]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates-bootstrap/opac/parts/record/cnbrowse.tt2
LP#1778972: Tweaks and fixes to Bootstrap 4 template
[Evergreen.git] / Open-ILS / src / templates-bootstrap / 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 class='cn_browser'>
7     <div id='cn_browse_div'>
8         <p class='color_4 h5'>
9             [% l("You are now browsing [_1]", ctx.browsing_ou.name) | html %]
10         </p>
11
12         <div class="row">
13             <div class="col-3">
14                 <a class='np_nav_link classic_link btn btn-outline-primary' href="[% mkurl('', {cnoffset => cnoffset - 1}) %]#cnbrowse">[% l("&lt;&lt; Previous Page") %]</a>
15             </div>
16
17             <div class="col-6 text-center">
18                 <h3>[% l("Shelf Browser") %]</h3>
19             </div>
20
21             <div class="col-3 text-right">
22                 <a class='np_nav_link classic_link btn btn-outline-primary' href="[% mkurl('', {cnoffset => cnoffset + 1}) %]#cnbrowse">[% l("Next Page &gt;&gt;") %]</a>
23             </div>
24         </div>
25
26         <hr />
27
28         <table class='data_grid bookshelf'>
29             <tbody>
30             [%- tr_open = 0;
31                 PROCESS get_library;
32                 FOR cn IN ctx.browsed_call_numbers;
33                   IF loop.index % 3 == 0; tr_open = 1 %]
34                 <tr class='cn_browse_row'>
35                 [% END -%]
36                     <td class='cn_browse_item'>
37                         <div class="card">
38                         [%  rec_attrs = {marc_xml => cn.record.marc};
39                             PROCESS get_marc_attrs args=rec_attrs; %]
40                         <a href="[% mkurl(ctx.opac_root _ '/record/' _ cn.record.id, {$loc_name => loc_value}, 1) %]"><img height='60' width='50'
41                             class='cn_browse_info'
42                             [% img_alt(l('Go to record [_1]', rec_attrs.title)) %]
43                             src="[% ctx.media_prefix %]/opac/extras/ac/jacket/small/r/[% cn.record.id | uri %]" /></a>
44                         <div class='cn_browse_info bold'>[% cn.label | html %]</div>
45                         <div class='cn_browse_info'>
46                             <a class='classic_link record_title'
47                                 href="[% mkurl(ctx.opac_root _ '/record/' _ cn.record.id, {$loc_name => loc_value}, 1) %]">[% rec_attrs.title | html %]</a>
48                         </div>
49                         [% IF rec_attrs.author %]<div class='cn_browse_info'>
50                             <a class='classic_link record_author'
51                                 href="[%-
52                                     authorquery = rec_attrs.author | replace('[,\.:;]', '');
53                                     mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery, $loc_name => loc_value}, 1)
54                                     -%]">[% rec_attrs.author | html %]</a>
55                         </div>[% END %]
56                         <div class='cn_browse_info'>[% cn.owning_lib.name | html %]</div>
57                         </div>
58                     </td>
59                 [% IF loop.index % 3 == 2; tr_open = 0 %]
60                 </tr>
61                 [% END %]
62             [% END; IF tr_open %]</tr>[% END %]
63             </tbody>
64         </table>
65     </div>
66 </div>