]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/kpac/parts/copy_table.tt2
Merge branch 'master' of git.evergreen-ils.org:Evergreen
[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="loc_info">&nbsp;</td>
20             <td class="status">[% l('Status') %]</td>
21             <td class="callnumber">[% l('Call Number') %]</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">[% ctx.get_aou(copy_info.circ_lib).name | html %]</td>
40             <td class="loc_info"><a href="javascript:;">View Library Info</a></td><!-- TODO -->
41             <td class="status">[% copy_info.copy_status | html %]</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         </tr>
48         [%- END %]
49
50         <!-- PAGING -->
51
52         <tr>
53
54             <td>
55             [%- IF ctx.copy_offset > 0;
56                 new_offset = ctx.copy_offset - ctx.copy_limit;
57                 IF new_offset < 0; new_offset = 0; END %]
58                     <a href="[% mkurl('', {copy_offset => new_offset, copy_limit => ctx.copy_limit}) %]">&laquo; [%
59                         l('Previous [_1]', ctx.copy_offset - new_offset) %]</a>
60             [%- END %]
61             </td>
62
63             <td>
64             [%- IF ctx.copies.size >= ctx.copy_limit %]
65                     <a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
66                         l('Next [_1]', ctx.copy_limit) %] &raquo;</a>
67             [%- END %]
68             </td>
69
70             [%- more_copies_limit = 50 %] [%# TODO: config %]
71             <td>
72             [%- IF  ctx.copy_limit != more_copies_limit AND ctx.copies.size >= ctx.copy_limit %]
73                 <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]">[% l('Show more copies') %]</a>
74             [%- ELSIF ctx.copy_limit == more_copies_limit %]
75                 <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]">[% l('Show fewer copies') %]</a>
76             [%- END %]
77             </td>
78         </tr>
79     </tbody>
80 </table>
81 [% END %]
82