LP1573734_Link_to_sibling_metarecord_bibs_in_record_detail_page
[working/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     ctx.metalinks.push('<meta property="og:image" content="' _ ctx.media_prefix _ '/opac/extras/ac/jacket/large/r/' _ ctx.bre_id _ '" />');
5 %]
6 <!-- ****************** rdetail_summary.xml ***************************** -->
7 <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% ctx.bre_id %]'></abbr>
8
9 <hr />
10
11 [%-# This holds the record summary information %]
12 <div id="rdetail_summary_header">
13     <div id='rdetail_title_div'>
14         <h1 id='rdetail_title' property="name">[% attrs.title_extended | html %]</h1>
15         [%-
16             FOR link880 IN attrs.graphic_titles;
17                 FOR alt IN link880.graphic;
18                     '<h2 class="graphic880"';
19                     IF alt.dir;
20                         ' dir="' _ alt.dir _ '"';
21                     END;
22                     '>'; alt.value | html; '</h2>';
23                 END;
24             END;
25         -%]
26         [%- INCLUDE "opac/parts/record/authors.tt2" %]
27     </div>
28     <div id="rdetail_image_div">
29         <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/r/[% ctx.bre_id | uri %]'><img
30             alt="[% l('Image of item') %]" id='rdetail_image'
31             src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' /></a>
32         <br />
33     </div>
34     <div id="format_actions">
35
36
37         [%- IF attrs.format_label %]
38           [% FOR format IN attrs.all_formats %]
39               <img title="[% format.label | html %]" 
40                   alt="[% format.label | html %]" 
41                   src="[% format.icon %]" /> 
42               [% format.label | html %]
43           [% END %]
44         [%- END %]
45
46         <div id="rdetail_actions_div">
47             [%- search_ou = ctx.search_ou;
48                 IF ctx.place_unfillable ||
49                     ( attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size
50                         && (ctx.holds_block.enabled != 'true' || !attrs.org_copy_counts.$search_ou.available)
51                     )
52              %]
53             <div class="rdetail_aux_utils place_hold">
54                 <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
55                     {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]" 
56                 class="no-dec" rel="nofollow" vocab=""><img src="[% ctx.media_prefix %]/images/green_check.png"
57                     [% img_alt(l('Place Hold on [_1]', attrs.title)) %]/>
58                 <span class="place_hold">[% l('Place Hold') %]</span></a>
59             </div>
60             [%- END -%]
61             <div class="rdetail_aux_utils toggle_list">
62                         [%  IF ctx.user;
63                                 INCLUDE "opac/parts/bookbag_actions.tt2";
64                         %]
65                         [%  ELSE;
66                                 operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
67                                 label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); 
68                         %]
69                                 <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}, stop_parms) %]" class="no-dec" rel="nofollow" vocab="">
70                                         <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
71                                         [% label %]
72                                 </a>
73                         [% END %]
74                         </div>
75                         <div class="rdetail_aux_utils toggle_list">
76                                         [% IF ctx.mylist.size %]
77                                                 [%- IF ctx.user; %]
78                                                 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists') %]" class="no-dec" rel="nofollow" vocab=""><img src="[% ctx.media_prefix %]/images/clipboard.png" alt="[% l('View My Lists') %]" />[% l(' View My Lists') %]</a>
79                                                 [%- ELSE %]
80                                                 <a href="[% mkurl(ctx.opac_root _ '/mylist') %]" class="no-dec" rel="nofollow" vocab=""><img src="[% ctx.media_prefix %]/images/clipboard.png" alt="[% l('View My Temporary List') %]" />[% l(' View My Temporary List') %]</a>
81                                                 [%- END %]
82                                         [% END %]
83                                 </div>
84                                 <div class="rdetail_aux_utils">
85                                         <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="[% l('Print / Email Actions Image') %]" />
86                                         <a href="[% mkurl(ctx.opac_root _ '/record/print/' _ ctx.bre_id) %]" class="no-dec" rel="nofollow" vocab="">[% l('Print') %]</a> /
87                                         <a href="[% mkurl(ctx.opac_root _ '/record/email/' _ ctx.bre_id) %]" class="no-dec" rel="nofollow" vocab="">[% l('Email') %]</a>
88                                 </div>
89                                 [%- IF ctx.refworks.enabled == 'true' %]
90                                         [%- INCLUDE 'opac/parts/record/refworks.tt2' %]
91                                 [%- END %]
92                          [% IF !ctx.is_staff %]
93                                 <div class="rdetail_aux_utils share_record">
94                                         <a href="[% mkurl('', {locg =>CGI.param('locg'), copy_depth =>CGI.param('copy_depth')}, 1) %]" class="no-dec">
95                                                  <img src="[% ctx.media_prefix %]/images/link.png" alt="[% l('Permalink') %]" />
96                                                  [% l('Permalink') %]
97                                         </a>
98                                 </div>
99                         [% END %]
100             [%- IF ctx.is_staff %]
101             <div class="rdetail_aux_utils clear_addedcontent_cache">
102                 <a href="[% ctx.media_prefix %]/opac/extras/ac/clearcache/all/r/[% ctx.bre_id | uri %]" class="no-dec" target="_blank">
103                      [% l('Clear AddedContent Cache') %]
104                 </a>
105             </div>
106             [%- END %]
107         </div>
108     </div>
109 </div>
110
111 [%- IF openurl.enabled == 'true';
112     openurls = [];
113     FOREACH issn IN args.issns;
114         NEXT IF issn == '';
115         openurls = openurls.import(ResolverResolver.resolve_issn(issn, openurl.baseurl));
116     END;
117     IF openurls.size && openurls.0 != '';
118 %]
119     <div id='rdetail_openurl'>
120         <strong class='rdetail_openurl_title'>[% l("Electronic resources") %]</strong>
121         <table><tbody>
122 [%-
123         FOREACH res IN openurls;
124 %]
125         <tr>
126             <td class='rdetail_openurl_entry'><a href="[% res.target_url %]">[% res.public_name | html %]</a></td>
127             <td>[% res.target_coverage | html %]
128             [%- IF res.target_embargo != '';
129                     ' - ';
130                     res.target_embargo | html;
131                 END;
132             -%]
133             </td>
134         </tr>
135     [%- END %]
136     </tbody></table>
137     </div>    
138 [%- END %]
139 [%- END %]
140 [%- merged_uris = args.uris.merge(args.online_res);
141 num_uris = merged_uris.size;
142 IF num_uris > 0;
143 -%]
144 <h2 class="rdetail_uris">[% l("Electronic resources") %]</h2>
145 <div class="rdetail_uris">
146     [%- IF num_uris > 1 %]<ul>[% END %]
147     [%- FOR uri IN merged_uris %]
148         [%- IF num_uris == 1 -%]
149             <p class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
150         [%- ELSE -%]
151             <li class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
152         [%- END -%]
153         <a href="[% uri.href %]" class="uri_link" property="url">
154         [%- IF uri.href != uri.link;
155                 '<span property="description">' _ uri.link _ '</span>';
156             ELSE;
157                 uri.link;
158             END;
159         -%]
160         </a>
161         [%- ' - <span property="description">' _ uri.note _ '</span>' IF uri.note %]
162         <link property="availability" href="http://schema.org/OnlineOnly" />
163         [%- IF attrs.gtin13; '<meta property="gtin13" content="' _ attrs.gtin13 _ '" />'; END; %]
164         [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
165     [%- END %]
166     [%- IF num_uris > 1 %]</ul>[% END %]
167 </div>
168 [%- END %]
169 <div id="copy_hold_counts">
170 [%-
171 # Hold/copy summary
172 IF ctx.copy_summary.0.count;
173 INCLUDE "opac/parts/record/copy_counts.tt2";
174 %]
175     <span id="rdetail_hold_counts">
176         <h2>[% l('Current holds') %]</h2>
177         <p>
178             [% 
179                 # If org hiding is enabled/relevant, only show 
180                 # counts for copies within the hiding scope.
181                 count_entry = 0;
182                 FOR count_chunk IN ctx.copy_summary;
183                     IF ctx.org_within_hiding_scope(count_chunk.org_unit);
184                         # always true when hiding is disabled
185                         LAST;
186                     END;
187                     count_entry = count_entry + 1;
188                 END;
189                 l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
190                     ctx.record_hold_count, ctx.copy_summary.$count_entry.count) 
191             %]
192         </p>
193     </span>
194 [%- END %]
195 <div id="metarecord_population">
196 [%-
197 # l( 'mmr id = ' _ ctx.mmr_id );
198 # l( 'mmr data = ' _ ctx.mmr_data );
199 mmr_attrs = {marc_xml => ctx.mmr_data.marc_xml};
200 PROCESS get_marc_attrs args=mmr_attrs;
201
202 IF args.mmr_unique_bib.size > 1;
203 %]
204 <h3>View Other Formats and Editions</h3>
205 <span class="metarecord_population_format">
206 [%- IF mmr_attrs.format_label;
207     FOR format IN mmr_attrs.all_formats;
208
209         link = mkurl(ctx.opac_root _ '/record/' _ format.source_bibs.0);
210         IF format.source_bibs.size > 1;
211             link = mkurl( ctx.opac_root _ '/results', { modifier => 'metabib', metarecord => ctx.mmr_id, 'fi:icon_format' => format.search_format, 'fi:from_metarecord' => ctx.mmr_id }, stop_parms.merge(expert_search_parms, general_search_parms, browse_search_parms, facet_search_parms, ['qtype','fi:search_format','fi:icon_format','fi:item_lang','fi:from_metarecord']) );
212         END; -%]
213         <span class="metarecord_population_span_link">
214             <a href="[%- l( link ) %]">
215         [% format.label | html %]
216         ([%- l( format.source_bibs.size ) %])
217         </a></span><br />
218
219     [%- END %]
220     </span>
221     [%- IF mmr_attrs.all_lang.size > 0 %]
222     <span class="metarecord_population_item_lang">
223     [% FOR lang IN mmr_attrs.all_lang;
224         link = mkurl(ctx.opac_root _ '/record/' _ lang.source_bibs.0);
225         IF lang.source_bibs.size > 1;
226             USE url(ctx.opac_root _ '/results');
227             link = mkurl( ctx.opac_root _ '/results', { modifier => 'metabib', metarecord => ctx.mmr_id, 'fi:item_lang' => lang.search_format, 'fi:from_metarecord' => ctx.mmr_id }, stop_parms.merge(expert_search_parms, general_search_parms, browse_search_parms, facet_search_parms, ['qtype','fi:search_format','fi:icon_format','fi:item_lang','fi:from_metarecord']) );
228         END; -%]
229         <span class="metarecord_population_span_link">
230             <a href="[%- l( link ) %]">
231         [% lang.label | html %]
232         ([%- l( lang.source_bibs.size ) %])
233         </a></span><br />
234     [%- END %]
235     </span> <!-- metarecord_population_item_lang -->
236 [%- END %]
237 <div class="metarecord_population_all">
238     [%
239     link = mkurl( ctx.opac_root _ '/results', { modifier => 'metabib', metarecord => ctx.mmr_id, 'fi:from_metarecord' => ctx.mmr_id }, stop_parms.merge(expert_search_parms, general_search_parms, browse_search_parms, facet_search_parms, ['qtype','fi:search_format','fi:icon_format','fi:item_lang','fi:from_metarecord'] ) );
240     %]
241     <span class="metarecord_population_span_link">
242         <a href="[%- l( link ) %]">View all [%- args.mmr_unique_bib.size %] formats and editions
243         </a></span><br />
244 </div>
245 [%- END;
246 END # ending tag for IF args.mmr_unique_bib.size > 1; %]
247 </div> <!-- metarecord_population -->
248 [%-
249 IF ctx.copy_summary.0.count;
250 INCLUDE "opac/parts/record/copy_table.tt2" copies=ctx.copies;
251 END;
252  %]
253 </div>
254
255 <h2 id='rdetail_record_details'>[% l("Record details") %]</h2>
256 <ul>
257     [%- IF attrs.isbns.0;
258           FOR isbn IN attrs.isbns;
259             isbn_extra = '';
260             IF (matches = isbn.match('^(.+?)(\s.+)$'));
261               isbn = matches.0;
262               isbn_extra = matches.1;
263             END;
264     %]
265     <li class='rdetail_isbns'>
266         <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
267         <span class='rdetail_value' property='isbn'>[% isbn | html  %]</span>[% isbn_extra | html %]
268     </li>
269         [%- END %]
270     [%- END %]
271     [%- IF attrs.issns.0; FOR issn IN attrs.issns %]
272     <li class='rdetail_issns'>
273         <strong class='rdetail_label'>[% l('ISSN:'); %]</strong>
274         <span class='rdetail_value'>[% issn | html  %]</span>
275     </li>
276         [%- END %]
277     [%- END %]
278     [%- IF attrs.phys_desc %]
279     <li id='rdetail_phys_desc'>
280         <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
281         <span class='rdetail_value'>[% attrs.phys_desc | html %]</span>
282     </li>
283     [%- END %]
284     [%- IF attrs.edition %]
285     <li id='rdetail_edition'>
286         <strong class='rdetail_label'>[% l("Edition:") %]</strong>
287         <span class='rdetail_value'>[% attrs.edition | html %]</span>
288         [%-
289         FOR entry IN attrs.graphic_editions;
290             FOR alt IN entry.graphic;
291                 diratt = "";
292                 IF alt.dir;
293                     diratt = ' dir="' _ alt.dir _ '"';
294                 END;
295         -%]
296         <div class="graphic880 rdetail_value"[% diratt %]>
297             [% alt.value | html %]
298         </div>
299         [%-
300             END;
301         END;
302         -%]
303     </li>
304     [%- END %]
305     [%- IF attrs.publisher %]
306     <li id='rdetail_publisher'>
307         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
308         <span class='rdetail_value' property="publisher" typeof="Organization">
309         [%- IF attrs.pubplace; %]
310             <span property="location">[% attrs.pubplace | html; %]</span>
311         [%- END; %]
312             <span property="name">[% attrs.publisher | html; %]</span>
313         </span>
314         [%- IF attrs.pubdate; %]
315             <span property="datePublished">[% attrs.pubdate | html; %]</span>
316         [%- END; %]
317         [%-
318         IF attrs.graphic_pubinfos.size > 0;
319             FOR entry IN attrs.graphic_pubinfos;
320                 FOR alt IN entry.graphic;
321                     diratt = "";
322                     IF alt.dir;
323                         diratt = ' dir="' _ alt.dir _ '"';
324                     END;
325         -%]
326         <div class="graphic880"[% diratt %]>
327             [% alt.value | html %]
328         </div>
329         [%-
330                 END;
331             END;
332         END
333         -%]
334     </li>
335     [%- END %]
336     [%- IF attrs.producer %]
337         <li id='rdetail_producer'>
338             <strong class='rdetail_label'>[% l("Producer:") %]</strong>
339             <span class='rdetail_value'>
340             [%- IF attrs.prodplace; %]
341                 <span>[% attrs.prodplace | html; %]</span>
342             [%- END; %]
343                 <span>[% attrs.producer | html; %]</span>
344             [%- IF attrs.proddate; %]
345                 <span>[% attrs.proddate | html; %]</span>
346             [%- END; %]
347             </span>
348         </li>
349     [%- END %]
350     [%- IF attrs.distributor %]
351         <li id='rdetail_distributor'>
352             <strong class='rdetail_label'>[% l("Distributor:") %]</strong>
353             <span class='rdetail_value'>
354             [%- IF attrs.distplace; %]
355                 <span>[% attrs.distplace | html; %]</span>
356             [%- END; %]
357                 <span>[% attrs.distributor | html; %]</span>
358             [%- IF attrs.distdate; %]
359                 <span>[% attrs.distdate | html; %]</span>
360             [%- END; %]
361             </span>
362         </li>
363     [%- END %]
364     [%- IF attrs.manufacturer %]
365         <li id='rdetail_manufacturer'>
366             <strong class='rdetail_label'>[% l("Manufacturer:") %]</strong>
367             <span class='rdetail_value' property="manufacturer" typeof="Organization">
368             [%- IF attrs.manplace; %]
369                 <span property="location">[% attrs.manplace | html; %]</span>
370             [%- END; %]
371                 <span property="name">[% attrs.manufacturer | html; %]</span>
372             [%- IF attrs.mandate; %]
373                 <span>[% attrs.mandate | html; %]</span>
374             [%- END; %]
375             </span>
376         </li>
377     [%- END %]
378     [%- IF attrs.copyright %]
379     <li id='rdetail_copyright'>
380         <strong class='rdetail_label'>[% l("Copyright:") %]</strong>
381         <span class='rdetail_value'>[% attrs.copyright | html_entity; %]
382         [%-# Provide the 4-digit year, cleansed of '@' and other junk %]
383         [%- IF attrs.copyrightYear -%]
384             <meta property='copyrightYear' content='[% attrs.copyrightYear | html; %]'>
385         [%- END -%]
386         </span>
387     </li>
388     [%- END %]
389     [%- IF (ctx.badge_scores.size > 0) %]
390     <li id='rdetail_badges'>
391         <strong class='rdetail_label'>[% l("Badges:") %]</strong>
392         <ul>
393           [% FOR bscore IN ctx.badge_scores; %]
394             <li><strong>[% bscore.badge.name | html %]</strong>: [% bscore.score %] / 5.0</li>
395         [%- END -%]
396         </ul>
397     </li>
398     [%- END %]
399 </ul>
400 [%- INCLUDE "opac/parts/record/contents.tt2" %]
401 [%- INCLUDE "opac/parts/record/subjects.tt2" %]
402 [%- INCLUDE "opac/parts/record/series.tt2" %]
403 [%- INCLUDE "opac/parts/record/extras.tt2" %]