]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/record/summary.tt2
LP#1744385: Add highlighting for ISBN and ISSN
[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">[% IF attrs.hl.title; attrs.hl.title; ELSE; attrs.title_extended | html; END %]</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         [%- IF obalkyknih_cz.enabled == 'true' %]
30         [%- 
31             isbnissn = '';
32             IF attrs.isbns.0;
33                     isbnissn = attrs.isbns.0;
34                     IF (matches = isbnissn.match('^(.+?)(\s.+)$'));
35                         isbnissn = matches.0;
36                     END;
37                 END;
38             IF attrs.issns.0;
39                 isbnissn=attrs.issns.0;
40             END;
41         %]
42         <a href='http://obalkyknih.cz/view?isbn=[% isbnissn %]'>
43             <img
44               alt="[% l('Image of item') %]" id='rdetail_image'
45               src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' />
46         </a>
47         [%  ELSE %]
48             <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/r/[% ctx.bre_id | uri %]'><img
49                     alt="[% l('Image of item') %]" id='rdetail_image'
50                     src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' />
51             </a>
52         [%- END %]
53         <br />
54     </div>
55     <div id="format_actions">
56
57
58         [%- IF attrs.format_label %]
59           [% FOR format IN attrs.all_formats %]
60               <img title="[% format.label | html %]" 
61                   alt="[% format.label | html %]" 
62                   src="[% format.icon %]" /> 
63               [% format.label | html %]
64           [% END %]
65         [%- END %]
66
67         <div id="rdetail_actions_div">
68             [%- search_ou = ctx.search_ou;
69                 IF ctx.place_unfillable ||
70                     ( attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size
71                         && (ctx.holds_block.enabled != 'true' || !attrs.org_copy_counts.$search_ou.available)
72                     )
73              %]
74             <div class="rdetail_aux_utils place_hold">
75                 <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
76                     {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]" 
77                 class="no-dec" rel="nofollow" vocab=""><img src="[% ctx.media_prefix %]/images/green_check.png[% ctx.cache_key %]"
78                     [% img_alt(l('Place Hold on [_1]', attrs.title)) %]/>
79                 <span class="place_hold">[% l('Place Hold') %]</span></a>
80             </div>
81             [%- END -%]
82
83             [%- IF ebook_api.enabled == 'true' && args.ebook %]
84             <div id="[%- ctx.bre_id -%]_ebook_checkout" class="rdetail_aux_utils ebook_action hidden">
85                 <a href="[% mkurl(ctx.opac_root _ '/myopac/ebook_checkout',
86                     {title => args.ebook.ebook_id, vendor => args.ebook.vendor, action => 'checkout'}, stop_parms) %]"
87                 class="no-dec" rel="nofollow" vocab=""><img src="[% ctx.media_prefix %]/images/green_check.png[% ctx.cache_key %]"
88                     [% img_alt(l('Check Out [_1]', attrs.title)) %]/>
89                 <span class="place_hold">[% l('Check Out E-Item') %]</span></a>
90             </div>
91             <div id="[%- ctx.bre_id -%]_ebook_place_hold" class="rdetail_aux_utils ebook_action hidden">
92                 <a href="[% mkurl(ctx.opac_root _ '/myopac/ebook_place_hold',
93                     {title => args.ebook.ebook_id, vendor => args.ebook.vendor, action => 'place_hold'}, stop_parms) %]"
94                 class="no-dec" rel="nofollow" vocab=""><img src="[% ctx.media_prefix %]/images/green_check.png[% ctx.cache_key %]"
95                     [% img_alt(l('Place Hold on [_1]', attrs.title)) %]/>
96                 <span class="place_hold">[% l('Place Hold on E-Item') %]</span></a>
97             </div>
98             [%- END -%]
99
100             <div class="rdetail_aux_utils toggle_list">
101         [% IF !ctx.is_staff %]
102             [%  IF ctx.user;
103                 INCLUDE "opac/parts/bookbag_actions.tt2";
104             %]
105             [%  ELSE;
106                 operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
107                 label = (operation == "add") ? l("Add to my list") : l("Remove from my list");
108             %]
109                 <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}, stop_parms) %]" class="no-dec" rel="nofollow" vocab="">
110                     <img src="[% ctx.media_prefix %]/images/clipboard.png[% ctx.cache_key %]" alt="" />
111                     [% label %]
112                 </a>
113             [% END %]
114         [% END %]
115             </div>
116             <div class="rdetail_aux_utils toggle_list">
117                      [% IF ctx.mylist.size %]
118                         [%- IF ctx.user; %]
119                         <a href="[% mkurl(ctx.opac_root _ '/myopac/lists') %]" class="no-dec" rel="nofollow" vocab=""><img src="[% ctx.media_prefix %]/images/clipboard.png[% ctx.cache_key %]" alt="[% l('View My Lists') %]" />[% l(' View My Lists') %]</a>
120                         [%- ELSE %]
121                         <a href="[% mkurl(ctx.opac_root _ '/mylist') %]" class="no-dec" rel="nofollow" vocab=""><img src="[% ctx.media_prefix %]/images/clipboard.png[% ctx.cache_key %]" alt="[% l('View My Temporary List') %]" />[% l(' View My Temporary List') %]</a>
122                         [%- END %]
123                     [% END %]
124                 </div>
125                 <div class="rdetail_aux_utils">
126                     <img src="[% ctx.media_prefix %]/images/clipboard.png[% ctx.cache_key %]" alt="[% l('Print / Email Actions Image') %]" />
127                     <a href="[% mkurl(ctx.opac_root _ '/record/print/' _ ctx.bre_id) %]" class="no-dec" rel="nofollow" vocab="">[% l('Print') %]</a> /
128                     <a href="[% mkurl(ctx.opac_root _ '/record/email/' _ ctx.bre_id) %]" class="no-dec" rel="nofollow" vocab="">[% l('Email') %]</a>
129                 </div>
130                 [%- IF ctx.refworks.enabled == 'true' %]
131                     [%- INCLUDE 'opac/parts/record/refworks.tt2' %]
132                 [%- END %]
133             [% IF !ctx.is_staff %]
134                 <div class="rdetail_aux_utils share_record">
135                     <a href="[% mkurl('', {locg =>CGI.param('locg'), copy_depth =>CGI.param('copy_depth')}, 1) %]" class="no-dec">
136                          <img src="[% ctx.media_prefix %]/images/link.png[% ctx.cache_key %]" alt="[% l('Permalink') %]" />
137                          [% l('Permalink') %]
138                     </a>
139                 </div>
140             [% END %]
141             [% IF !search.no_highlight %]
142             <div class="rdetail_aux_utils highlighting">
143               [% IF CGI.param('no_highlight') %]
144                 <a href="[% mkurl('', {}, ['no_highlight']) %]" class="no-dec">
145               [% ELSE %]
146                 <a href="[% mkurl('', {no_highlight => '1'}) %]" class="no-dec">
147               [% END %]
148                      <img src="[% ctx.media_prefix %]/images/highlight.png[% ctx.cache_key %]" alt="[% l('Toggle highlighting') %]" />
149                      [% CGI.param('no_highlight') ?  l('Enable Highlighting') : l('Disable Highlighting') %]
150                 </a>
151             </div>
152             [% END %]
153             [%- IF ctx.is_staff %]
154             <div class="rdetail_aux_utils clear_addedcontent_cache">
155                 <a href="[% ctx.media_prefix %]/opac/extras/ac/clearcache/all/r/[% ctx.bre_id | uri %]" class="no-dec" target="_blank">
156                      [% l('Clear AddedContent Cache') %]
157                 </a>
158             </div>
159             [%- END %]
160         </div>
161     </div>
162 </div>
163
164 [%- IF openurl.enabled == 'true';
165     openurls = [];
166     FOREACH issn IN args.issns;
167         NEXT IF issn == '';
168         openurls = openurls.import(ResolverResolver.resolve_issn(issn, openurl.baseurl));
169     END;
170     IF openurls.size && openurls.0 != '';
171 %]
172     <div id='rdetail_openurl'>
173         <strong class='rdetail_openurl_title'>[% l("Electronic resources") %]</strong>
174         <table><tbody>
175 [%-
176         FOREACH res IN openurls;
177 %]
178         <tr>
179             <td class='rdetail_openurl_entry'><a href="[% res.target_url %]">[% res.public_name | html %]</a></td>
180             <td>[% res.target_coverage | html %]
181             [%- IF res.target_embargo != '';
182                     ' - ';
183                     res.target_embargo | html;
184                 END;
185             -%]
186             </td>
187         </tr>
188     [%- END %]
189     </tbody></table>
190     </div>    
191 [%- END %]
192 [%- END %]
193 [%- merged_uris = args.uris.merge(args.online_res);
194 num_uris = merged_uris.size;
195 IF num_uris > 0;
196 -%]
197 <h2 class="rdetail_uris">[% l("Electronic resources") %]</h2>
198 <div class="rdetail_uris">
199     [%- IF num_uris > 1 %]<ul>[% END %]
200     [%- FOR uri IN merged_uris %]
201         [%- IF num_uris == 1 -%]
202             <p class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
203         [%- ELSE -%]
204             <li class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
205         [%- END -%]
206         <a href="[% uri.href %]" class="uri_link" property="url">
207         [%- IF uri.href != uri.link;
208                 '<span property="description">' _ uri.link _ '</span>';
209             ELSE;
210                 uri.link;
211             END;
212         -%]
213         </a>
214         [%- ' - <span property="description">' _ uri.note _ '</span>' IF uri.note %]
215         <link property="availability" href="http://schema.org/OnlineOnly" />
216         [%- IF attrs.gtin13; '<meta property="gtin13" content="' _ attrs.gtin13 _ '" />'; END; %]
217         [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
218     [%- END %]
219     [%- IF num_uris > 1 %]</ul>[% END %]
220 </div>
221 [%
222 IF ebook_api.enabled == 'true';
223     INCLUDE "opac/parts/ebook_api/avail.tt2";
224 END;
225 %]
226 [%- END %]
227 <div id="copy_hold_counts">
228 [%-
229 # Hold/copy summary
230 IF ctx.copy_summary.0.count;
231 INCLUDE "opac/parts/record/copy_counts.tt2";
232 %]
233     <span id="rdetail_hold_counts">
234         <h2>[% l('Current holds') %]</h2>
235         <p>
236             [% 
237                 # If org hiding is enabled/relevant, only show 
238                 # counts for copies within the hiding scope.
239                 count_entry = 0;
240                 FOR count_chunk IN ctx.copy_summary;
241                     IF ctx.org_within_hiding_scope(count_chunk.org_unit);
242                         # always true when hiding is disabled
243                         LAST;
244                     END;
245                     count_entry = count_entry + 1;
246                 END;
247                 l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
248                     ctx.record_hold_count, ctx.copy_summary.$count_entry.count) 
249             %]
250         </p>
251     </span>
252 [%- END %]
253 <div id="metarecord_population">
254 [%-
255 # l( 'mmr id = ' _ ctx.mmr_id );
256 # l( 'mmr data = ' _ ctx.mmr_data );
257 mmr_attrs = {marc_xml => ctx.mmr_data.marc_xml};
258 PROCESS get_marc_attrs args=mmr_attrs;
259
260 IF args.mmr_unique_bib.size > 1;
261 %]
262 <h3>[% l("View other formats and editions") %]</h3>
263 <span class="metarecord_population_format">
264 [%- IF mmr_attrs.format_label;
265     FOR format IN mmr_attrs.all_formats;
266
267         link = mkurl(ctx.opac_root _ '/record/' _ format.source_bibs.0);
268         IF format.source_bibs.size > 1;
269             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']) );
270         END; -%]
271         <span class="metarecord_population_span_link">
272             <a href="[%- l( link ) %]">
273         [% format.label | html %]
274         ([%- l( format.source_bibs.size ) %])
275         </a></span><br />
276
277     [%- END %]
278     </span>
279     [%- IF mmr_attrs.all_lang.size > 0 %]
280     <span class="metarecord_population_item_lang">
281     [% FOR lang IN mmr_attrs.all_lang;
282         link = mkurl(ctx.opac_root _ '/record/' _ lang.source_bibs.0);
283         IF lang.source_bibs.size > 1;
284             USE url(ctx.opac_root _ '/results');
285             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']) );
286         END; -%]
287         <span class="metarecord_population_span_link">
288             <a href="[%- l( link ) %]">
289         [% lang.label | html %]
290         ([%- l( lang.source_bibs.size ) %])
291         </a></span><br />
292     [%- END %]
293     </span> <!-- metarecord_population_item_lang -->
294 [%- END %]
295 <div class="metarecord_population_all">
296     [%
297     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'] ) );
298     %]
299     <span class="metarecord_population_span_link">
300         <a href="[%- l( link ) %]">[% l("View all formats and editions ") %] ([%- args.mmr_unique_bib.size %]) 
301         </a></span><br />
302 </div>
303 [%- END;
304 END # ending tag for IF args.mmr_unique_bib.size > 1; %]
305 </div> <!-- metarecord_population -->
306 [%-
307 IF ctx.copy_summary.0.count;
308 INCLUDE "opac/parts/record/copy_table.tt2" copies=ctx.copies;
309 END;
310  %]
311 </div>
312
313 <h2 id='rdetail_record_details'>[% l("Record details") %]</h2>
314 <ul>
315     [%- IF attrs.hl.isbn.size; FOR isbn IN attrs.hl.isbn %]
316     <li class='rdetail_isbns'>
317         <strong class='rdetail_label'>[% l('ISBN:'); %]</strong> [% isbn %]
318     </li>
319     [%- END; ELSIF attrs.isbns.0;
320           FOR isbn IN attrs.isbns;
321             isbn_extra = '';
322             IF (matches = isbn.match('^(.+?)(\s.+)$'));
323               isbn = matches.0;
324               isbn_extra = matches.1;
325             END;
326     %]
327     <li class='rdetail_isbns'>
328         <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
329         <span class='rdetail_value' property='isbn'>[% isbn | html  %]</span>[% isbn_extra | html %]
330     </li>
331         [%- END %]
332     [%- END %]
333     [%- IF attrs.hl.issn.size; FOR issn IN attrs.hl.issn %]
334     <li class='rdetail_issns'>
335         <strong class='rdetail_label'>[% l('ISSN:'); %]</strong> [% issn %]
336     </li>
337     [%- END; ELSIF attrs.issns.0; FOR issn IN attrs.issns %]
338     <li class='rdetail_issns'>
339         <strong class='rdetail_label'>[% l('ISSN:'); %]</strong>
340         <span class='rdetail_value'>[% issn | html  %]</span>
341     </li>
342         [%- END %]
343     [%- END %]
344     [%- IF attrs.hl.physical_description.size %]
345     <li id='rdetail_phys_desc'>
346         <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
347         <span class='rdetail_value' highlighted='true'>[% attrs.hl.physical_description.join('<br/>') %]</span>
348     </li>
349     [%- ELSIF attrs.phys_desc %]
350     <li id='rdetail_phys_desc'>
351         <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
352         <span class='rdetail_value'>[% attrs.phys_desc | html %]</span>
353     </li>
354     [%- END %]
355     [%- IF attrs.hl.edition %]
356     <li id='rdetail_edition'>
357         <strong class='rdetail_label'>[% l("Edition:") %]</strong>
358         <span class='rdetail_value' highlighted='true'>[% attrs.hl.edition %]</span>
359     [%- ELSIF attrs.edition %]
360     <li id='rdetail_edition'>
361         <strong class='rdetail_label'>[% l("Edition:") %]</strong>
362         <span class='rdetail_value'>[% attrs.edition | html %]</span>
363         [%-
364         FOR entry IN attrs.graphic_editions;
365             FOR alt IN entry.graphic;
366                 diratt = "";
367                 IF alt.dir;
368                     diratt = ' dir="' _ alt.dir _ '"';
369                 END;
370         -%]
371         <div class="graphic880 rdetail_value"[% diratt %]>
372             [% alt.value | html %]
373         </div>
374         [%-
375             END;
376         END;
377         -%]
378     </li>
379     [%- END %]
380     [%- IF attrs.hl.publisher %]
381     <li id='rdetail_publisher'>
382         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
383         <span class='rdetail_value' highlighted='true'>[% attrs.hl.publisher %]</span>
384     </li>
385     [%- ELSIF attrs.publisher %]
386     <li id='rdetail_publisher'>
387         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
388         <span class='rdetail_value' property="publisher" typeof="Organization">
389         [%- IF attrs.pubplace; %]
390             <span property="location">[% attrs.pubplace | html; %]</span>
391         [%- END; %]
392             <span property="name">[% attrs.publisher | html; %]</span>
393         </span>
394         [%- IF attrs.pubdate; %]
395             <span property="datePublished">[% attrs.pubdate | html; %]</span>
396         [%- END; %]
397         [%-
398         IF attrs.graphic_pubinfos.size > 0;
399             FOR entry IN attrs.graphic_pubinfos;
400                 FOR alt IN entry.graphic;
401                     diratt = "";
402                     IF alt.dir;
403                         diratt = ' dir="' _ alt.dir _ '"';
404                     END;
405         -%]
406         <div class="graphic880"[% diratt %]>
407             [% alt.value | html %]
408         </div>
409         [%-
410                 END;
411             END;
412         END
413         -%]
414     </li>
415     [%- END %]
416     [%- IF attrs.producer %]
417         <li id='rdetail_producer'>
418             <strong class='rdetail_label'>[% l("Producer:") %]</strong>
419             <span class='rdetail_value'>
420             [%- IF attrs.prodplace; %]
421                 <span>[% attrs.prodplace | html; %]</span>
422             [%- END; %]
423                 <span>[% attrs.producer | html; %]</span>
424             [%- IF attrs.proddate; %]
425                 <span>[% attrs.proddate | html; %]</span>
426             [%- END; %]
427             </span>
428         </li>
429     [%- END %]
430     [%- IF attrs.distributor %]
431         <li id='rdetail_distributor'>
432             <strong class='rdetail_label'>[% l("Distributor:") %]</strong>
433             <span class='rdetail_value'>
434             [%- IF attrs.distplace; %]
435                 <span>[% attrs.distplace | html; %]</span>
436             [%- END; %]
437                 <span>[% attrs.distributor | html; %]</span>
438             [%- IF attrs.distdate; %]
439                 <span>[% attrs.distdate | html; %]</span>
440             [%- END; %]
441             </span>
442         </li>
443     [%- END %]
444     [%- IF attrs.manufacturer %]
445         <li id='rdetail_manufacturer'>
446             <strong class='rdetail_label'>[% l("Manufacturer:") %]</strong>
447             <span class='rdetail_value' property="manufacturer" typeof="Organization">
448             [%- IF attrs.manplace; %]
449                 <span property="location">[% attrs.manplace | html; %]</span>
450             [%- END; %]
451                 <span property="name">[% attrs.manufacturer | html; %]</span>
452             [%- IF attrs.mandate; %]
453                 <span>[% attrs.mandate | html; %]</span>
454             [%- END; %]
455             </span>
456         </li>
457     [%- END %]
458     [%- IF attrs.copyright %]
459     <li id='rdetail_copyright'>
460         <strong class='rdetail_label'>[% l("Copyright:") %]</strong>
461         <span class='rdetail_value'>[% attrs.copyright | html_entity; %]
462         [%-# Provide the 4-digit year, cleansed of '@' and other junk %]
463         [%- IF attrs.copyrightYear -%]
464             <meta property='copyrightYear' content='[% attrs.copyrightYear | html; %]'>
465         [%- END -%]
466         </span>
467     </li>
468     [%- END %]
469     [%- IF (ctx.badge_scores.size > 0) %]
470     <li id='rdetail_badges'>
471         <strong class='rdetail_label'>[% l("Badges:") %]</strong>
472         <ul>
473           [% FOR bscore IN ctx.badge_scores; %]
474             <li><strong>[% bscore.badge.name | html %]</strong>: [% bscore.score %] / 5.0</li>
475         [%- END -%]
476         </ul>
477     </li>
478     [%- END %]
479 </ul>
480 [%- INCLUDE "opac/parts/record/contents.tt2" %]
481 [%- INCLUDE "opac/parts/record/subjects.tt2" %]
482 [%- INCLUDE "opac/parts/record/series.tt2" %]
483 [%- INCLUDE "opac/parts/record/extras.tt2" %]