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