TPac: more template scrubbing and cleaning
[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 <!-- This holds the record summary information -->
13
14 <table width="100%" border="0" cellpadding="0" cellspacing="0" id="rdetail_details_table">
15     <tbody>
16         <tr>
17             <td width="90" valign="top" id="rdetail_image_cell">
18                 [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
19                 <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/[% ident | uri %]'><img
20                     alt="[% l('Image of item') %]" id='rdetail_image'
21                     src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/[% ident | uri %]' /></a>
22                 [% END %]
23                 <br />
24             </td>
25     
26             <td valign="top">
27                 <table border="0" cellpadding="0" cellspacing="0" width="100%">
28                     <tr>
29                         <td valign="top">
30                             <span id='rdetail_title'>[% attrs.title_extended | html %]</span><br />
31                             [% IF attrs.author %]
32                             <span class='opac-auto-030'>[% l("Author") %]:</span>
33                             <em><a title='[% l("Perform an author search") %]'
34                                     href="[%- 
35                                         authorquery = attrs.author | replace('[,\.:;]', '');
36                                         mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page'])
37                                         -%]">[% attrs.author | html %]</a></em>
38                             [% END %]
39                         </td>
40                         <td align="right" valign="top" nowrap="nowrap" style="white-space:nowrap;">
41                             <div style="width:280px;text-align:left;margin-top:3px;">
42                                 <div style="float:right;">
43                                     <div class="rdetail_aux_utils opac-auto-010">
44                                         <a href="[% mkurl(ctx.opac_root _ '/place_hold', {hold_target => ctx.bre_id, hold_type => 'T'}) %]" 
45                                             class="no-dec"><img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" /><span 
46                                                     style="position:relative;top:-3px;left:3px;">[% l('Place Hold') %]</span></a>
47                                     </div>
48                                     <div class="rdetail_aux_utils opac-auto-121">
49                                         [%  
50                                             operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
51                                             label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); 
52                                         %]
53                                         <a href="[% ctx.opac_root %]/mylist/[% operation %]?record=[% ctx.bre_id %]" class="no-dec">
54                                             <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
55                                             [% label %]
56                                         </a>
57                                     </div>
58                                 </div>
59                                 <div style="float:right;margin-right:17px;">
60                                     [% IF attrs.format_icon %]
61                                     <img alt="[% attrs.format_label %]" title="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
62                                     [% END %]
63                                 </div>
64                             </div>
65                         </td>
66                     </tr>
67                 </table>
68                 <div class='opac-auto-018'>
69                     <table border="0" cellpadding="0" width="100%">
70                         <tr>
71                             <td nowrap='nowrap' valign="top">
72                                 [% IF attrs.isbns.0 %]<strong>[% l("ISBN") %]</strong>[% END %]
73                             </td>
74                             <td valign="top">
75                                 [% FOR isbn IN attrs.isbns %][% IF !loop.first; %]<br/>[% END; isbn | html ; END %]
76                             </td>
77                             <td nowrap='nowrap' valign="top">
78                                 [% IF attrs.phys_desc %]<strong>[% l("Physical Description") %]</strong>[% END %]
79                             </td>
80                             <td valign="top">[% attrs.phys_desc | html %]</td>
81                         </tr>
82                         [%- IF openurl.enabled == 'true';
83                             FOR issn IN args.issns;
84                                 sfx = ResolverResolver.resolve_issn(issn, openurl.baseurl);
85                                 FOR res IN sfx;
86                         %]
87                             <tr name="results_issn_tr">
88                                 <td valign="top">
89                                     <strong><a href="[% res.target_url %]">
90                                         [% res.public_name %]</a></strong>
91                                 </td>
92                                 <td>[% res.target_coverage %]</td>
93                             </tr>
94                                 [% END %]
95                             [% END %]
96                         [% END %]
97                         <tr>
98                             <td nowrap='nowrap' valign="top">
99                                 <strong>[% IF attrs.marc_cn; l("Call Number"); END %]</strong>
100                             </td>
101                             <td valign="top">[% attrs.marc_cn | html %]</td>
102                             <td nowrap='nowrap' valign="top">
103                                 <strong>[% IF attrs.edition; l("Edition"); END %]</strong>
104                             </td>
105                             <td valign="top">[% attrs.edition | html %]</td>
106                         </tr>
107                         <tr>
108                             <td nowrap='nowrap' valign="top">
109                                 <strong>[% IF attrs.publisher; l("Publisher"); END %]</strong>
110                             </td>
111                             <td valign="top">[% attrs.publisher | html %]</td>
112                             <td nowrap='nowrap' valign="top">
113                                 <strong>[% IF attrs.pubdate; l("Publication Date"); END %]</strong>
114                             </td>
115                             <td valign="top">[% attrs.pubdate | html %]</td>
116                         </tr>
117                     </table>
118
119                     <!-- hold/copy summary -->
120                     <div style="padding-top:15px;">
121                         <div>
122                             [% l("[quant,_1,Hold,Holds] with [quant,_2,total copy,total copies]", 
123                                 ctx.record_hold_count, ctx.copy_summary.0.count) %]
124                         </div>
125                         <div>[% l('[quant,_1,Copy,Copies] available', ctx.copy_summary.0.available) %]</div>
126                     </div>
127
128                 </div>
129             </td>
130         </tr>
131     </tbody>
132 </table>
133 <br />
134
135 [% FOR uri IN args.uris %]
136 <div class="rdetail_uri">
137     <a href="[% uri.href %]">[% uri.link %]</a>[% ' - ' _ uri.note IF uri.note %]
138 </div>
139 [% END %]
140
141 <br />
142
143 <table cellpadding="0" cellspacing="0" border="0" width="100%" id="rdetails_status">
144     <thead>
145         <tr>
146             <td>[% l("Location") %]</td>
147             <td>[% l("Call Number") %]</td>
148             <td>[% l("Barcode") %]</td>
149             <td>[% l("Shelving Location") %]</td>
150             [% IF ctx.is_staff %]
151             <td>[% l("Age Hold Protection") %]</td>
152             <td>[% l("Create Date") %]</td>
153             <td>[% l("Holdable?") %]</td>
154             [% END %]
155             <td>[% l("Status") %]</td>
156             <td>[% l("Due Date") %]</td>
157         </tr>
158     </thead>
159     <tbody class="copy_details_table">
160         [% last_cn = 0;
161         FOR copy_info IN ctx.copies;
162             NEXT IF copy_info.call_number_label == '##URI##' %]
163         <tr>
164             <td>
165             [%-
166                 org_name = ctx.get_aou(copy_info.circ_lib).name;
167                 org_name | html
168             -%]
169             </td>
170             <td>[% copy_info.call_number_label | html %]</td>
171             <td>[% copy_info.barcode | html %]</td>
172             <td>[% copy_info.copy_location | html %]</td>
173             [% IF ctx.is_staff %]
174             <td>
175                 [% copy_info.age_protect ?
176                     ctx.get_crahp(copy_info.age_protect).name : l('None') | html %]
177             </td>
178             <td>[% date.format(
179                 ctx.parse_datetime(copy_info.create_date),
180                 DATE_FORMAT
181             ) %]</td>
182             <td>[%  # Show copy/volume hold links to staff (without
183                     # checking whether they have permissions to do those).
184                     overall_holdable = (copy_info.holdable == 't' AND
185                         copy_info.location_holdable == 't' AND
186                         copy_info.status_holdable == 't');
187                     IF overall_holdable;
188                         l("Place on"); %]
189                 <a href="[% mkurl(ctx.opac_root _ '/place_hold', {hold_target => copy_info.id, hold_type => 'C'}) %]">[% l("copy") %]</a>
190                 [%      IF copy_info.call_number != last_cn;
191                             last_cn = copy_info.call_number;
192                             l(" / "); %]
193                 <a href="[% mkurl(ctx.opac_root _ '/place_hold', {hold_target => copy_info.call_number, hold_type => 'V'}) %]">[% l("volume") %]</a>
194                 [%      END;
195                     ELSE;
196                         l("No");
197                     END %]</td>
198             [% END %]
199             <td>[% copy_info.copy_status | html %]</td>
200             <td>[%
201                 IF copy_info.due_date;
202                     date.format(
203                         ctx.parse_datetime(copy_info.due_date),
204                         DATE_FORMAT
205                     );
206                 ELSE;
207                     '-';
208                 END %]</td>
209         </tr>
210         [% END %]
211         <tr>
212         [% IF ctx.copy_offset > 0;
213             new_offset = ctx.copy_offset - ctx.copy_limit;
214             IF new_offset < 0; new_offset = 0; END %]
215             <td>
216                 <a href="[% mkurl('', {copy_offset => new_offset, copy_limit => ctx.copy_limit}) %]">&laquo; [%
217                     l('Previous [_1]', ctx.copy_offset - new_offset) %]</a>
218             </td>
219         [% END %]
220         [% IF ctx.copies.size >= ctx.copy_limit %]
221             <td>
222                 <a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
223                     l('Next [_1]', ctx.copy_limit) %] &raquo;</a>
224             </td>
225         [% END %]
226         </tr>
227         <tr>
228             <td>
229                 [% more_copies_limit = 50 %] [%# TODO: config %]
230                 [% IF  ctx.copy_limit != more_copies_limit AND ctx.copies.size >= ctx.copy_limit %]
231                     <div style='margin-top:10px;'>
232                         <img src="[% ctx.media_prefix %]/images/plus_sign.png" />
233                         <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]">[% l('Show more copies') %]</a>
234                     </div>
235                 [% ELSIF ctx.copy_limit == more_copies_limit %]
236                     <div style='margin-top:10px;'>
237                         <img src="[% ctx.media_prefix %]/images/minus_sign.png" />
238                         <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]">[% l('Show fewer copies') %]</a>
239                     </div>
240                 [% END %]
241             </td>
242         </tr>
243         <tr>
244             <td>
245                 [% IF CGI.param('expand') == 'all' %]
246                     <img src="[% ctx.media_prefix %]/images/minus_sign.png" />
247                     <a href="[% mkurl('', {}, ['expand']) %]">[% l('Collapse all tabs') %]</a>
248                 [% ELSE %]
249                     <img src="[% ctx.media_prefix %]/images/plus_sign.png" />
250                     <a href="[% mkurl('', {expand => 'all'}) %]">[% l('Expand all tabs') %]</a>
251                 [% END %]
252             </td>
253         </tr>
254
255     </tbody>
256 </table>
257
258 <div id="rdetail_extras_expand" class="hide_me">
259     <a href="#"><img
260         src="[% ctx.media_prefix %]/images/plus_sign.png" /></a>
261     <a style="position:relative;top:-3px;" href="#">[% l('Expand all tabs') %]</a>
262 </div>
263
264 <div id="rdetail_extras_collapse" class="hide_me">
265     <a href="#"><img src="[% ctx.media_prefix %]/images/plus_sign.png" /></a>
266     <a style="position:relative;top:-3px;" href="#">[% l('Collapse all tabs') %]</a>
267 </div>