]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/circs.tt2
Reactive tables for myopac circ and holds.
[Evergreen.git] / Open-ILS / src / templates / opac / myopac / circs.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     PROCESS "opac/parts/misc_util.tt2";
3     WRAPPER "opac/parts/myopac/base.tt2";
4     myopac_page = "circs"  %]
5 <div id='myopac_checked_div'>
6
7     <div id="acct_checked_tabs">
8         <div class="align selected">
9             <a href="#">[% l("Current Items Checked Out") %]</a>
10         </div>
11         <div class="align">
12             <a href="[% mkurl('circ_history') %]">[% l("Check Out History") %]</a>
13         </div>
14     </div>
15
16     <div class="header_middle">
17         <span class="float-left">[% l('Current Items Checked Out') %]</span>
18     </div>
19     <div class="clear-both"></div>
20     [% IF ctx.circs.size < 1 %]
21     <div class="warning_box">[% l('You have no items checked out.') %]</div>
22     [% ELSE %]
23     [% IF ctx.success_renewals %]
24     <div class="renew-summary">
25         [% l("Successfully renewed [_1] item(s)", ctx.success_renewals) %]
26     </div>
27     [% END %]
28     [% IF ctx.failed_renewals %]
29     <div class="renew-summary alert">
30         [% l("Failed to renew [_1] item(s)", ctx.failed_renewals) %]
31     </div>
32     [% END %]
33     <div id='checked_main'>
34         <form method="post" id="circ-form"
35             onsubmit="return confirm('[% l("Are you sure you wish to renew the selected item(s)?") %]');">
36         <table cellpadding='0' cellspacing='0' class="item_list_padding">
37             <tr>
38                 <td>
39                     <select name="action">
40                         <option value="renew">[% l('Renew Selected Titles') %]</option>
41                     </select>
42                 </td>
43                 <td style="padding-left:9px;">
44                     <input type="submit"
45                         value="[% l('Go') %]"
46                         alt="[% l('Go') %]" title="[% l('Go') %]"
47                         class="opac-button" />
48                 </td>
49                 <td style="padding-left:5px;">
50                     <a href="#"><img alt="[% l('Renewing Help') %]"
51                         src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
52                 </td>
53             </tr>
54         </table>
55         <table id="acct_checked_main_header" cellpadding='0' cellspacing='0' border='0'>
56             <thead>
57             <tr>
58                 <th class="checkbox_column">
59                     <input type="checkbox" id="check_all_checked"
60                         onclick="var inputs=document.getElementsByTagName('input'); for (i = 0; i < inputs.length; i++) { if (inputs[i].name == 'circ' && !inputs[i].disabled) inputs[i].checked = this.checked;}"
61                     />
62                 </th>
63                 <th>[% l('Title / Author') %]</th>
64                 <th>[% l('Renewals Left') %]</th>
65                 <th>[% l('Due Date') %]</th>
66                 <th>[% l('Barcode') %]</th>
67                 <th>[% l('Call number') %]</th>
68             </tr>
69             </thead>
70             <tbody>
71                     [% FOR circ IN ctx.circs;
72                         attrs = {marc_xml => circ.marc_xml};
73                         PROCESS get_marc_attrs args=attrs; %]
74                     <tr>
75                         <td class="checkbox_column" valign="top">
76                             <input type="checkbox" name="circ"
77                                 [% IF circ.circ.renewal_remaining < 1 %] disabled="disabled" [% END %]
78                                 value="[% circ.circ.id %]" />
79                         </td>
80                         <td name="author">
81                             [% IF circ.circ.target_copy.call_number.id == -1 %]
82                                 [% circ.circ.target_copy.dummy_title | html %]
83                             [% ELSIF attrs.title %]
84                             <a href="[% mkurl(ctx.opac_root _ '/record/' _ 
85                                 circ.circ.target_copy.call_number.record.id) %]"
86                                 name="[% l('Catalog record') %]">[% attrs.title | html %]</a>
87                             [% END %]
88                             [% IF circ.circ.target_copy.call_number.id == -1 %] /
89                                 [% circ.circ.target_copy.dummy_author | html %]
90                             [% ELSIF attrs.author %] /
91                             <a href="[% mkurl(ctx.opac_root _ '/results',
92                                 {qtype => 'author', query => attrs.author.replace('[,\.:;]', '')}
93                             ) %]">[% attrs.author | html %]</a>
94                             [% END %]
95                         </td>
96                         <td name="renewals">
97                             [% circ.circ.renewal_remaining %]
98                         </td>
99                         [%
100                             due_date = ctx.parse_datetime(circ.circ.due_date);
101                             due_class = (date.now > date.format(due_date, '%s')) ? 'error' : '';
102                         %]
103                         <td name="due_date" class='[% due_class %]'>
104                             [% date.format(due_date, DATE_FORMAT) %]
105                         </td>
106                         <td name="barcode">
107                             [% circ.circ.target_copy.barcode | html %]
108                         </td>
109                         <td name="call_number">
110                             [% circ.circ.target_copy.call_number.label | html %]
111                         </td>
112                     </tr>
113                     [%  IF circ.renewal_response AND
114                             circ.renewal_response.textcode != 'SUCCESS' %]
115                     <tr>
116                         <td colspan="6">[%# XXX colspan="0" does not work in IE %]
117                             <span class="failure-text" title="[% circ.renewal_response.textcode | html %] / [% circ.renewal_response.payload.fail_part | html %]">
118                                 [% (circ.renewal_response.desc || circ.renewal_response.payload.fail_part || circ.renewal_response.textcode) | html %]
119                             </span>
120                         </td>
121                     </tr>
122                     [%  END;
123                     END %]
124                 </table>
125             </div>
126         </div>
127         </form>
128     </div>
129     [% END %]
130 </div>
131 [% END %]