]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/parts/result/table.tt2
LP#1467634: Hide saved searches from screen readers for non-staff client
[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 [% IF ctx.bookbag %]
17 <div id="result-bookbag-heading">
18     <div class="result-bookbag-name">[% ctx.bookbag.name | html %]</div>
19     <div class="result-bookbag-description">[% ctx.bookbag.description | html %]</div>
20 </div>
21 [% END %]
22 <div id="result_table_div">
23     <div class="facet_sidebar_hidden" id="facet_sidebar">
24     [%- IF ctx.is_staff %]
25     <h3 class="sr-only">[% l('Saved Searches') %]</h3>
26     [% INCLUDE "opac/parts/staff_saved_searches.tt2" %]
27     [%-  END %]
28     <h3 class="sr-only">[% l('Search Results facets') %]</h3>
29     [% INCLUDE 'opac/parts/result/facets.tt2' %]
30     <h3 class="sr-only">[% l('Search Results List') %]</h3>
31     </div>
32             <div id="result_block" class="result_block_visible">
33                 <table id="result_table_table" title="[% l('Search Results') %]"
34                   class="table_no_border_space table_no_cell_pad">
35                     <thead class="sr-only">
36                       <tr>
37                         <th>[% l('Search result number') %]</th>
38                         <th>[% l('Book jacket cover art') %]</th>
39                         <th>[% l('Item details and Actions') %]</th>
40                       </tr>
41                     </thead>
42                     <tbody id="result_table">
43                     [%  FOR rec IN ctx.records;
44                             attrs = {marc_xml => rec.marc_xml};
45                             PROCESS get_marc_attrs args=attrs;
46                             IF CGI.param('detail_record_view')
47                                 OR (show_more_details.default == 'true'
48                                 OR show_more_details.default == 'hide');
49                                 attrs.title = attrs.title_extended;
50                             END;
51                             # note: rec.id refers to the record identifier, regardless
52                             # of the type of record. i.e. rec.id = mmr_id ? mmr_id : bre_id
53                             IF rec.mmr_id;
54                                 IF rec.mr_constituent_count > 1;
55                                     # metarecords link to record list page
56                                     record_url = mkurl(ctx.opac_root _ '/results', 
57                                         {metarecord => rec.mmr_id}, ['page']);
58                                 ELSE;
59                                     # for MR, bre_id refers to the master and in
60                                     # this case, only, record
61                                     record_url = mkurl(ctx.opac_root _ '/record/' _ rec.bre_id);
62                                 END;
63                                 hold_type = 'M';
64                             ELSE;
65                                 record_url = mkurl(ctx.opac_root _ '/record/' _ rec.bre_id);
66                                 hold_type = 'T';
67                             END;
68                     -%]
69                         <tr class="result_table_row">
70                                             <td class="results_row_count" name="results_row_count">[%
71                                                     result_count; result_count = result_count + 1
72                                                 %].</td>
73                                             <td class='result_table_pic_header'>
74                                                 <a href="[% record_url %]"><img alt="[% l('Book cover') %]"
75                                                         name='item_jacket' class='result_table_pic' width="55"
76                                                         src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/r/[% rec.bre_id | uri %]' /></a><br />
77                                             </td>
78                                             <td class='result_table_title_cell' name='result_table_title_cell'>
79                                                <div class="result_metadata">
80                                                     [% IF rec.mmr_id %]
81                                                     <abbr class="unapi-id" 
82                                                       title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:metabib-metarecord/[% rec.mmr_id %]'>
83                                                     </abbr>
84                                                     [% ELSE %]
85                                                     <abbr class="unapi-id" 
86                                                       title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% rec.bre_id %]'>
87                                                     </abbr>
88                                                     [% END %]
89                                                     <a class='record_title search_link' name='record_[% rec.id %]'
90                                                         href="[% record_url %]"
91                                                         [% html_text_attr('title', l('Display record details for "[_1]"', attrs.title)) %]>
92                                                         [% attrs.title | html %]
93                                                      </a>
94                                                      [% IF rec.mr_constituent_count.defined && rec.mr_constituent_count > 1 %]
95                                                      <span title="[% l('This group contains [_1] records', rec.mr_constituent_count) %]">
96                                                       ([% rec.mr_constituent_count %])
97                                                      </span>
98                                                      [% END %]
99
100 [%-
101 FOR entry IN attrs.graphic_titles;
102     FOR alt IN entry.graphic;
103         diratt = "";
104         IF alt.dir;
105             diratt = ' dir="' _ alt.dir _ '"';
106         END;
107 -%]
108 <div class="graphic880"[% diratt %]>
109     [% alt.value | html %]
110 </div>
111 [%-
112     END;
113 END;
114 -%]
115  
116                                                     <div>
117                                                         <a title="[% l("Perform an Author Search") %]"
118                                                                 class="record_author"
119                                                                 href="[%- 
120                                                                     authorquery = attrs.author | replace('[#"^$\+\-,\.:;&|\[\]()]', ' ');
121                                                                     mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, general_search_parms.merge(expert_search_parms, browse_search_parms, facet_search_parms))
122                                                                     -%]" rel="nofollow" vocab="">[% attrs.author | html %]</a>
123 [%-
124 FOR entry IN attrs.graphic_authors;
125     FOR alt IN entry.graphic;
126         diratt = "";
127         IF alt.dir;
128             diratt = ' dir="' _ alt.dir _ '"';
129         END;
130 -%]
131 <div class="graphic880"[% diratt %]>
132     [% alt.value | html %]
133 </div>
134 [%-
135     END;
136 END;
137 -%]
138
139                                                     </div>
140                                                     <div class='result_table_title_cell'>
141                                                     [%- IF attrs.format_label; %]
142                                                         [% FOR format IN attrs.all_formats %]
143                                                             <img title="[% format.label | html %]" 
144                                                                 alt="[% format.label | html %]" 
145                                                                 src="[% format.icon %]" /> 
146                                                             [% format.label | html %]
147                                                         [% END %]
148                                                     [%- END %]
149                                                     [%- UNLESS CGI.param('detail_record_view')
150                                                             OR (show_more_details.default == 'true'
151                                                             OR show_more_details.default == 'hide');
152                                                             IF attrs.pubdate;
153                                                                 pubdate_clean = attrs.pubdate | html;
154                                                                 l(" ([_1])", pubdate_clean);
155                                                             ELSIF attrs.copyright;
156                                                                 copyright_clean = attrs.copyright | html;
157                                                                 l(" ([_1])", copyright_clean);                                                                
158                                                             END;
159                                                         END
160                                                     -%]
161                                                     </div>
162                                                     <table 
163                                                        role="presentation"
164                                                        title="[% l('Record Holdings Summary') %]"
165                                                        class="table_no_border_space table_no_cell_pad table_no_border results_info_table">
166                                                         [% UNLESS rec.mmr_id %]
167                                                            [% IF args.holdings.size > 0 %]
168                                                         <tr name='bib_cn_list' class='result_table_title_cell'>
169                                                             <td valign='top'>
170                                                                 <strong>[% l('Call number:') %]</strong>
171                                                             </td>
172                                                             <td>[% args.holdings.0.label | html %]</td>
173                                                         </tr>
174                                                            [% END %]
175                                                         [% END %]
176
177                                                         [%- IF CGI.param('detail_record_view')
178                                                             OR (show_more_details.default == 'true'
179                                                             OR show_more_details.default == 'hide');
180                                                         -%]
181                                                         <!-- These fields are visible when viewing the results page in 'detailed' mode -->
182                                                         [% UNLESS rec.mmr_id %]
183                                                         <!-- Do not show publication-specific information on a metarecord search results page -->
184                                                         [% IF attrs.publisher %]
185                                                             <tr name="results_pub_tr">
186                                                                 <td valign="top">
187                                                                     <strong>[% l('Publisher:') %]</strong>
188                                                                 </td>
189                                                                 <td>[% attrs.pubplace | html; %] [% attrs.publisher | html; %] [% attrs.pubdate | html; %]
190 [%-
191 FOR entry IN attrs.graphic_pubinfos;
192     FOR alt IN entry.graphic;
193         diratt = "";
194         IF alt.dir;
195             diratt = ' dir="' _ alt.dir _ '"';
196         END;
197 -%]
198 <div class="graphic880"[% diratt %]>
199     [% alt.value | html %]
200 </div>
201 [%-
202     END;
203 END;
204 -%]
205 </td>
206                                                             </tr>
207                                                         [% ELSIF attrs.producer %]
208                                                             <tr name="results_pub_tr">
209                                                                 <td valign="top">
210                                                                     <strong>[% l('Producer:') %]</strong>
211                                                                 </td>
212                                                                 <td>[% attrs.prodplace | html; %] [% attrs.producer | html; %] [% attrs.proddate | html; %]</td>
213                                                             </tr>
214                                                         [% ELSIF attrs.distributor %]
215                                                             <tr name="results_pub_tr">
216                                                                 <td valign="top">
217                                                                     <strong>[% l('Distributor:') %]</strong>
218                                                                 </td>
219                                                                 <td>[% attrs.distplace | html; %] [% attrs.distributor | html; %] [% attrs.distdate | html; %]</td>
220                                                             </tr>
221                                                         [% ELSIF attrs.manufacturer %]
222                                                             <tr name="results_pub_tr">
223                                                                 <td valign="top">
224                                                                     <strong>[% l('Manufacturer:') %]</strong>
225                                                                 </td>
226                                                                 <td>[% attrs.manplace | html; %] [% attrs.manufacturer | html; %] [% attrs.mandate | html; %]</td>
227                                                             </tr>
228                                                         [% END %]
229                                                         [% IF attrs.isbns.size > 0 %]
230                                                             <tr name="results_isbn_tr">
231                                                                 <td valign="top">
232                                                                     <strong>[% l('ISBN:') %]</strong>
233                                                                 </td>
234                                                                 <td>[% attrs.isbns.0 | html %]</td>
235                                                             </tr>
236                                                         [% END %]
237                                                         [%- IF attrs.issns.size > 0 %]
238                                                             <tr name="results_issn_tr">
239                                                                 <td valign="top">
240                                                                     <strong>[% l('ISSN:') %]</strong>
241                                                                 </td>
242                                                                 <td>[% attrs.issns.0 | html %]</td>
243                                                             </tr>
244                                                         [%- END %]
245                                                         [%- IF openurl.enabled == 'true';
246                                                             FOREACH issn IN args.issns;
247                                                                 NEXT IF issn == '';
248                                                                 res_urls = ResolverResolver.resolve_issn(issn, openurl.baseurl);
249                                                                 FOREACH res IN res_urls;
250                                                         %]
251                                                         <tr name="results_issn_tr">
252                                                             <td valign="top">
253                                                                 <strong><a href="[% res.target_url %]">
254                                                                 [% res.public_name | html %]</a></strong>
255                                                             </td>
256                                                             <td>[% res.target_coverage | html %]
257                                                             [%- IF res.target_embargo != '';
258                                                                     ' - ';
259                                                                     res.target_embargo | html;
260                                                                 END;
261                                                             -%]
262                                                             </td>
263                                                         </tr>
264                                                                 [% END %]
265                                                             [% END %]
266                                                         [% END %]
267
268                                                         [% IF attrs.edition %]
269                                                             <tr name="results_edition_tr">
270                                                                 <td valign="top">
271                                                                     <strong>[% l('Edition:') %]</strong>
272                                                                 </td>
273                                                                 <td>[% attrs.edition | html %]
274 [%-
275 FOR entry IN attrs.graphic_editions;
276     FOR alt IN entry.graphic;
277         diratt = "";
278         IF alt.dir;
279             diratt = ' dir="' _ alt.dir _ '"';
280         END;
281 -%]
282 <div class="graphic880"[% diratt %]>
283     [% alt.value | html %]
284 </div>
285 [%-
286     END;
287 END;
288 -%]
289 </td>
290                                                             </tr>
291                                                         [% END %]
292                                                         [% IF attrs.phys_desc %]
293                                                             <tr name="results_phys_desc_tr">
294                                                                 <td nowrap="nowrap" valign="top">
295                                                                     <strong>[% l('Phys. Desc.:') %]</strong>
296                                                                 </td>
297                                                                 <td>
298                                                                     [% args.phys_desc | html %]
299                                                                 </td>
300                                                             </tr>
301                                                         [% END %]
302                                                         [% FOR uri IN args.uris %]
303                                                             <tr name='bib_uri_list' class='result_table_title_cell'>
304                                                                 <td valign='top'>
305                                                                     <strong>[% l('Electronic resource') %]</strong>
306                                                                 </td>
307                                                                 <td><a href="[% uri.href %]" class="uri_link">[% uri.link | html %]</a>[% ' - ' _ uri.note | html IF uri.note %]</td>
308                                                             </tr>
309                                                             [% END %]
310                                                          [% END %]
311                                                             [%- IF args.holdings.size > 0;
312                                                                 FOREACH copy IN args.holdings;
313                                                                     IF copy.part_label != '';
314                                                                         has_parts = 'true';
315                                                                         LAST;
316                                                                     END;
317                                                                 END;
318                                                             %]
319                                                             <tr name='bib_cn_list' class='result_table_title_cell'>
320                                                                 <td colspan='2'>
321                                                                     <table title="[% l('Record Holdings Details') %]"
322                                                                            class='result_holdings_table'>
323                                                                         <thead><tr>
324                                                                             <th>[% l('Library') %]</th>
325                                                                             <th>[% l('Shelving location') %]</th>
326                                                                             <th>[% l('Call number') %]</th>
327                                                                             [%- IF has_parts == 'true'; %]
328                                                                             <th>[% l('Part') %]</th>
329                                                                             [%- END %]
330                                                                             <th>[% l('Status') %]</th>
331                                                                         </tr></thead>
332                                                                         <tbody>
333                                                                 [% FOR copy IN args.holdings %]
334                                                                         <tr>
335                                                                             <td>
336 [%- copy_info = copy;
337     INCLUDE "opac/parts/library_name_link.tt2"; %]
338                                                                             </td>
339                                                                             <td>[% copy.location | html %]</td>
340                                                                             <td>[% copy.label | html %]</td>
341                                                                             [%- IF has_parts == 'true'; %]
342                                                                             <td>[% copy.part_label %]</td>
343                                                                             [%- END %]
344                                                                             <td>[% copy.status | html %]</td>
345                                                                         </tr>
346                                                                 [% END %]
347                                                                         </tbody>
348                                                                     </table>
349                                                                 </td>
350                                                             </tr>
351                                                             [%- has_parts = 'false';
352                                                                 END;
353                                                              %]
354                                                         [% END %] <!-- END detail_record_view -->
355                                                     </table>
356                                                     [% PROCESS "opac/parts/result/copy_counts.tt2" %]
357                                                     [% IF rec.user_circulated %]
358                                                     <div class="result_item_circulated">
359                                                         <img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('Checked Out Before') %]"/>
360                                                         <span>[% l('I have checked this item out before') %]</span>
361                                                     </div>
362                                                     [% END %]
363                                                     [% IF ctx.bookbag;
364                                                         rec_id = rec.id;
365                                                         FOR note IN ctx.bookbag_items_by_bre_id.$rec_id.notes %]
366                                                     <div class="result-bookbag-item-note">
367                                                         [% note.note | html %]
368                                                     </div>
369                                                         [% END %]
370                                                     [% END %]
371                                                 </div>
372                                                 <div class="result_table_utils_cont">
373                                                     <div class="result_table_utils">
374 [%- search_ou = ctx.search_ou;
375     num_holdable_copies = attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size || 0;
376     IF ctx.place_unfillable ||
377         ( num_holdable_copies > 0
378             && (ctx.holds_block.enabled != 'true' || attrs.org_copy_counts.$search_ou.available == 0)
379         )
380 %]
381                                                         <div class="results_aux_utils place_hold"><a
382                                                                 href="[% mkurl(ctx.opac_root _ '/place_hold',
383                                                                     {hold_target => rec.id, hold_type => hold_type, 
384                                                                       hold_source_page => mkurl()}, ['query','tag','subfield','term','_special','sort','page']) %]"
385                                                                 [% html_text_attr('title', l('Place Hold on [_1]', attrs.title)) %]
386                                                                     class="no-dec" rel="nofollow" vocab=""><img
387                                                                 src="[% ctx.media_prefix %]/images/green_check.png"
388                                                                 alt=""/><span class="result_place_hold">[% l('Place Hold') %]</span></a>
389                                                         </div>
390 [%- END -%]
391                                                         <div class="results_aux_utils result_util">
392                                                             [%  IF ctx.user;
393                                                                 INCLUDE "opac/parts/bookbag_actions.tt2";
394                                                             %]
395                                                             [%  ELSE;
396                                                                 operation = ctx.mylist.grep(rec.id).size ? "delete" : "add";
397                                                                 label = (operation == "add") ?  l("Add to my list") : l("Remove from my list");
398                                                                 title_label = (operation == "add") ? 
399                                                                   l("Add [_1] to my list", attrs.title) : 
400                                                                   l("Remove [_1] from my list", attrs.title);
401                                                                 href = mkurl(ctx.opac_root _ '/mylist/' _ operation, 
402                                                                         {record => rec.id, anchor => 'record_' _ rec.id}, 1);
403                                                             %]      
404                                                             <a href="[% href %]" class="no-dec" 
405                                                                 [% html_text_attr('title', title_label) %] rel="nofollow" vocab="">
406                                                                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
407                                                                 [% label %]
408                                                             </a>
409                                                             [% END %]
410                                                         </div>
411                                                         [% IF ENV.OILS_CONTENT_CAFE_USER %]
412                                                         [% ident = attrs.isbn_clean || attrs.upc %]
413                                                         <div class="results_aux_utils result_util">
414                                                             <a target='_blank' 
415                                                                [% html_text_attr('title', l('Reviews and More for [_1]', attrs.title)) %]
416                                                                 href="[% ctx.ext_proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
417                                                                     ENV.OILS_CONTENT_CAFE_USER %]&amp;Password=[%-
418                                                                     ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&amp;Options=Y" rel="nofollow" vocab="">
419                                                                 <img src='[% ctx.media_prefix %]/images/starz.png' alt="[% l('Ratings Icon') %]"/> 
420                                                                 <span class="results_reviews">[% l('Reviews &amp; More') %]</span>
421                                                             </a>
422                                                         </div>
423                                                         [% END %]
424                                                     </div>
425                                                 </div>
426
427                                             </td>
428
429                                         </tr>
430                                         [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %]
431                                         <tr>
432                                             <td/>
433                                             <td align='center'> <!-- Chilifresh reviews link --> 
434                                                 <span class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </span>
435                                             </td>
436                                         </tr>
437                                         <tr>
438                                             <td/>
439                                             <td colspan='5'> <!-- Chilifresh reviews panel -->
440                                                 <div id="chili_review_[% attrs.isbn_clean | html %]" style="display: none;" align="center"></div>
441                                             </td>
442                                         </tr>
443                                         [%- END %]
444                     [% END %]
445                     </tbody>
446                 </table>
447             </div>
448 </div>
449 <div class="result_footer_nav1">
450     [% ctx.results_count_header %]
451 </div>
452 <script>
453 resultBlock = document.getElementById('result_block');
454 resultButton = document.getElementById('return_to_hits');
455 facetSidebar = document.getElementById('facet_sidebar');
456 facetButton =  document.getElementById('refine_hits');
457 function getFacety() {
458     resultBlock.setAttribute('class', 'result_block_hidden');
459     resultButton.setAttribute('class', 'results_header_btns result_block_visible');
460     facetSidebar.setAttribute('class', 'facet_sidebar_visible');
461     facetButton.setAttribute('class', 'result_block_hidden');
462     window.location.hash = 'return_to_hits';
463 }
464 function getResulty() {
465     resultBlock.setAttribute('class', 'result_block_visible');
466     resultButton.setAttribute('class', 'result_block_hidden');
467     facetSidebar.setAttribute('class', 'facet_sidebar_hidden');
468     facetButton.setAttribute('class', 'results_header_btns result_block_visible');
469     window.location.hash = 'refine_hits';
470 }
471 </script>