lp1422555: Shorter permalink on record summary page
[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 <hr />
9
10 [%-# This holds the record summary information %]
11 <div id="rdetail_summary_header">
12     <div id='rdetail_title_div'>
13         <h1 id='rdetail_title' property="name">[% attrs.title_extended | html %]</h1>
14         [%-
15             FOR link880 IN attrs.graphic_titles;
16                 FOR alt IN link880.graphic;
17                     '<h2 class="graphic880"';
18                     IF alt.dir;
19                         ' dir="' _ alt.dir _ '"';
20                     END;
21                     '>'; alt.value | html; '</h2>';
22                 END;
23             END;
24         -%]
25         [%- INCLUDE "opac/parts/record/authors.tt2" %]
26     </div>
27     <div id="rdetail_image_div">
28         <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/r/[% ctx.bre_id | uri %]'><img
29             alt="[% l('Image of item') %]" id='rdetail_image'
30             src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' /></a>
31         <br />
32     </div>
33     <div id="format_actions">
34         [%- IF attrs.format_label %]
35           [% FOR format IN attrs.all_formats %]
36               <img title="[% format.label | html %]" 
37                   alt="[% format.label | html %]" 
38                   src="[% format.icon %]" /> 
39               [% format.label | html %]
40           [% END %]
41         [%- END %]
42         <div id="rdetail_actions_div">
43             [%- search_ou = ctx.search_ou;
44                 IF ctx.place_unfillable ||
45                     ( attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size
46                         && (ctx.holds_block.enabled != 'true' || !attrs.org_copy_counts.$search_ou.available)
47                     )
48              %]
49             <div class="rdetail_aux_utils place_hold">
50                 <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
51                     {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]" 
52                 class="no-dec" rel="nofollow" vocab=""><img src="[% ctx.media_prefix %]/images/green_check.png"
53                     [% img_alt(l('Place Hold on [_1]', attrs.title)) %]/>
54                 <span class="place_hold">[% l('Place Hold') %]</span></a>
55             </div>
56             [%- END -%]
57             <div class="rdetail_aux_utils toggle_list">
58             [%  IF ctx.user;
59                 INCLUDE "opac/parts/bookbag_actions.tt2";
60             %]
61             [%  ELSE;
62                 operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
63                 label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); 
64             %]
65                 <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}, stop_parms) %]" class="no-dec" rel="nofollow" vocab="">
66                     <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
67                     [% label %]
68                 </a>
69             [% END %]
70             </div>
71             <div class="rdetail_aux_utils">
72                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="[% l('Print / Email Actions Image') %]" />
73                 <a href="[% mkurl(ctx.opac_root _ '/record/print/' _ ctx.bre_id) %]" class="no-dec" rel="nofollow" vocab="">[% l('Print') %]</a> /
74                 <a href="[% mkurl(ctx.opac_root _ '/record/email/' _ ctx.bre_id) %]" class="no-dec" rel="nofollow" vocab="">[% l('Email') %]</a>
75             </div>
76             [%- IF ctx.refworks.enabled == 'true' %]
77                 [%- INCLUDE 'opac/parts/record/refworks.tt2' %]
78             [%- END %]
79             <div class="rdetail_aux_utils share_record">
80               <img src="[% ctx.media_prefix %]/images/link.png" alt="[% l('Permalink') %]" />
81              <a href="[% mkurl('', {locg =>CGI.param('locg'), copy_depth =>CGI.param('copy_depth')}, 1) %]" class="no-dec">[% l('Permalink') %]</a>
82             </div>
83         </div>
84     </div>
85 </div>
86
87 [%- IF openurl.enabled == 'true';
88     openurls = [];
89     FOREACH issn IN args.issns;
90         NEXT IF issn == '';
91         openurls = openurls.import(ResolverResolver.resolve_issn(issn, openurl.baseurl));
92     END;
93     IF openurls.size && openurls.0 != '';
94 %]
95     <div id='rdetail_openurl'>
96         <strong class='rdetail_openurl_title'>[% l("Electronic resources") %]</strong>
97         <table><tbody>
98 [%-
99         FOREACH res IN openurls;
100 %]
101         <tr>
102             <td class='rdetail_openurl_entry'><a href="[% res.target_url %]">[% res.public_name | html %]</a></td>
103             <td>[% res.target_coverage | html %]
104             [%- IF res.target_embargo != '';
105                     ' - ';
106                     res.target_embargo | html;
107                 END;
108             -%]
109             </td>
110         </tr>
111     [%- END %]
112     </tbody></table>
113     </div>    
114 [%- END %]
115 [%- END %]
116 [%- merged_uris = args.uris.merge(args.online_res);
117 num_uris = merged_uris.size;
118 IF num_uris > 0;
119 -%]
120 <h2 class="rdetail_uris">[% l("Electronic resources") %]</h2>
121 <div class="rdetail_uris">
122     [%- IF num_uris > 1 %]<ul>[% END %]
123     [%- FOR uri IN merged_uris %]
124         [%- IF num_uris == 1 -%]
125             <p class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
126         [%- ELSE -%]
127             <li class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
128         [%- END -%]
129         <a href="[% uri.href %]" property="url">
130         [%- IF uri.href != uri.link;
131                 '<span property="description">' _ uri.link _ '</span>';
132             ELSE;
133                 uri.link;
134             END;
135         -%]
136         </a>
137         [%- ' - <span property="description">' _ uri.note _ '</span>' IF uri.note %]
138         <link property="availability" href="http://schema.org/OnlineOnly" />
139         [%- IF attrs.gtin13; '<meta property="gtin13" content="' _ attrs.gtin13 _ '" />'; END; %]
140         [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
141     [%- END %]
142     [%- IF num_uris > 1 %]</ul>[% END %]
143 </div>
144 [%- END %]
145 [%- # Hold/copy summary
146     IF ctx.copy_summary.0.count
147 %]
148 <div id="copy_hold_counts">
149 [%- INCLUDE "opac/parts/record/copy_counts.tt2" %]
150     <span id="rdetail_hold_counts">
151         <h2>[% l('Current holds') %]</h2>
152         <p>
153             [% 
154                 # If org hiding is enabled/relevant, only show 
155                 # counts for copies within the hiding scope.
156                 count_entry = 0;
157                 FOR count_chunk IN ctx.copy_summary;
158                     IF ctx.org_within_hiding_scope(count_chunk.org_unit);
159                         # always true when hiding is disabled
160                         LAST;
161                     END;
162                     count_entry = count_entry + 1;
163                 END;
164                 l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
165                     ctx.record_hold_count, ctx.copy_summary.$count_entry.count) 
166             %]
167         </p>
168     </span>
169 [%- INCLUDE "opac/parts/record/copy_table.tt2" copies=ctx.copies %]
170 </div>
171 [%- END %]
172
173 <h2 id='rdetail_record_details'>[% l("Record details") %]</h2>
174 <ul>
175     [%- IF attrs.isbns.0;
176           FOR isbn IN attrs.isbns;
177             isbn_extra = '';
178             IF (matches = isbn.match('^(.+?)(\s.+)$'));
179               isbn = matches.0;
180               isbn_extra = matches.1;
181             END;
182     %]
183     <li class='rdetail_isbns'>
184         <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
185         <span class='rdetail_value' property='isbn'>[% isbn | html  %]</span>[% isbn_extra | html %]
186     </li>
187         [%- END %]
188     [%- END %]
189     [%- IF attrs.issns.0; FOR issn IN attrs.issns %]
190     <li class='rdetail_issns'>
191         <strong class='rdetail_label'>[% l('ISSN:'); %]</strong>
192         <span class='rdetail_value'>[% issn | html  %]</span>
193     </li>
194         [%- END %]
195     [%- END %]
196     [%- IF attrs.phys_desc %]
197     <li id='rdetail_phys_desc'>
198         <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
199         <span class='rdetail_value'>[% attrs.phys_desc | html %]</span>
200     </li>
201     [%- END %]
202     [%- IF attrs.edition %]
203     <li id='rdetail_edition'>
204         <strong class='rdetail_label'>[% l("Edition:") %]</strong>
205         <span class='rdetail_value'>[% attrs.edition | html %]</span>
206         [%-
207         FOR entry IN attrs.graphic_editions;
208             FOR alt IN entry.graphic;
209                 diratt = "";
210                 IF alt.dir;
211                     diratt = ' dir="' _ alt.dir _ '"';
212                 END;
213         -%]
214         <div class="graphic880 rdetail_value"[% diratt %]>
215             [% alt.value | html %]
216         </div>
217         [%-
218             END;
219         END;
220         -%]
221     </li>
222     [%- END %]
223     [%- IF attrs.publisher %]
224     <li id='rdetail_publisher'>
225         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
226         <span class='rdetail_value' property="publisher" typeof="Organization">
227         [%- IF attrs.pubplace; %]
228             <span property="location">[% attrs.pubplace | html; %]</span>
229         [%- END; %]
230             <span property="name">[% attrs.publisher | html; %]</span>
231         </span>
232         [%- IF attrs.pubdate; %]
233             <span property="datePublished">[% attrs.pubdate | html; %]</span>
234         [%- END; %]
235         [%-
236         IF attrs.graphic_pubinfos.size > 0;
237             FOR entry IN attrs.graphic_pubinfos;
238                 FOR alt IN entry.graphic;
239                     diratt = "";
240                     IF alt.dir;
241                         diratt = ' dir="' _ alt.dir _ '"';
242                     END;
243         -%]
244         <div class="graphic880"[% diratt %]>
245             [% alt.value | html %]
246         </div>
247         [%-
248                 END;
249             END;
250         END
251         -%]
252     </li>
253     [%- END %]
254     [%- IF attrs.producer %]
255         <li id='rdetail_producer'>
256             <strong class='rdetail_label'>[% l("Producer:") %]</strong>
257             <span class='rdetail_value'>
258             [%- IF attrs.prodplace; %]
259                 <span>[% attrs.prodplace | html; %]</span>
260             [%- END; %]
261                 <span>[% attrs.producer | html; %]</span>
262             [%- IF attrs.proddate; %]
263                 <span>[% attrs.proddate | html; %]</span>
264             [%- END; %]
265             </span>
266         </li>
267     [%- END %]
268     [%- IF attrs.distributor %]
269         <li id='rdetail_distributor'>
270             <strong class='rdetail_label'>[% l("Distributor:") %]</strong>
271             <span class='rdetail_value'>
272             [%- IF attrs.distplace; %]
273                 <span>[% attrs.distplace | html; %]</span>
274             [%- END; %]
275                 <span>[% attrs.distributor | html; %]</span>
276             [%- IF attrs.distdate; %]
277                 <span>[% attrs.distdate | html; %]</span>
278             [%- END; %]
279             </span>
280         </li>
281     [%- END %]
282     [%- IF attrs.manufacturer %]
283         <li id='rdetail_manufacturer'>
284             <strong class='rdetail_label'>[% l("Manufacturer:") %]</strong>
285             <span class='rdetail_value' property="manufacturer" typeof="Organization">
286             [%- IF attrs.manplace; %]
287                 <span property="location">[% attrs.manplace | html; %]</span>
288             [%- END; %]
289                 <span property="name">[% attrs.manufacturer | html; %]</span>
290             [%- IF attrs.mandate; %]
291                 <span>[% attrs.mandate | html; %]</span>
292             [%- END; %]
293             </span>
294         </li>
295     [%- END %]
296     [%- IF attrs.copyright %]
297     <li id='rdetail_copyright'>
298         <strong class='rdetail_label'>[% l("Copyright:") %]</strong>
299         <span class='rdetail_value'>[% attrs.copyright | html_entity; %]
300         [%-# Provide the 4-digit year, cleansed of '@' and other junk %]
301         [%- IF attrs.copyrightYear -%]
302             <meta property='copyrightYear' content='[% attrs.copyrightYear | html; %]'>
303         [%- END -%]
304         </span>
305     </li>
306     [%- END %]
307 </ul>
308
309 [%- INCLUDE "opac/parts/record/contents.tt2" %]
310 [%- INCLUDE "opac/parts/record/subjects.tt2" %]
311 [%- INCLUDE "opac/parts/record/series.tt2" %]
312 [%- INCLUDE "opac/parts/record/extras.tt2" %]