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