]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/parts/record/summary.tt2
TPAC: Fix record summary e-resource and copy display
[Evergreen.git] / Open-ILS / src / templates / opac / parts / record / summary.tt2
1 [%  PROCESS "opac/parts/misc_util.tt2";
2     USE ResolverResolver;
3     ctx.page_title = attrs.title | html
4 %]
5 <!-- ****************** rdetail_summary.xml ***************************** -->
6 <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% ctx.bre_id %]'></abbr>
7
8 [%- IF ctx.refworks.enabled == 'true' %]
9     [% INCLUDE 'opac/parts/record/refworks.tt2' %]
10 [%- END %]
11
12 <hr style="margin-top: 1em;" />
13
14 [%- # This holds the record summary information %]
15 <div id="rdetail_image_div" style="float: left; margin-right: 1em;">
16     [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
17     <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/[% ident | uri %]'><img
18         alt="[% l('Image of item') %]" id='rdetail_image'
19         src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/[% ident | uri %]' /></a>
20     [% END %]
21     <br />
22 </div>
23  
24 <div id="rdetail_actions_div" style="float: right; margin-left: 1em;">
25     <div class="rdetail_aux_utils opac-auto-010">
26         <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
27             {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}) %]" 
28         class="no-dec"><img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" /><span 
29         style="position:relative;top:-3px;left:3px;">[% l('Place Hold') %]</span></a>
30     </div>
31     <div class="rdetail_aux_utils opac-auto-121">
32     [%-  
33         operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
34         label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); 
35     %]
36         <a href="[% ctx.opac_root %]/mylist/[% operation %]?record=[% ctx.bre_id %]" class="no-dec">
37             <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
38             [% label %]
39         </a>
40     </div>
41 </div>
42
43 <div id='rdetail_title_div'>
44     [%- IF attrs.format_icon %]
45     <div style="float:right;margin-right:17px;">
46         <img alt="[% attrs.format_label %]" title="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
47     </div>
48     [%- END %]
49     <h1 id='rdetail_title'>[% attrs.title_extended | html %]</h1>
50     [%- INCLUDE "opac/parts/record/authors.tt2" %]
51 </div>
52
53 [%- IF openurl.enabled == 'true';
54     sfx = []
55     FOR issn IN args.issns;
56         sfx = sfx.import(ResolverResolver.resolve_issn(issn, openurl.baseurl));
57     END;
58     IF sfx.size && sfx.0 != '';
59 %]
60     <div id='rdetail_openurl'>
61         <strong class='rdetail_openurl_title'>[% l("Electronic resources") %]</strong>
62         <table><tbody>
63 [%-
64         FOR res IN sfx;
65 %]
66         <tr>
67             <td class='rdetail_openurl_entry'><a href="[% res.target_url %]">[% res.public_name %]</a></td>
68             <td>[% res.target_coverage %]</td>
69         </tr>
70     [%- END %]
71     </tbody></table>
72 [%- END %]
73 [%- IF sfx.size && sfx.0 != '' %]
74     </div>    
75 [%- END %]
76 [%- merged_uris = args.uris.merge(args.online_res);
77 num_uris = merged_uris.size;
78 IF num_uris > 0;
79 -%]
80 <h2 style="margin-top: 1em;">[% l("Electronic resources") %]</h2>
81 <div class="rdetail_uris">
82     [%- IF num_uris > 1 %]<ul>[% END %]
83     [%- FOR uri IN merged_uris %]
84         [%- IF num_uris == 1 %]<p class="rdetail_uri">[% ELSE %]<li class="rdetail_uri">[% END %]
85         <a href="[% uri.href %]">[% uri.link %]</a>[% ' - ' _ uri.note IF uri.note %]
86         [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
87     [%- END %]
88     [%- IF num_uris > 1 %]</ul>[% END %]
89 </div>
90 [%- END %]
91 [%- # hold/copy summary %]
92 [%- IF ctx.copy_summary.0.count %]
93 <div id='rdetail_copies'>
94 <h2>[% l('Copies') %]</h2>
95 <div class="rdetail_copy_counts">
96     <span>
97         [%- l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
98             ctx.record_hold_count, ctx.copy_summary.0.count) %]
99     </span>
100     <span>[% l('[quant,_1,copy,copies] currently available.', ctx.copy_summary.0.available) %]</span>
101 </div>
102 <table cellpadding="0" cellspacing="0" border="0" width="100%" id="rdetails_status">
103     <thead>
104         <tr>
105             <th id='copy_header_library'>[% l("Location") %]</th>
106             <th id='copy_header_callnmber'>[% l("Call Number") %]</th>
107             <th id='copy_header_barcode'>[% l("Barcode") %]</th>
108             <th id='copy_header_shelfloc'>[% l("Shelving Location") %]</th>
109             [%- IF ctx.is_staff %]
110             <th id='copy_header_age_hold'>[% l("Age Hold Protection") %]</th>
111             <th id='copy_header_create_date'>[% l("Create Date") %]</th>
112             <th id='copy_header_holdable'>[% l("Holdable?") %]</th>
113             [%- END %]
114             <th id='copy_header_status'>[% l("Status") %]</th>
115             <th id='copy_header_due_date'>[% l("Due Date") %]</th>
116         </tr>
117     </thead>
118     <tbody class="copy_details_table">
119         [%- last_cn = 0;
120         FOR copy_info IN ctx.copies;
121             NEXT IF copy_info.call_number_label == '##URI##' %]
122         <tr>
123             <td header='copy_header_library'>
124             [%-
125                 org_name = ctx.get_aou(copy_info.circ_lib).name;
126                 org_name | html
127             -%]
128             </td>
129             <td header='copy_header_callnumber'>[% copy_info.call_number_label | html %]</td>
130             <td header='copy_header_barcode'>[% copy_info.barcode | html %]</td>
131             <td header='copy_header_shelfloc'>[% copy_info.copy_location | html %]</td>
132             [%- IF ctx.is_staff %]
133             <td header='copy_header_age_hold'>
134                 [% copy_info.age_protect ?
135                     ctx.get_crahp(copy_info.age_protect).name : l('None') | html %]
136             </td>
137             <td header='copy_header_date_format'>[% date.format(
138                 ctx.parse_datetime(copy_info.create_date),
139                 DATE_FORMAT
140             ) %]</td>
141             <td header='copy_header_holdable'>[%  # Show copy/volume hold links to staff (without
142                     # checking whether they have permissions to do those).
143                     overall_holdable = (copy_info.holdable == 't' AND
144                         copy_info.location_holdable == 't' AND
145                         copy_info.status_holdable == 't');
146                     IF overall_holdable;
147                         l("Place on"); %]
148                 <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
149                     {hold_target => copy_info.id, hold_type => 'C', hold_source_page => mkurl()}) %]">[% l("copy") %]</a>
150                 [%-      IF copy_info.call_number != last_cn;
151                             last_cn = copy_info.call_number;
152                             l(" / "); %]
153                 <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
154                     {hold_target => copy_info.call_number, hold_type => 'V', hold_source_page => mkurl()}) %]">[% l("volume") %]</a>
155                 [%-      END;
156                     ELSE;
157                         l("No");
158                     END %]</td>
159             [%- END %]
160             <td header='copy_header_status'>[% copy_info.copy_status | html %]</td>
161             <td header='due_date'>[%
162                 IF copy_info.due_date;
163                     date.format(
164                         ctx.parse_datetime(copy_info.due_date),
165                         DATE_FORMAT
166                     );
167                 ELSE;
168                     '-';
169                 END %]</td>
170         </tr>
171         [%- END %]
172         <tr>
173         [%- IF ctx.copy_offset > 0;
174             new_offset = ctx.copy_offset - ctx.copy_limit;
175             IF new_offset < 0; new_offset = 0; END %]
176             <td>
177                 <a href="[% mkurl('', {copy_offset => new_offset, copy_limit => ctx.copy_limit}) %]">&laquo; [%
178                     l('Previous [_1]', ctx.copy_offset - new_offset) %]</a>
179             </td>
180         [%- END %]
181         [%- IF ctx.copies.size >= ctx.copy_limit %]
182             <td>
183                 <a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
184                     l('Next [_1]', ctx.copy_limit) %] &raquo;</a>
185             </td>
186         [%- END %]
187         </tr>
188         <tr>
189             <td>
190                 [%- more_copies_limit = 50 %] [%# TODO: config %]
191                 [%- IF  ctx.copy_limit != more_copies_limit AND ctx.copies.size >= ctx.copy_limit %]
192                     <div style='margin-top:10px;'>
193                         <img src="[% ctx.media_prefix %]/images/plus_sign.png" />
194                         <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]">[% l('Show more copies') %]</a>
195                     </div>
196                 [%- ELSIF ctx.copy_limit == more_copies_limit %]
197                     <div style='margin-top:10px;'>
198                         <img src="[% ctx.media_prefix %]/images/minus_sign.png" />
199                         <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]">[% l('Show fewer copies') %]</a>
200                     </div>
201                 [%- END %]
202             </td>
203         </tr>
204     </tbody>
205 </table>
206 </div>
207 [%- END %]
208
209 <h2 id='rdetail_record_details'>[% l("Record details") %]</h2>
210 <ul>
211     [%- IF attrs.isbns.0; FOR isbn IN attrs.isbns %]
212     <li class='rdetail_isbns'>
213         <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
214         <span class='rdetail_value'>[% isbn | html  %]</span>
215     </li>
216         [%- END %]
217     [%- END %]
218     [%- IF attrs.issns.0; FOR issn IN attrs.issns %]
219     <li class='rdetail_issns'>
220         <strong class='rdetail_label'>[% l('ISSN:'); %]</strong>
221         <span class='rdetail_value'>[% issn | html  %]</span>
222     </li>
223         [%- END %]
224     [%- END %]
225     [%- IF attrs.phys_desc %]
226     <li id='rdetail_phys_desc'>
227         <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
228         <span class='rdetail_value'>[% attrs.phys_desc | html %]</span>
229     </li>
230     [%- END %]
231     [%- IF attrs.edition %]
232     <li id='rdetail_edition'>
233         <strong class='rdetail_label'>[% l("Edition:") %]</strong>
234         <span class='rdetail_value'>[% attrs.edition | html %]</span>
235     </li>
236     [%- END %]
237     [%- IF attrs.publisher %]
238     <li id='rdetail_publisher'>
239         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
240         <span class='rdetail_value'>[% attrs.publisher | html %] [% IF attrs.pubdate; attrs.pubdate | html; END %]</span>
241     </li>
242     [%- END %]
243 </ul>
244
245 [%- INCLUDE "opac/parts/record/subjects.tt2" %]
246 [%- INCLUDE "opac/parts/record/series.tt2" %]
247 [%- INCLUDE "opac/parts/record/extras.tt2" %]