]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/templates/default/opac-poc/myopac/circs.tt2
Merge branch 'master' of git.evergreen-ils.org:Evergreen into template-toolkit-opac
[working/Evergreen.git] / Open-ILS / web / templates / default / opac-poc / 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
19 [% IF ctx.circs.size == 0 %]
20 <b>No Items Checked Out</b>
21 [% STOP; END %]
22
23 <form method='POST' id='circ-form'>
24     <div id='action_div'>
25         [% IF ctx.success_renewals > 0 %]
26             <div class='renew-summary'><b>Successfully renewed [% ctx.success_renewals %] items.</b></div>
27         [% END %]
28         [% IF ctx.failed_renewals > 0 %]
29             <div class='renew-summary'><b>Failed to renew [% ctx.failed_renewals %] items.</b></div>
30         [% END %]
31         <div id='action-buttons'>
32             <button type='submit' value='renew' name='action'>Renew Selected</button>
33             <button type='submit' value='renew_all' name='action'>Renew All</button>
34         </div>
35     </div>
36     <table>
37         <thead>
38             <tr>
39                 <th>Title</th>
40                 <th>Author</th>
41                 <th>Due Date</th>
42                 <th>Renewals Remaining</th>
43                 <th>Select</th>
44             </tr>
45         </thead>
46         <tbody>
47             [% FOR circ IN ctx.circs %]
48                 [% attrs = {marc_xml => circ.marc_xml}; %]
49                 [% PROCESS get_marc_attrs args=attrs; %]
50
51                 <tr [% IF loop.count % 2 == 1 %] class='circ-table-odd' [% END %]>
52                     <td><a href='../record/[% circ.circ.target_copy.call_number.record.id %]'>[% attrs.title %]</a></td>
53                     <td><a href='../results?query=au:[% attrs.author | url %]'>[% attrs.author %]</a></td>
54                     <td>[% date.format(ctx.parse_datetime(circ.circ.due_date),'%Y-%m-%d') %]</td>
55                     <td><em>[% circ.circ.renewal_remaining %]</em></td>
56                     <td><input name='circ' value='[% circ.circ.id %]' type='checkbox' 
57                         [% IF circ.circ.renewal_remaining < 1 %] disabled='disabled' [% END %]/></td>
58                 </tr>
59
60                 [% IF circ.renewal_response and circ.renewal_response.textcode != 'SUCCESS' %]
61                 <tr [% IF loop.count % 2 == 1 %] class='circ-table-odd' [% END %]>
62                     <td colspan='0'>
63                         <div class='failure-text'>
64                             [% circ.renewal_response.textcode %] 
65                             [% IF circ.renewal_response.payload.fail_part and circ.renewal_response.payload.fail_part != circ.renewal_response.textcode %]
66                                 [% circ.renewal_response.payload.fail_part %]
67                             [% END %]
68                         </div>
69                     </td>
70                 </tr>
71                 [% END %]
72             [% END %]
73         </tbody>
74     </table>
75 </form>
76
77 [% END %]