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