]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/parts/record/summary.tt2
Block "Place Hold" link in TPAC if item is available
[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 [%- IF ctx.refworks.enabled == 'true' %]
9     [% INCLUDE 'opac/parts/record/refworks.tt2' %]
10 [%- END %]
11
12 <hr />
13
14 [%-# This holds the record summary information %]
15 <div id="rdetail_summary_header">
16     <div id="rdetail_image_div">
17         [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
18         <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/[% ident | uri %]'><img
19             alt="[% l('Image of item') %]" id='rdetail_image'
20             src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/[% ident | uri %]' /></a>
21         [% END %]
22         <br />
23     </div>
24
25     <div id="rdetail_actions_div">
26         [%- search_ou = ctx.search_ou;
27             IF ctx.place_unfillable ||
28                 (ctx.holds_block.enabled != 'true' &&
29                     attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size > 0
30                 ) ||
31                 (ctx.holds_block.enable == 'true' && attrs.org_copy_counts.$search_ou.available > 0)
32          %]
33         <div class="rdetail_aux_utils place_hold">
34             <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
35                 {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]" 
36             class="no-dec"><img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" /><span 
37             class="place_hold">[% l('Place Hold') %]</span></a>
38         </div>
39         [%- END -%]
40         <div class="rdetail_aux_utils toggle_list">
41         [%  IF ctx.user;
42             INCLUDE "opac/parts/bookbag_actions.tt2";
43         %]
44         [%  ELSE;
45             operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
46             label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); 
47         %]
48             <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}, stop_parms) %]" class="no-dec">
49                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
50                 [% label %]
51             </a>
52         [% END %]
53         </div>
54         <div class="rdetail_aux_utils">
55             <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
56             <a href="[% mkurl(ctx.opac_root _ '/record/print/' _ ctx.bre_id) %]" class="no-dec">[% l('Print') %]</a> /
57             <a href="[% mkurl(ctx.opac_root _ '/record/email/' _ ctx.bre_id) %]" class="no-dec">[% l('Email') %]</a>
58         </div>
59     </div>
60     <div id='rdetail_title_div'>
61         [%- IF attrs.format_icon %]
62         <div class="format_icon">
63             <img alt="[% attrs.format_label %]" title="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
64         </div>
65         [%- END %]
66         <h1 id='rdetail_title' itemprop="name">[% attrs.title_extended | html %]</h1>
67         [%- INCLUDE "opac/parts/record/authors.tt2" %]
68     </div>
69 </div>
70
71 [%- IF openurl.enabled == 'true';
72     openurls = [];
73     FOREACH issn IN args.issns;
74         NEXT IF issn == '';
75         openurls = openurls.import(ResolverResolver.resolve_issn(issn, openurl.baseurl));
76     END;
77     IF openurls.size && openurls.0 != '';
78 %]
79     <div id='rdetail_openurl'>
80         <strong class='rdetail_openurl_title'>[% l("Electronic resources") %]</strong>
81         <table><tbody>
82 [%-
83         FOREACH res IN openurls;
84 %]
85         <tr>
86             <td class='rdetail_openurl_entry'><a href="[% res.target_url %]">[% res.public_name %]</a></td>
87             <td>[% res.target_coverage %]</td>
88         </tr>
89     [%- END %]
90     </tbody></table>
91 [%- END %]
92     </div>    
93 [%- END %]
94 [%- merged_uris = args.uris.merge(args.online_res);
95 num_uris = merged_uris.size;
96 IF num_uris > 0;
97 -%]
98 <h2 class="rdetail_uris">[% l("Electronic resources") %]</h2>
99 <div class="rdetail_uris">
100     [%- IF num_uris > 1 %]<ul>[% END %]
101     [%- FOR uri IN merged_uris %]
102         [%- IF num_uris == 1 %]<p class="rdetail_uri">[% ELSE %]<li class="rdetail_uri">[% END %]
103         <a href="[% uri.href %]">[% uri.link %]</a>[% ' - ' _ uri.note IF uri.note %]
104         [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
105     [%- END %]
106     [%- IF num_uris > 1 %]</ul>[% END %]
107 </div>
108 [%- END %]
109 [%- # Hold/copy summary
110     IF ctx.copy_summary.0.count
111 %]
112 <div id="copy_hold_counts">
113 [%- INCLUDE "opac/parts/record/copy_counts.tt2" %]
114     <span id="rdetail_hold_counts">
115         <h2>[% l('Current holds') %]</h2>
116         <p>
117             [%- l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
118                 ctx.record_hold_count, ctx.copy_summary.0.count) %]
119         </p>
120     </span>
121 [%- INCLUDE "opac/parts/record/copy_table.tt2" copies=ctx.copies %]
122 </div>
123 [%- END %]
124
125 <h2 id='rdetail_record_details'>[% l("Record details") %]</h2>
126 <ul>
127     [%- IF attrs.isbns.0; FOR isbn IN attrs.isbns %]
128     <li class='rdetail_isbns'>
129         <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
130         <span class='rdetail_value' itemprop='isbn'>[% isbn | html  %]</span>
131     </li>
132         [%- END %]
133     [%- END %]
134     [%- IF attrs.issns.0; FOR issn IN attrs.issns %]
135     <li class='rdetail_issns'>
136         <strong class='rdetail_label'>[% l('ISSN:'); %]</strong>
137         <span class='rdetail_value'>[% issn | html  %]</span>
138     </li>
139         [%- END %]
140     [%- END %]
141     [%- IF attrs.phys_desc %]
142     <li id='rdetail_phys_desc'>
143         <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
144         <span class='rdetail_value'>[% attrs.phys_desc | html %]</span>
145     </li>
146     [%- END %]
147     [%- IF attrs.edition %]
148     <li id='rdetail_edition'>
149         <strong class='rdetail_label'>[% l("Edition:") %]</strong>
150         <span class='rdetail_value'>[% attrs.edition | html %]</span>
151     </li>
152     [%- END %]
153     [%- IF attrs.publisher %]
154     <li id='rdetail_publisher'>
155         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
156         <span class='rdetail_value' itemprop="publisher">[%
157             attrs.publisher | html;
158         %]</span>
159         [% IF attrs.pubdate; %]
160         <span itemprop="datePublished">[% attrs.pubdate | html; %]</span>
161         [% END; %]
162     </li>
163     [%- END %]
164 </ul>
165
166 [%- INCLUDE "opac/parts/record/subjects.tt2" %]
167 [%- INCLUDE "opac/parts/record/series.tt2" %]
168 [%- INCLUDE "opac/parts/record/extras.tt2" %]