added support for reporting renewal responses in the template
[evergreen-equinox.git] / Open-ILS / web / templates / default / opac / myopac / circs.tt2
1 [% BLOCK html_head %]
2 <style>
3     table { width: 100%; text-align: center; padding: 20px; margin-top: 30px; }
4     table { border-collapse: collapse; }
5     table { padding: 3px; border-bottom: 1px solid #ddd; text-align: left;}
6     #action_div { width: 95%; }
7     .renew-summary { float:left; padding-right: 10px;}
8     #action-buttons { float:right; }
9     .circ-table-odd { background-color:#ded; }
10     .failure-text { font-weight: bold; color: red; }
11     #circ-form { margin-top: 20px; }
12 </style>
13 [% END %]
14
15 [% PROCESS "default/opac/common.tt2" %]
16 [% WRAPPER "default/opac/base.tt2" %]
17 [% INCLUDE "default/opac/myopac/_links.tt2" myopac_page = "circs" %]
18 [% USE date %]
19
20
21 <form method='POST' id='circ-form'>
22     <div id='action_div'>
23         [% IF ctx.success_renewals > 0 %]
24             <div class='renew-summary'><b>Successfully renewed [% ctx.success_renewals %] items.</b></div>
25         [% END %]
26         [% IF ctx.failed_renewals > 0 %]
27             <div class='renew-summary'><b>Failed to renew [% ctx.failed_renewals %] items.</b></div>
28         [% END %]
29         <div id='action-buttons'>
30             <button type='submit' value='renew' name='action'>Renew Selected</button>
31             <button type='submit' value='renew_all' name='action'>Renew All</button>
32         </div>
33     </div>
34     <table>
35         <thead>
36             <tr>
37                 <th>Title</th>
38                 <th>Author</th>
39                 <th>Due Date</th>
40                 <th>Renewals Remaining</th>
41                 <th>Select</th>
42             </tr>
43         </thead>
44         <tbody>
45             [% FOR circ IN ctx.circs %]
46                 [% attrs = {marc_xml => circ.marc_xml}; %]
47                 [% PROCESS get_marc_attrs args=attrs; %]
48                 <tr [% IF loop.count % 2 == 1 %] class='circ-table-odd' [% END %]>
49                     <td>[% attrs.title %]</td>
50                     <td>[% attrs.author %]</td>
51                     <td>[% date.format(ctx.parse_datetime(circ.circ.due_date),'%Y-%m-%d') %]</td>
52                     <td><em>[% circ.circ.renewal_remaining %]</em></td>
53                     <td><input name='circ' value='[% circ.circ.id %]' type='checkbox'/></td>
54                 </tr>
55                 [% IF circ.renewal_response and circ.renewal_response.textcode != 'SUCCESS' %]
56                 <tr [% IF loop.count % 2 == 1 %] class='circ-table-odd' [% END %]>
57                     <td colspan='0'>
58                         <div class='failure-text'>
59                             [% circ.renewal_response.textcode %] 
60                             [% IF circ.renewal_response.payload.fail_part and circ.renewal_response.payload.fail_part != circ.renewal_response.textcode %]
61                                 [% circ.renewal_response.payload.fail_part %]
62                             [% END %]
63                         </div>
64                     </td>
65                 </tr>
66                 [% END %]
67             [% END %]
68         </tbody>
69     </table>
70 </form>
71
72 [% END %]