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