4a58becf8eb5117bf3ec18b45feb44338ca397a5
[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 > 0
46                         && (ctx.holds_block.enabled != 'true' || attrs.org_copy_counts.$search_ou.available == 0)
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 %]</a></td>
99             <td>[% res.target_coverage %]</td>
100         </tr>
101     [%- END %]
102     </tbody></table>
103 [%- END %]
104     </div>    
105 [%- END %]
106 [%- merged_uris = args.uris.merge(args.online_res);
107 num_uris = merged_uris.size;
108 IF num_uris > 0;
109 -%]
110 <h2 class="rdetail_uris">[% l("Electronic resources") %]</h2>
111 <div class="rdetail_uris">
112     [%- IF num_uris > 1 %]<ul>[% END %]
113     [%- FOR uri IN merged_uris %]
114         [%- IF num_uris == 1 -%]
115             <p class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
116         [%- ELSE -%]
117             <li class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
118         [%- END -%]
119         <a href="[% uri.href %]">[% uri.link %]</a>[% ' - ' _ uri.note IF uri.note %]
120         <link property="availability" href="http://schema.org/OnlineOnly" />
121         [%- IF attrs.gtin13; '<meta property="gtin13" content="' _ attrs.gtin13 _ '" />'; END; %]
122         [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
123     [%- END %]
124     [%- IF num_uris > 1 %]</ul>[% END %]
125 </div>
126 [%- END %]
127 [%- # Hold/copy summary
128     IF ctx.copy_summary.0.count
129 %]
130 <div id="copy_hold_counts">
131 [%- INCLUDE "opac/parts/record/copy_counts.tt2" %]
132     <span id="rdetail_hold_counts">
133         <h2>[% l('Current holds') %]</h2>
134         <p>
135             [% 
136                 # If org hiding is enabled/relevant, only show 
137                 # counts for copies within the hiding scope.
138                 count_entry = 0;
139                 FOR count_chunk IN ctx.copy_summary;
140                     IF ctx.org_within_hiding_scope(count_chunk.org_unit);
141                         # always true when hiding is disabled
142                         LAST;
143                     END;
144                     count_entry = count_entry + 1;
145                 END;
146                 l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
147                     ctx.record_hold_count, ctx.copy_summary.$count_entry.count) 
148             %]
149         </p>
150     </span>
151 [%- INCLUDE "opac/parts/record/copy_table.tt2" copies=ctx.copies %]
152 </div>
153 [%- END %]
154
155 <h2 id='rdetail_record_details'>[% l("Record details") %]</h2>
156 <ul>
157     [%- IF attrs.isbns.0; FOR isbn IN attrs.isbns %]
158     <li class='rdetail_isbns'>
159         <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
160         <span class='rdetail_value' property='isbn'>[% isbn | html  %]</span>
161     </li>
162         [%- END %]
163     [%- END %]
164     [%- IF attrs.issns.0; FOR issn IN attrs.issns %]
165     <li class='rdetail_issns'>
166         <strong class='rdetail_label'>[% l('ISSN:'); %]</strong>
167         <span class='rdetail_value'>[% issn | html  %]</span>
168     </li>
169         [%- END %]
170     [%- END %]
171     [%- IF attrs.phys_desc %]
172     <li id='rdetail_phys_desc'>
173         <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
174         <span class='rdetail_value'>[% attrs.phys_desc | html %]</span>
175     </li>
176     [%- END %]
177     [%- IF attrs.edition %]
178     <li id='rdetail_edition'>
179         <strong class='rdetail_label'>[% l("Edition:") %]</strong>
180         <span class='rdetail_value'>[% attrs.edition | html %]</span>
181         [%-
182         FOR entry IN attrs.graphic_editions;
183             FOR alt IN entry.graphic;
184                 diratt = "";
185                 IF alt.dir;
186                     diratt = ' dir="' _ alt.dir _ '"';
187                 END;
188         -%]
189         <div class="graphic880 rdetail_value"[% diratt %]>
190             [% alt.value | html %]
191         </div>
192         [%-
193             END;
194         END;
195         -%]
196     </li>
197     [%- END %]
198     [%- IF attrs.publisher %]
199     <li id='rdetail_publisher'>
200         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
201         <span class='rdetail_value' property="publisher" typeof="Organization">
202         [%- IF attrs.pubplace; %]
203             <span property="location">[% attrs.pubplace | html; %]</span>
204         [%- END; %]
205             <span property="name">[% attrs.publisher | html; %]</span>
206         </span>
207         [%- IF attrs.pubdate; %]
208             <span property="datePublished">[% attrs.pubdate | html; %]</span>
209         [%- END; %]
210         [%-
211         IF attrs.graphic_pubinfos.size > 0;
212             FOR entry IN attrs.graphic_pubinfos;
213                 FOR alt IN entry.graphic;
214                     diratt = "";
215                     IF alt.dir;
216                         diratt = ' dir="' _ alt.dir _ '"';
217                     END;
218         -%]
219         <div class="graphic880"[% diratt %]>
220             [% alt.value | html %]
221         </div>
222         [%-
223                 END;
224             END;
225         END
226         -%]
227     </li>
228     [%- END %]
229 </ul>
230
231 [%- INCLUDE "opac/parts/record/contents.tt2" %]
232 [%- INCLUDE "opac/parts/record/subjects.tt2" %]
233 [%- INCLUDE "opac/parts/record/series.tt2" %]
234 [%- INCLUDE "opac/parts/record/extras.tt2" %]