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