]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/record/summary.tt2
Ability to add records to permanent bookbags in TPAC.
[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         <div class="rdetail_aux_utils place_hold">
27             <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
28                 {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]" 
29             class="no-dec"><img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" /><span 
30             class="place_hold">[% l('Place Hold') %]</span></a>
31         </div>
32         <div class="rdetail_aux_utils toggle_list">
33         [%  IF ctx.user;
34             dsetting = "opac.default_list";
35             tclass = (ctx.user_setting_map.$dsetting) ? "temporary" :
36                          (ctx.bookbags.size) ? "temporary divider" : "temporary";
37             href = mkurl(ctx.opac_root _ '/mylist/add',
38                          {record => ctx.bre_id, anchor => ctx.bre_id}, stop_parms);
39         %]
40             <ul class="popmenu">
41             <li><a href="#" class="no-dec">
42                     <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
43                     [% l("Add to my list") %]
44                 </a>
45             <ul>
46             <li class="[% tclass %]">
47                 <a href="[% href %]">[% l('Temporary List') %]</a>
48             </li>
49             [% IF ctx.user_setting_map.$dsetting;
50                label = (ctx.default_bookbag) ? ctx.default_bookbag : l('Default List');
51                class = (ctx.bookbags.size) ? "default divider" : "default";
52                href = mkurl(ctx.opac_root _ '/myopac/list/update',
53                             {action => 'add_rec', list => ctx.user_setting_map.$dsetting,
54                              record => ctx.bre_id, anchor => ctx.bre_id}, stop_parms);
55             %]
56             <li class="[% class %]">
57                 <a href="[% href %]">[% label %]</a>
58             </li>
59             [% END %]
60             [% IF ctx.bookbags.size;
61                i = 0;
62                FOREACH bag IN ctx.bookbags;
63                    href = mkurl(ctx.opac_root _ '/myopac/list/update',
64                                 {action => 'add_rec', list => bag.id, record => ctx.bre_id,
65                                  anchor => ctx.bre_id}, stop_parms);
66                    i = i + 1;
67                    IF i == ctx.bookbags.size;
68             %]
69             <li class="divider">
70                 [% ELSE %]
71             <li>
72                 [% END %]
73                <a href="[% href %]">[% bag.name %]</a>
74             </li>
75             [%
76                END;
77                END
78             %]
79             <li>
80                 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {limit => ctx.bookbag_count, add_rec => ctx.bre_id}) %]">
81                 [% l('See All') %]
82                 </a>
83             </li>
84             <li class="new">
85                 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {add_rec => ctx.bre_id}, stop_parms) %]">
86                 [% l('Add to new list') %]
87                 </a>
88             </li>
89             </ul>
90             </li>
91             </ul>
92         [%  ELSE;
93             operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
94             label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); 
95         %]
96             <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}, stop_parms) %]" class="no-dec">
97                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
98                 [% label %]
99             </a>
100         [% END %]
101         </div>
102         <div class="rdetail_aux_utils">
103             <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
104             <a href="[% mkurl(ctx.opac_root _ '/record/print/' _ ctx.bre_id) %]" class="no-dec">[% l('Print') %]</a> /
105             <a href="[% mkurl(ctx.opac_root _ '/record/email/' _ ctx.bre_id) %]" class="no-dec">[% l('Email') %]</a>
106         </div>
107     </div>
108     <div id='rdetail_title_div'>
109         [%- IF attrs.format_icon %]
110         <div class="format_icon">
111             <img alt="[% attrs.format_label %]" title="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
112         </div>
113         [%- END %]
114         <h1 id='rdetail_title' itemprop="name">[% attrs.title_extended | html %]</h1>
115         [%- INCLUDE "opac/parts/record/authors.tt2" %]
116     </div>
117 </div>
118
119 [%- IF openurl.enabled == 'true';
120     openurls = [];
121     FOREACH issn IN args.issns;
122         NEXT IF issn == '';
123         openurls = openurls.import(ResolverResolver.resolve_issn(issn, openurl.baseurl));
124     END;
125     IF openurls.size && openurls.0 != '';
126 %]
127     <div id='rdetail_openurl'>
128         <strong class='rdetail_openurl_title'>[% l("Electronic resources") %]</strong>
129         <table><tbody>
130 [%-
131         FOREACH res IN openurls;
132 %]
133         <tr>
134             <td class='rdetail_openurl_entry'><a href="[% res.target_url %]">[% res.public_name %]</a></td>
135             <td>[% res.target_coverage %]</td>
136         </tr>
137     [%- END %]
138     </tbody></table>
139 [%- END %]
140     </div>    
141 [%- END %]
142 [%- merged_uris = args.uris.merge(args.online_res);
143 num_uris = merged_uris.size;
144 IF num_uris > 0;
145 -%]
146 <h2 class="rdetail_uris">[% l("Electronic resources") %]</h2>
147 <div class="rdetail_uris">
148     [%- IF num_uris > 1 %]<ul>[% END %]
149     [%- FOR uri IN merged_uris %]
150         [%- IF num_uris == 1 %]<p class="rdetail_uri">[% ELSE %]<li class="rdetail_uri">[% END %]
151         <a href="[% uri.href %]">[% uri.link %]</a>[% ' - ' _ uri.note IF uri.note %]
152         [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
153     [%- END %]
154     [%- IF num_uris > 1 %]</ul>[% END %]
155 </div>
156 [%- END %]
157 [%- # Hold/copy summary
158     IF ctx.copy_summary.0.count
159 %]
160 <div id="copy_hold_counts">
161 [%- INCLUDE "opac/parts/record/copy_counts.tt2" %]
162     <span id="rdetail_hold_counts">
163         <h2>[% l('Current holds') %]</h2>
164         <p>
165             [%- l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
166                 ctx.record_hold_count, ctx.copy_summary.0.count) %]
167         </p>
168     </span>
169 [%- INCLUDE "opac/parts/record/copy_table.tt2" copies=ctx.copies %]
170 </div>
171 [%- END %]
172
173 <h2 id='rdetail_record_details'>[% l("Record details") %]</h2>
174 <ul>
175     [%- IF attrs.isbns.0; FOR isbn IN attrs.isbns %]
176     <li class='rdetail_isbns'>
177         <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
178         <span class='rdetail_value' itemprop='isbn'>[% isbn | html  %]</span>
179     </li>
180         [%- END %]
181     [%- END %]
182     [%- IF attrs.issns.0; FOR issn IN attrs.issns %]
183     <li class='rdetail_issns'>
184         <strong class='rdetail_label'>[% l('ISSN:'); %]</strong>
185         <span class='rdetail_value'>[% issn | html  %]</span>
186     </li>
187         [%- END %]
188     [%- END %]
189     [%- IF attrs.phys_desc %]
190     <li id='rdetail_phys_desc'>
191         <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
192         <span class='rdetail_value'>[% attrs.phys_desc | html %]</span>
193     </li>
194     [%- END %]
195     [%- IF attrs.edition %]
196     <li id='rdetail_edition'>
197         <strong class='rdetail_label'>[% l("Edition:") %]</strong>
198         <span class='rdetail_value'>[% attrs.edition | html %]</span>
199     </li>
200     [%- END %]
201     [%- IF attrs.publisher %]
202     <li id='rdetail_publisher'>
203         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
204         <span class='rdetail_value' itemprop="publisher">[%
205             attrs.publisher | html;
206         %]</span>
207         [% IF attrs.pubdate; %]
208         <span itemprop="datePublished">[% attrs.pubdate | html; %]</span>
209         [% END; %]
210     </li>
211     [%- END %]
212 </ul>
213
214 [%- INCLUDE "opac/parts/record/subjects.tt2" %]
215 [%- INCLUDE "opac/parts/record/series.tt2" %]
216 [%- INCLUDE "opac/parts/record/extras.tt2" %]