c6e3b7c3ae636be48ac2e261646f031f6c06f83e
[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         <div id="rdetail_format_label">
36             <img alt="[% attrs.format_label %]" title="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" /> [%- attrs.format_label -%]
37         </div>
38         [%- END %]
39         <div id="rdetail_actions_div">
40             [%- search_ou = ctx.search_ou;
41                 IF ctx.place_unfillable ||
42                     ( attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size > 0
43                         && (ctx.holds_block.enabled != 'true' || attrs.org_copy_counts.$search_ou.available == 0)
44                     )
45              %]
46             <div class="rdetail_aux_utils place_hold">
47                 <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
48                     {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]" 
49                 class="no-dec"><img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" /><span 
50                 class="place_hold">[% l('Place Hold') %]</span></a>
51             </div>
52             [%- END -%]
53             <div class="rdetail_aux_utils toggle_list">
54             [%  IF ctx.user;
55                 INCLUDE "opac/parts/bookbag_actions.tt2";
56             %]
57             [%  ELSE;
58                 operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
59                 label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); 
60             %]
61                 <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}, stop_parms) %]" class="no-dec">
62                     <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
63                     [% label %]
64                 </a>
65             [% END %]
66             </div>
67             <div class="rdetail_aux_utils">
68                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
69                 <a href="[% mkurl(ctx.opac_root _ '/record/print/' _ ctx.bre_id) %]" class="no-dec">[% l('Print') %]</a> /
70                 <a href="[% mkurl(ctx.opac_root _ '/record/email/' _ ctx.bre_id) %]" class="no-dec">[% l('Email') %]</a>
71             </div>
72             [%- IF ctx.refworks.enabled == 'true' %]
73                 [%- INCLUDE 'opac/parts/record/refworks.tt2' %]
74             [%- END %]
75         </div>
76     </div>
77 </div>
78
79 [%- IF openurl.enabled == 'true';
80     openurls = [];
81     FOREACH issn IN args.issns;
82         NEXT IF issn == '';
83         openurls = openurls.import(ResolverResolver.resolve_issn(issn, openurl.baseurl));
84     END;
85     IF openurls.size && openurls.0 != '';
86 %]
87     <div id='rdetail_openurl'>
88         <strong class='rdetail_openurl_title'>[% l("Electronic resources") %]</strong>
89         <table><tbody>
90 [%-
91         FOREACH res IN openurls;
92 %]
93         <tr>
94             <td class='rdetail_openurl_entry'><a href="[% res.target_url %]">[% res.public_name %]</a></td>
95             <td>[% res.target_coverage %]</td>
96         </tr>
97     [%- END %]
98     </tbody></table>
99 [%- END %]
100     </div>    
101 [%- END %]
102 [%- merged_uris = args.uris.merge(args.online_res);
103 num_uris = merged_uris.size;
104 IF num_uris > 0;
105 -%]
106 <h2 class="rdetail_uris">[% l("Electronic resources") %]</h2>
107 <div class="rdetail_uris">
108     [%- IF num_uris > 1 %]<ul>[% END %]
109     [%- FOR uri IN merged_uris %]
110         [%- IF num_uris == 1 -%]
111             <p class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
112         [%- ELSE -%]
113             <li class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
114         [%- END -%]
115         <a href="[% uri.href %]">[% uri.link %]</a>[% ' - ' _ uri.note IF uri.note %]
116         <link property="availability" href="http://schema.org/OnlineOnly" />
117         [%- IF attrs.gtin13; '<meta property="gtin13" content="' _ attrs.gtin13 _ '" />'; END; %]
118         [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
119     [%- END %]
120     [%- IF num_uris > 1 %]</ul>[% END %]
121 </div>
122 [%- END %]
123 [%- # Hold/copy summary
124     IF ctx.copy_summary.0.count
125 %]
126 <div id="copy_hold_counts">
127 [%- INCLUDE "opac/parts/record/copy_counts.tt2" %]
128     <span id="rdetail_hold_counts">
129         <h2>[% l('Current holds') %]</h2>
130         <p>
131             [% 
132                 # If org hiding is enabled/relevant, only show 
133                 # counts for copies within the hiding scope.
134                 count_entry = 0;
135                 FOR count_chunk IN ctx.copy_summary;
136                     IF ctx.org_within_hiding_scope(count_chunk.org_unit);
137                         # always true when hiding is disabled
138                         LAST;
139                     END;
140                     count_entry = count_entry + 1;
141                 END;
142                 l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
143                     ctx.record_hold_count, ctx.copy_summary.$count_entry.count) 
144             %]
145         </p>
146     </span>
147 [%- INCLUDE "opac/parts/record/copy_table.tt2" copies=ctx.copies %]
148 </div>
149 [%- END %]
150
151 <h2 id='rdetail_record_details'>[% l("Record details") %]</h2>
152 <ul>
153     [%- IF attrs.isbns.0; FOR isbn IN attrs.isbns %]
154     <li class='rdetail_isbns'>
155         <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
156         <span class='rdetail_value' property='isbn'>[% isbn | html  %]</span>
157     </li>
158         [%- END %]
159     [%- END %]
160     [%- IF attrs.issns.0; FOR issn IN attrs.issns %]
161     <li class='rdetail_issns'>
162         <strong class='rdetail_label'>[% l('ISSN:'); %]</strong>
163         <span class='rdetail_value'>[% issn | html  %]</span>
164     </li>
165         [%- END %]
166     [%- END %]
167     [%- IF attrs.phys_desc %]
168     <li id='rdetail_phys_desc'>
169         <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
170         <span class='rdetail_value'>[% attrs.phys_desc | html %]</span>
171     </li>
172     [%- END %]
173     [%- IF attrs.edition %]
174     <li id='rdetail_edition'>
175         <strong class='rdetail_label'>[% l("Edition:") %]</strong>
176         <span class='rdetail_value'>[% attrs.edition | html %]</span>
177         [%-
178         FOR entry IN attrs.graphic_editions;
179             FOR alt IN entry.graphic;
180                 diratt = "";
181                 IF alt.dir;
182                     diratt = ' dir="' _ alt.dir _ '"';
183                 END;
184         -%]
185         <div class="graphic880 rdetail_value"[% diratt %]>
186             [% alt.value | html %]
187         </div>
188         [%-
189             END;
190         END;
191         -%]
192     </li>
193     [%- END %]
194     [%- IF attrs.publisher %]
195     <li id='rdetail_publisher'>
196         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
197         <span class='rdetail_value' property="publisher" typeof="Organization">
198         [%- IF attrs.pubplace; %]
199             <span property="location">[% attrs.pubplace | html; %]</span>
200         [%- END; %]
201             <span property="name">[% attrs.publisher | html; %]</span>
202         </span>
203         [%- IF attrs.pubdate; %]
204             <span property="datePublished">[% attrs.pubdate | html; %]</span>
205         [%- END; %]
206         [%-
207         IF attrs.graphic_pubinfos.size > 0;
208             FOR entry IN attrs.graphic_pubinfos;
209                 FOR alt IN entry.graphic;
210                     diratt = "";
211                     IF alt.dir;
212                         diratt = ' dir="' _ alt.dir _ '"';
213                     END;
214         -%]
215         <div class="graphic880"[% diratt %]>
216             [% alt.value | html %]
217         </div>
218         [%-
219                 END;
220             END;
221         END
222         -%]
223     </li>
224     [%- END %]
225 </ul>
226
227 [%- INCLUDE "opac/parts/record/contents.tt2" %]
228 [%- INCLUDE "opac/parts/record/subjects.tt2" %]
229 [%- INCLUDE "opac/parts/record/series.tt2" %]
230 [%- INCLUDE "opac/parts/record/extras.tt2" %]