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