]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/record/summary.tt2
lp1422555: Link permalink icon on record summary
[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 %]
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                 <a href="[% mkurl('', {locg =>CGI.param('locg'), copy_depth =>CGI.param('copy_depth')}, 1) %]" class="no-dec">
81                      <img src="[% ctx.media_prefix %]/images/link.png" alt="[% l('Permalink') %]" />
82                      [% l('Permalink') %]
83                 </a>
84             </div>
85         </div>
86     </div>
87 </div>
88
89 [%- IF openurl.enabled == 'true';
90     openurls = [];
91     FOREACH issn IN args.issns;
92         NEXT IF issn == '';
93         openurls = openurls.import(ResolverResolver.resolve_issn(issn, openurl.baseurl));
94     END;
95     IF openurls.size && openurls.0 != '';
96 %]
97     <div id='rdetail_openurl'>
98         <strong class='rdetail_openurl_title'>[% l("Electronic resources") %]</strong>
99         <table><tbody>
100 [%-
101         FOREACH res IN openurls;
102 %]
103         <tr>
104             <td class='rdetail_openurl_entry'><a href="[% res.target_url %]">[% res.public_name | html %]</a></td>
105             <td>[% res.target_coverage | html %]
106             [%- IF res.target_embargo != '';
107                     ' - ';
108                     res.target_embargo | html;
109                 END;
110             -%]
111             </td>
112         </tr>
113     [%- END %]
114     </tbody></table>
115     </div>    
116 [%- END %]
117 [%- END %]
118 [%- merged_uris = args.uris.merge(args.online_res);
119 num_uris = merged_uris.size;
120 IF num_uris > 0;
121 -%]
122 <h2 class="rdetail_uris">[% l("Electronic resources") %]</h2>
123 <div class="rdetail_uris">
124     [%- IF num_uris > 1 %]<ul>[% END %]
125     [%- FOR uri IN merged_uris %]
126         [%- IF num_uris == 1 -%]
127             <p class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
128         [%- ELSE -%]
129             <li class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
130         [%- END -%]
131         <a href="[% uri.href %]" property="url">
132         [%- IF uri.href != uri.link;
133                 '<span property="description">' _ uri.link _ '</span>';
134             ELSE;
135                 uri.link;
136             END;
137         -%]
138         </a>
139         [%- ' - <span property="description">' _ uri.note _ '</span>' IF uri.note %]
140         <link property="availability" href="http://schema.org/OnlineOnly" />
141         [%- IF attrs.gtin13; '<meta property="gtin13" content="' _ attrs.gtin13 _ '" />'; END; %]
142         [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
143     [%- END %]
144     [%- IF num_uris > 1 %]</ul>[% END %]
145 </div>
146 [%- END %]
147 [%- # Hold/copy summary
148     IF ctx.copy_summary.0.count
149 %]
150 <div id="copy_hold_counts">
151 [%- INCLUDE "opac/parts/record/copy_counts.tt2" %]
152     <span id="rdetail_hold_counts">
153         <h2>[% l('Current holds') %]</h2>
154         <p>
155             [% 
156                 # If org hiding is enabled/relevant, only show 
157                 # counts for copies within the hiding scope.
158                 count_entry = 0;
159                 FOR count_chunk IN ctx.copy_summary;
160                     IF ctx.org_within_hiding_scope(count_chunk.org_unit);
161                         # always true when hiding is disabled
162                         LAST;
163                     END;
164                     count_entry = count_entry + 1;
165                 END;
166                 l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
167                     ctx.record_hold_count, ctx.copy_summary.$count_entry.count) 
168             %]
169         </p>
170     </span>
171 [%- INCLUDE "opac/parts/record/copy_table.tt2" copies=ctx.copies %]
172 </div>
173 [%- END %]
174
175 <h2 id='rdetail_record_details'>[% l("Record details") %]</h2>
176 <ul>
177     [%- IF attrs.isbns.0;
178           FOR isbn IN attrs.isbns;
179             isbn_extra = '';
180             IF (matches = isbn.match('^(.+?)(\s.+)$'));
181               isbn = matches.0;
182               isbn_extra = matches.1;
183             END;
184     %]
185     <li class='rdetail_isbns'>
186         <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
187         <span class='rdetail_value' property='isbn'>[% isbn | html  %]</span>[% isbn_extra | html %]
188     </li>
189         [%- END %]
190     [%- END %]
191     [%- IF attrs.issns.0; FOR issn IN attrs.issns %]
192     <li class='rdetail_issns'>
193         <strong class='rdetail_label'>[% l('ISSN:'); %]</strong>
194         <span class='rdetail_value'>[% issn | html  %]</span>
195     </li>
196         [%- END %]
197     [%- END %]
198     [%- IF attrs.phys_desc %]
199     <li id='rdetail_phys_desc'>
200         <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
201         <span class='rdetail_value'>[% attrs.phys_desc | html %]</span>
202     </li>
203     [%- END %]
204     [%- IF attrs.edition %]
205     <li id='rdetail_edition'>
206         <strong class='rdetail_label'>[% l("Edition:") %]</strong>
207         <span class='rdetail_value'>[% attrs.edition | html %]</span>
208         [%-
209         FOR entry IN attrs.graphic_editions;
210             FOR alt IN entry.graphic;
211                 diratt = "";
212                 IF alt.dir;
213                     diratt = ' dir="' _ alt.dir _ '"';
214                 END;
215         -%]
216         <div class="graphic880 rdetail_value"[% diratt %]>
217             [% alt.value | html %]
218         </div>
219         [%-
220             END;
221         END;
222         -%]
223     </li>
224     [%- END %]
225     [%- IF attrs.publisher %]
226     <li id='rdetail_publisher'>
227         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
228         <span class='rdetail_value' property="publisher" typeof="Organization">
229         [%- IF attrs.pubplace; %]
230             <span property="location">[% attrs.pubplace | html; %]</span>
231         [%- END; %]
232             <span property="name">[% attrs.publisher | html; %]</span>
233         </span>
234         [%- IF attrs.pubdate; %]
235             <span property="datePublished">[% attrs.pubdate | html; %]</span>
236         [%- END; %]
237         [%-
238         IF attrs.graphic_pubinfos.size > 0;
239             FOR entry IN attrs.graphic_pubinfos;
240                 FOR alt IN entry.graphic;
241                     diratt = "";
242                     IF alt.dir;
243                         diratt = ' dir="' _ alt.dir _ '"';
244                     END;
245         -%]
246         <div class="graphic880"[% diratt %]>
247             [% alt.value | html %]
248         </div>
249         [%-
250                 END;
251             END;
252         END
253         -%]
254     </li>
255     [%- END %]
256     [%- IF attrs.producer %]
257         <li id='rdetail_producer'>
258             <strong class='rdetail_label'>[% l("Producer:") %]</strong>
259             <span class='rdetail_value'>
260             [%- IF attrs.prodplace; %]
261                 <span>[% attrs.prodplace | html; %]</span>
262             [%- END; %]
263                 <span>[% attrs.producer | html; %]</span>
264             [%- IF attrs.proddate; %]
265                 <span>[% attrs.proddate | html; %]</span>
266             [%- END; %]
267             </span>
268         </li>
269     [%- END %]
270     [%- IF attrs.distributor %]
271         <li id='rdetail_distributor'>
272             <strong class='rdetail_label'>[% l("Distributor:") %]</strong>
273             <span class='rdetail_value'>
274             [%- IF attrs.distplace; %]
275                 <span>[% attrs.distplace | html; %]</span>
276             [%- END; %]
277                 <span>[% attrs.distributor | html; %]</span>
278             [%- IF attrs.distdate; %]
279                 <span>[% attrs.distdate | html; %]</span>
280             [%- END; %]
281             </span>
282         </li>
283     [%- END %]
284     [%- IF attrs.manufacturer %]
285         <li id='rdetail_manufacturer'>
286             <strong class='rdetail_label'>[% l("Manufacturer:") %]</strong>
287             <span class='rdetail_value' property="manufacturer" typeof="Organization">
288             [%- IF attrs.manplace; %]
289                 <span property="location">[% attrs.manplace | html; %]</span>
290             [%- END; %]
291                 <span property="name">[% attrs.manufacturer | html; %]</span>
292             [%- IF attrs.mandate; %]
293                 <span>[% attrs.mandate | html; %]</span>
294             [%- END; %]
295             </span>
296         </li>
297     [%- END %]
298     [%- IF attrs.copyright %]
299     <li id='rdetail_copyright'>
300         <strong class='rdetail_label'>[% l("Copyright:") %]</strong>
301         <span class='rdetail_value'>[% attrs.copyright | html_entity; %]
302         [%-# Provide the 4-digit year, cleansed of '@' and other junk %]
303         [%- IF attrs.copyrightYear -%]
304             <meta property='copyrightYear' content='[% attrs.copyrightYear | html; %]'>
305         [%- END -%]
306         </span>
307     </li>
308     [%- END %]
309 </ul>
310
311 [%- INCLUDE "opac/parts/record/contents.tt2" %]
312 [%- INCLUDE "opac/parts/record/subjects.tt2" %]
313 [%- INCLUDE "opac/parts/record/series.tt2" %]
314 [%- INCLUDE "opac/parts/record/extras.tt2" %]