]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/kpac/parts/copy_table.tt2
LP 2061136 follow-up: ng lint --fix
[working/Evergreen.git] / Open-ILS / src / templates / kpac / parts / copy_table.tt2
1 [%-
2 FOREACH copy_info IN ctx.copies;
3     IF copy_info.call_number_label != '##URI##';
4         has_copies = 'true';
5     END;
6     IF copy_info.part_label != '';
7         has_parts = 'true';
8     END;
9     IF has_parts && has_copies;
10         LAST;
11     END;
12 END;
13 %]
14 [%- IF has_copies; %]
15 <table cellpadding="0" cellspacing="0" border="0" width="100%" class="item_location_table">
16     <tbody>
17         <tr class="header">
18             <td class="location">[% l('Location') %]</td>
19             <td class="callnumber">[% l('Call Number') %]</td>
20             <td class="shelving_location">[% l('Shelving Location') %]</td>
21             <td class="status">[% l('Status') %]</td>
22         </tr>
23         [%- 
24         FOR copy_info IN ctx.copies;
25             callnum = copy_info.call_number_label;
26             NEXT IF callnum == '##URI##';
27
28             callnum_prefix = copy_info.call_number_prefix_label;
29             IF callnum_prefix != "";
30                 callnum = callnum_prefix _ " " _ callnum;
31             END;
32
33             callnum_suffix = copy_info.call_number_suffix_label;
34             IF callnum_suffix != "";
35                 callnum = callnum  _ " " _ callnum_suffix;
36             END;
37         -%]
38         <tr>
39             <td class="location">
40             [%- INCLUDE "opac/parts/library_name_link.tt2"; -%]
41             </td>
42             [%- IF has_parts == 'true' %]
43             <td class="callnumber">[% l('[_1] ([_2])', callnum, copy_info.part_label) | html %]</td>
44             [% ELSE %]
45             <td class="callnumber">[% callnum | html %]</td>
46             [%- END %]
47             <td class="shelving_location">[% copy_info.copy_location | html %]</td>
48             <td class="status">[% copy_info.copy_status | html %]</td>
49         </tr>
50         [%- END %]
51
52         <!-- PAGING -->
53
54         <tr>
55
56             <td>
57             [%- IF ctx.copy_offset > 0;
58                 new_offset = ctx.copy_offset - ctx.copy_limit;
59                 IF new_offset < 0; new_offset = 0; END %]
60                     <a href="[% mkurl('', {copy_offset => new_offset, copy_limit => ctx.copy_limit}) %]">&laquo; [%
61                         l('Previous [_1]', ctx.copy_offset - new_offset) %]</a>
62             [%- END %]
63             </td>
64
65             <td>
66             [%- IF ctx.copies.size >= ctx.copy_limit %]
67                     <a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
68                         l('Next [_1]', ctx.copy_limit) %] &raquo;</a>
69             [%- END %]
70             </td>
71
72             [%- more_copies_limit = 50 %] [%# TODO: config %]
73             <td>
74             [%- IF  ctx.copy_limit != more_copies_limit AND ctx.copies.size >= ctx.copy_limit %]
75                 <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]">[% l('Show more copies') %]</a>
76             [%- ELSIF ctx.copy_limit == more_copies_limit %]
77                 <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]">[% l('Show fewer copies') %]</a>
78             [%- END %]
79             </td>
80         </tr>
81     </tbody>
82 </table>
83 [% END %]
84