]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/result/table.tt2
TPAC: Alternate graphic fields (880) display
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / result / table.tt2
1 [%  PROCESS "opac/parts/misc_util.tt2";
2
3     USE ResolverResolver;
4
5     ctx.result_start = 1 + ctx.page_size * page;
6     ctx.result_stop = ctx.page_size * (page + 1);
7     IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END;
8
9     result_count = ctx.result_start;
10
11 %]
12
13 [% PROCESS "opac/parts/result/paginate.tt2" %] 
14 [% ctx.results_count_header = PROCESS results_count_header;
15     ctx.results_count_header %]
16
17 [% IF ctx.bookbag %]
18 <div id="result-bookbag-heading">
19     <div class="result-bookbag-name">[% ctx.bookbag.name | html %]</div>
20     <div class="result-bookbag-description">[% ctx.bookbag.description | html %]</div>
21 </div>
22 [% END %]
23 <div id="result_table_div">
24             <div class="facet_sidebar">
25                 [% INCLUDE "opac/parts/staff_saved_searches.tt2" %]
26                 [% INCLUDE 'opac/parts/result/facets.tt2' %]
27             </div>
28             <div class="result_block">
29                 <table cellpadding="0" cellspacing="0"
30                     border="0" style="margin-top:10px;">
31                     <tbody id="result_table">
32                     [%  FOR rec IN ctx.records;
33                             attrs = {marc_xml => rec.marc_xml};
34                             PROCESS get_marc_attrs args=attrs;
35                             IF CGI.param('detail_record_view');
36                                 attrs.title = attrs.title_extended;
37                             END;
38                     -%]
39                         <tr class="result_table_row">
40                                             <td class="results_row_count" name="results_row_count">[%
41                                                     result_count; result_count = result_count + 1
42                                                 %].</td>
43                                             <td class='result_table_pic_header'>
44                                                 [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
45                                                 <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"><img alt="[% l('Image of item') %]"
46                                                         name='item_jacket' class='result_table_pic' width="55"
47                                                         src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident | uri %]' /></a><br />
48                                                 [% END %]
49                                             </td>
50                                             <td class='result_table_title_cell' name='result_table_title_cell'>
51                                                 <div class="bold">
52                                                     <a name='record_[% rec.id %]' name='item_title'
53                                                         href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
54                                                         [% HTML.attributes(title => l('Display record details for "[_1]"', attrs.title)) %]
55                                                         class='search_link'>[% attrs.title | html %]</a>
56                                                 </div>
57 [%-
58 FOR entry IN attrs.graphic_titles;
59     FOR alt IN entry.graphic;
60         diratt = "";
61         IF alt.dir;
62             diratt = ' dir="' _ alt.dir _ '"';
63         END;
64 -%]
65 <div class="graphic880"[% diratt %]>
66     [% alt.value | html %]
67 </div>
68 [%-
69     END;
70 END;
71 -%]
72                                                 <div>
73                                                     <div>
74                                                         <em><a title="[% l("Perform an Author Search") %]"
75                                                                 name='item_author'
76                                                                 href="[%- 
77                                                                     authorquery = attrs.author | replace('[#"^$\+\-,\.:;&|\[\]()]', '');
78                                                                     mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page'])
79                                                                     -%]">[% attrs.author | html %]</a></em>
80                                                                     [%- UNLESS CGI.param('detail_record_view')
81                                                                         OR (show_more_details.default == 'true'
82                                                                         OR show_more_details.default == 'hide')
83                                                                     %] [% attrs.pubdate | html %]
84                                                                     [%- END -%]
85 [%-
86 FOR entry IN attrs.graphic_authors;
87     FOR alt IN entry.graphic;
88         diratt = "";
89         IF alt.dir;
90             diratt = ' dir="' _ alt.dir _ '"';
91         END;
92 -%]
93 <div class="graphic880"[% diratt %]>
94     [% alt.value | html %]
95 </div>
96 [%-
97     END;
98 END;
99 -%]
100
101                                                     </div>
102                                                     <table cellpadding="0" cellspacing="0" border="0"
103                                                         class="results_info_table">
104                                                         [% IF args.holdings.size > 0 %]
105                                                         <tr name='bib_cn_list' class='result_table_title_cell'>
106                                                             <td valign='top'>
107                                                                 <strong>[% l('Call number:') %]</strong>
108                                                             </td>
109                                                             <td>[% args.holdings.0.label | html %]</td>
110                                                         </tr>
111                                                         [% END %]
112
113                                                         [% IF CGI.param('detail_record_view') %]
114                                                         <!-- These fields are visible when viewing the results page in 'detailed' mode -->
115
116                                                         [% IF attrs.pubinfo %]
117                                                             <tr name="results_pub_tr">
118                                                                 <td valign="top">
119                                                                     <strong>[% l('Publisher:') %]</strong>
120                                                                 </td>
121                                                                 <td>[% attrs.pubinfo | html %]
122 [%-
123 FOR entry IN attrs.graphic_pubinfos;
124     FOR alt IN entry.graphic;
125         diratt = "";
126         IF alt.dir;
127             diratt = ' dir="' _ alt.dir _ '"';
128         END;
129 -%]
130 <div class="graphic880"[% diratt %]>
131     [% alt.value | html %]
132 </div>
133 [%-
134     END;
135 END;
136 -%]
137 </td>
138                                                             </tr>
139                                                         [% END %]
140                                                         [% IF attrs.isbns.size > 0 %]
141                                                             <tr name="results_isbn_tr">
142                                                                 <td valign="top">
143                                                                     <strong>[% l('ISBN:') %]</strong>
144                                                                 </td>
145                                                                 <td>[% attrs.isbns.0 | html %]</td>
146                                                             </tr>
147                                                         [% END %]
148                                                         [%- IF attrs.issns.size > 0 %]
149                                                             <tr name="results_issn_tr">
150                                                                 <td valign="top">
151                                                                     <strong>[% l('ISSN:') %]</strong>
152                                                                 </td>
153                                                                 <td>[% attrs.issns.0 | html %]</td>
154                                                             </tr>
155                                                         [%- END %]
156                                                         [%- IF openurl.enabled == 'true';
157                                                             FOREACH issn IN args.issns;
158                                                                 NEXT IF issn == '';
159                                                                 res_urls = ResolverResolver.resolve_issn(issn, openurl.baseurl);
160                                                                 FOREACH res IN res_urls;
161                                                         %]
162                                                         <tr name="results_issn_tr">
163                                                             <td valign="top">
164                                                                 <strong><a href="[% res.target_url %]">
165                                                                 [% res.public_name | html %]</a></strong>
166                                                             </td>
167                                                             <td>[% res.target_coverage | html %]</td>
168                                                         </tr>
169                                                                 [% END %]
170                                                             [% END %]
171                                                         [% END %]
172
173                                                         [% IF attrs.edition %]
174                                                             <tr name="results_edition_tr">
175                                                                 <td valign="top">
176                                                                     <strong>[% l('Edition:') %]</strong>
177                                                                 </td>
178                                                                 <td>[% attrs.edition | html %]
179 [%-
180 FOR entry IN attrs.graphic_editions;
181     FOR alt IN entry.graphic;
182         diratt = "";
183         IF alt.dir;
184             diratt = ' dir="' _ alt.dir _ '"';
185         END;
186 -%]
187 <div class="graphic880"[% diratt %]>
188     [% alt.value | html %]
189 </div>
190 [%-
191     END;
192 END;
193 -%]
194 </td>
195                                                             </tr>
196                                                         [% END %]
197                                                         [% IF attrs.phys_desc %]
198                                                             <tr name="results_phys_desc_tr">
199                                                                 <td nowrap="nowrap" valign="top">
200                                                                     <strong>[% l('Phys. Desc.:') %]</strong>
201                                                                 </td>
202                                                                 <td>
203                                                                     [% args.phys_desc | html %]
204                                                                 </td>
205                                                             </tr>
206                                                         [% END %]
207                                                         [% FOR uri IN args.uris %]
208                                                             <tr name='bib_uri_list' class='result_table_title_cell'>
209                                                                 <td valign='top'>
210                                                                     <strong>[% l('Electronic resource') %]</strong>
211                                                                 </td>
212                                                                 <td><a href="[% uri.href %]">[% uri.link | html %]</a>[% ' - ' _ uri.note | html IF uri.note %]</td>
213                                                             </tr>
214                                                             [% END %]
215                                                             [%- IF args.holdings.size > 0;
216                                                                 FOREACH copy IN args.holdings;
217                                                                     IF copy.part_label != '';
218                                                                         has_parts = 'true';
219                                                                         LAST;
220                                                                     END;
221                                                                 END;
222                                                             %]
223                                                             <tr name='bib_cn_list' class='result_table_title_cell'>
224                                                                 <td colspan='2'>
225                                                                     <table class='result_holdings_table'>
226                                                                         <thead><tr>
227                                                                             <th>[% l('Library') %]</th>
228                                                                             <th>[% l('Shelving location') %]</th>
229                                                                             <th>[% l('Call number') %]</th>
230                                                                             [%- IF has_parts == 'true'; %]
231                                                                             <th>[% l('Part') %]</th>
232                                                                             [%- END %]
233                                                                             <th>[% l('Status') %]</th>
234                                                                         </tr></thead>
235                                                                         <tbody>
236                                                                 [% FOR copy IN args.holdings %]
237                                                                         <tr>
238                                                                             <td>[% copy.library | html %]</td>
239                                                                             <td>[% copy.location | html %]</td>
240                                                                             <td>[% copy.label | html %]</td>
241                                                                             [%- IF has_parts == 'true'; %]
242                                                                             <td>[% copy.part_label %]</td>
243                                                                             [%- END %]
244                                                                             <td>[% copy.status | html %]</td>
245                                                                         </tr>
246                                                                 [% END %]
247                                                                         </tbody>
248                                                                     </table>
249                                                                 </td>
250                                                             </tr>
251                                                             [%- has_parts = 'false';
252                                                                 END;
253                                                              %]
254                                                         [% END %] <!-- END detail_record_view -->
255                                                     </table>
256                                                     [% PROCESS "opac/parts/result/copy_counts.tt2" %]
257                                                     [% IF rec.user_circulated %]
258                                                     <div class="result_item_circulated">
259                                                         <img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('Checked Out Before') %]"/>
260                                                         <span>[% l('I have checked this item out before') %]</span>
261                                                     </div>
262                                                     [% END %]
263                                                     [% IF ctx.bookbag;
264                                                         rec_id = rec.id;
265                                                         FOR note IN ctx.bookbag_items_by_bre_id.$rec_id.notes %]
266                                                     <div class="result-bookbag-item-note">
267                                                         [% note.note | html %]
268                                                     </div>
269                                                         [% END %]
270                                                     [% END %]
271                                                 </div>
272                                             </td>
273
274                                             <td name='result_table_format_cell' class='result_table_format_cell' width="1">
275
276                                                 [% IF attrs.format_icon %]
277                                                 <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
278                                                 [% END %]
279
280                                                 <!-- unAPI link -->
281                                                 <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% rec.id %]'></abbr>
282
283                                                 <!-- Empty span used for creating Google Book Search-->
284                                                 <span name="googleBooksLink" class="hide_me">
285                                                     <a style='padding-left: 8px;'
286                                                         class='classic_link hide_me'
287                                                         name="googleBooks-link">[% l("Browse in Google Books Search") %]</a>
288                                                 </span>
289                                             </td>
290                                             <td nowrap='nowrap' width="1" align="right">
291                                                 <div class="result_table_utils_cont">
292                                                     <div class="result_table_utils">
293 [%- search_ou = ctx.search_ou;
294     num_holdable_copies = attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size || 0;
295     IF ctx.place_unfillable ||
296         ( num_holdable_copies > 0
297             && (ctx.holds_block.enabled != 'true' || attrs.org_copy_counts.$search_ou.available == 0)
298         )
299 %]
300                                                         <div class="results_aux_utils place_hold"><a
301                                                                 href="[% mkurl(ctx.opac_root _ '/place_hold', 
302                                                                     {hold_target => rec.id, hold_type => 'T', hold_source_page => mkurl()}) %]" 
303                                                                     name="place_hold_link" class="no-dec"><img
304                                                                 src="[% ctx.media_prefix %]/images/green_check.png"
305                                                                 alt=""/><span class="result_place_hold">[% l('Place Hold') %]</span></a>
306                                                         </div>
307 [%- END -%]
308                                                         <div class="results_aux_utils result_util">
309                                                             [%  IF ctx.user;
310                                                                 INCLUDE "opac/parts/bookbag_actions.tt2";
311                                                             %]
312                                                             [%  ELSE;
313                                                                 operation = ctx.mylist.grep(rec.id).size ? "delete" : "add";
314                                                                 label = (operation == "add") ? l("Add to my list") : l("Remove from my list");
315                                                                 href = mkurl(ctx.opac_root _ '/mylist/' _ operation, 
316                                                                         {record => rec.id, anchor => 'record_' _ rec.id}, 1);
317                                                             %]      
318                                                             <a href="[% href %]" class="no-dec">
319                                                                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
320                                                                 [% label %]
321                                                             </a>
322                                                             [% END %]
323                                                         </div>
324                                                         [% IF ENV.OILS_CONTENT_CAFE_USER %]
325                                                         <div class="results_aux_utils result_util">
326                                                             <a title="[% l('Reviews and More') %]" target='_blank' 
327                                                                 href="[% ctx.ext_proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
328                                                                     ENV.OILS_CONTENT_CAFE_USER %]&amp;Password=[%-
329                                                                     ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&amp;Options=Y">
330                                                                 <img src='[% ctx.media_prefix %]/images/starz.png'/> 
331                                                                 <span class="results_reviews">[% l('Reviews &amp; More') %]</span>
332                                                             </a>
333                                                         </div>
334                                                         [% END %]
335                                                     </div>
336                                                 </div>
337                                             </td>
338                                         </tr>
339                                         [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %]
340                                         <tr>
341                                             <td/>
342                                             <td align='center'> <!-- Chilifresh reviews link --> 
343                                                 <span class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </span>
344                                             </td>
345                                         </tr>
346                                         <tr>
347                                             <td/>
348                                             <td colspan='5'> <!-- Chilifresh reviews panel -->
349                                                 <div id="chili_review_[% attrs.isbn_clean | html %]" style="display: none;" align="center"></div>
350                                             </td>
351                                         </tr>
352                                         [%- END %]
353                     [% END %]
354                     </tbody>
355                 </table>
356             </div>
357 </div>
358 <div>
359     [% ctx.results_count_header %]
360 </div>