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