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