]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/hold_history.tt2
LP 2061136 follow-up: ng lint --fix
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / hold_history.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     PROCESS "opac/parts/misc_util.tt2";
3     PROCESS "opac/parts/hold_status.tt2";
4     WRAPPER "opac/parts/myopac/base.tt2";
5     myopac_page = "holds";
6     limit = ctx.hold_history_limit;
7     offset = ctx.hold_history_offset;
8     count = ctx.hold_history_ids.size;
9 %]
10
11 <h3 class="sr-only">[% l('Holds History') %]</h3>
12 <div id='myopac_holds_div'>
13
14     <div id="acct_holds_tabs">
15         <div class="align">
16             <a href='[% mkurl('holds',{},['limit','offset']) %]'>[% l("Items on Hold") %]</a>
17         </div>
18         [% IF ctx.curbside_pickup_libs.size %]
19         <div class="align">
20             <a href='[% mkurl('holds_curbside',{},['limit','offset']) %]'>[% l("Curbside Pickup") %]</a>
21         </div>
22         [% END %]
23         [% IF ebook_api.enabled == 'true' %]
24         <div class="align">
25             <a href='[% mkurl('ebook_holds', {}, ['limit','offset','available','sort','sort_type']) %]'>[% l("E-Items on Hold") %]</a>
26         </div>
27         <div class="align">
28             <a href='[% mkurl('ebook_holds_ready', {}, ['limit','offset','available','sort','sort_type']) %]'>[% l("E-Items Ready for Checkout") %]</a>
29         </div>
30         [% END %]
31         [% IF ctx.my_hold_subscriptions.size > 0 %]
32         <div class="align">
33             <a href='[% mkurl('hold_subscriptions', {}, ['limit','offset','available','sort','sort_type']) %]'>[% l("Hold Groups") %]</a>
34         </div>
35         [% END %]
36         <div class="align selected">
37             <a href="#">[% l("Holds History") %]</a>
38         </div>
39     </div>
40
41     <div class="header_middle">
42         <span style="float:left;">[% l("Previously Held Items") %]</span>
43         <span class='float-left' style='padding-left: 10px;'>
44             <a href='[% mkurl('hold_history', {limit => limit,offset => (offset - limit)}) %]'
45                 [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
46             [% IF offset > 0 || count > limit;
47                 curpage = 0;
48                 WHILE curpage * limit < count;
49                     IF curpage * limit == offset;
50             %]
51             [% curpage + 1 %]
52                     [%- ELSE %]
53             <a href='[% mkurl('hold_history', {limit => limit, offset => (curpage * limit)}) %]'>[% curpage + 1 %]</a>
54                     [%- END;
55                     curpage = curpage + 1;
56                 END;
57             END %]
58             <a href='[% mkurl('hold_history', {limit => limit, offset => (offset + limit)}) %]'
59                [% IF count <= limit + offset %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
60         </span>
61         <span style="float:right;">
62             <a class="hide_me" href="#">[% l('Export List') %]</a>
63         </span>
64     </div>
65     <div class="clear-both"></div>
66
67     <div id='holds_main'>
68         [% IF ctx.holds.size && ctx.holds.size < 1 %]
69         <div class="warning_box">
70             <big><strong>[% l('No holds found.') %]</strong></big>
71         </div>
72         [% ELSE %]
73         [% hold_items = ctx.holds;
74            hi = offset + limit - 1;
75            hi = hi > hold_items.max ? hold_items.max : hi;
76            hold_items = hold_items.slice(offset, hi);
77         %]
78         <table id='acct_holds_hist_header' class='table_no_border_space table_no_cell_pad' title="[% l('History of items on hold') %]">
79             <thead>
80                 <tr>
81                     <td><span>[% l('Title') %]</span></td>
82                     <td><span>[% l('Author') %]</span></td>
83                     <td> <span>[% l('Format') %]</span></td>
84                     <td><span>[% l('Pickup Location') %]</span> </td>
85                     <td><span>[% l('Status') %]</span></td>
86                 </tr>
87             </thead>
88             <tbody id='holds_temp_parent'>
89                 [% FOR hold IN hold_items;
90                     attrs = {marc_xml => hold.marc_xml};
91                     PROCESS get_marc_attrs args=attrs;
92                     ahr = hold.hold.hold %]
93
94                 <tr name="acct_holds_temp" class="acct_holds_temp">
95
96                     <td>
97                         <div>
98                             <a href="[% mkurl(ctx.opac_root _ '/record/' _ hold.hold.bre_id) %]">[% attrs.title | html %]</a>
99                         </div>
100                     </td>
101                     <td>
102                         <div>
103                             <a href="[% mkurl(ctx.opac_root _ '/results',
104                                 {qtype => author, query => attrs.author.replace('[,\.:;]', '')}
105                             ) %]">[% attrs.author | html %]</a>
106                         </div>
107                     </td>
108                     <td>
109                         <div class='format_icon'>
110                             [% IF attrs.format_icon %]
111                             <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %][% ctx.cache_key %]" />
112                             [% END %]
113                         </div>
114                     </td>
115                     <td>
116                         [% ctx.get_aou(ahr.pickup_lib).name | html %]
117                     </td>
118                     <td>
119                         <div name="acct_holds_status">
120                             [% PROCESS get_hold_status hold=hold; %]
121                         </div>
122                     </td>
123                 </tr>
124                 [% END %]
125             </tbody>
126         </table>
127         [% END %]
128     </div>
129 </div>
130 [% END %]