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