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