]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/result/table.tt2
TPac: Put staff saved searches in same div as facets on the results page
[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 <div style="height: 10px;"></div>
13
14 [% PROCESS "opac/parts/result/paginate.tt2" %] 
15 [% ctx.results_count_header = PROCESS results_count_header;
16     ctx.results_count_header %]
17
18 <div id="result_table_div">
19     <table cellpadding="0" cellspacing="0" border="0" width="100%">
20         <tr>
21             <td valign="top" width="1" style="padding-right:20px;">
22                 <div style="width:174px;">
23                     [% INCLUDE "opac/parts/staff_saved_searches.tt2" %]
24                     [% INCLUDE 'opac/parts/result/facets.tt2' %]
25                 </div>
26             </td>
27             <td class='opac-auto-015' width="1"></td>
28             <td valign="top">
29                 <table cellpadding="0" cellspacing="0"
30                     border="0" width="100%" 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                         <tr>
36                             <td class='result_table_row' align='left' width='100%'>
37                                 <table cellpadding="0" cellspacing="0" class='result_table_subtable'>
38                                     <tbody class='result_table_subtbody'>
39                                         <tr name='counts_row'>
40                                             <td width="58" valign="top"
41                                                 style="font-weight:bold;padding-left:10px;"
42                                                 name="results_row_count">[%
43                                                     result_count; result_count = result_count + 1
44                                                 %].</td>
45                                             <td class='result_table_pic_header' align='center'
46                                                 width="78" nowrap="nowrap" valign="top">
47                                                 [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
48                                                 <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"><img alt="[% l('Image of item') %]"
49                                                         name='item_jacket' class='result_table_pic' width="55"
50                                                         src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident | uri %]' /></a><br />
51                                                 [% END %]
52                                             </td>
53                                             <td class='result_table_title_cell'
54                                                 name='result_table_title_cell'
55                                                 valign="top">
56                                                 <div class="bold">
57                                                     <a name='record_[% rec.id %]' title="[% attrs.title | uri %]" name='item_title'
58                                                         href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
59                                                         class='search_link'>[% attrs.title | html %]</a>
60                                                 </div>
61                                                 <div style="font-size:11px;">
62                                                     <div>
63                                                         <em><a title="[% l("Perform an Author Search") %]"
64                                                                 name='item_author'
65                                                                 href="[%- 
66                                                                     authorquery = attrs.author | replace('[,\.:;]', '');
67                                                                     mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page'])
68                                                                     -%]">[% attrs.author | html %]</a></em>
69                                                         &nbsp;&nbsp;
70                                                         [% attrs.pubdate | html %]
71                                                     </div>
72                                                     <table cellpadding="0" cellspacing="0" border="0"
73                                                         class="results_info_table">
74                                                         [% IF args.holdings.size > 0 %]
75                                                         <tr name='bib_cn_list' class='result_table_title_cell'>
76                                                             <td valign='top'>
77                                                                 <strong>[% l('Call number:') %]</strong>
78                                                             </td>
79                                                             <td>[% args.holdings.0.label | html %]</td>
80                                                         </tr>
81                                                         [% END %]
82
83                                                         [% IF CGI.param('detail_record_view') %]
84                                                         <!-- These fields are visible when viewing the results page in 'detailed' mode -->
85
86                                                         [% IF attrs.publisher %]
87                                                             <tr name="results_pub_tr">
88                                                                 <td valign="top">
89                                                                     <strong>[% l('Publisher:') %]</strong>
90                                                                 </td>
91                                                                 <td>[% attrs.publisher | html %]</td>
92                                                             </tr>
93                                                         [% END %]
94                                                         [% IF attrs.isbns.size > 0 %]
95                                                             <tr name="results_isbn_tr">
96                                                                 <td valign="top">
97                                                                     <strong>[% l('ISBN:') %]</strong>
98                                                                 </td>
99                                                                 <td>[% attrs.isbns.0 | html %]</td>
100                                                             </tr>
101                                                         [% END %]
102                                                         [%- IF openurl.enabled == 'true';
103                                                             FOR issn IN args.issns;
104                                                                 sfx = ResolverResolver.resolve_issn(issn, openurl.baseurl);
105                                                                 FOR res IN sfx;
106                                                         %]
107                                                         <tr name="results_issn_tr">
108                                                             <td valign="top">
109                                                                 <strong><a href="[% res.target_url %]">
110                                                                 [% res.public_name | html %]</a></strong>
111                                                             </td>
112                                                             <td>[% res.target_coverage | html %]</td>
113                                                         </tr>
114                                                                 [% END %]
115                                                             [% END %]
116                                                         [% END %]
117
118                                                         [% IF attrs.edition %]
119                                                             <tr name="results_edition_tr">
120                                                                 <td valign="top">
121                                                                     <strong>[% l('Edition:') %]</strong>
122                                                                 </td>
123                                                                 <td>[% attrs.edition | html %]</td>
124                                                             </tr>
125                                                         [% END %]
126                                                         [% IF attrs.phys_desc %]
127                                                             <tr name="results_phys_desc_tr">
128                                                                 <td nowrap="nowrap" valign="top">
129                                                                     <strong>[% l('Phys. Desc.:') %]</strong>
130                                                                 </td>
131                                                                 <td>
132                                                                     [% args.phys_desc | html %]
133                                                                 </td>
134                                                             </tr>
135                                                         [% END %]
136                                                         [% FOR uri IN args.uris %]
137                                                             <tr name='bib_uri_list' class='result_table_title_cell'>
138                                                                 <td valign='top'>
139                                                                     <strong>[% l('Electronic resource') %]</strong>
140                                                                 </td>
141                                                                 <td><a href="[% uri.href %]">[% uri.link | html %]</a>[% ' - ' _ uri.note | html IF uri.note %]</td>
142                                                             </tr>
143                                                             [% END %]
144                                                             [% IF args.holdings.size > 0 %]
145                                                             <tr name='bib_cn_list' class='result_table_title_cell'>
146                                                                 <td colspan='2'>
147                                                                     <table class='result_holdings_table'>
148                                                                         <thead><tr>
149                                                                             <th>[% l('Library') %]</th>
150                                                                             <th>[% l('Shelving location') %]</th>
151                                                                             <th>[% l('Call number') %]</th>
152                                                                             <th>[% l('Status') %]</th>
153                                                                         </tr></thead>
154                                                                         <tbody>
155                                                                 [% FOR copy IN args.holdings %]
156                                                                         <tr>
157                                                                             <td>[% copy.library | html %]</td>
158                                                                             <td>[% copy.location | html %]</td>
159                                                                             <td>[% copy.label | html %]</td>
160                                                                             <td>[% copy.status | html %]</td>
161                                                                         </tr>
162                                                                 [% END %]
163                                                                         </tbody>
164                                                                     </table>
165                                                                 </td>
166                                                             </tr>
167                                                         [% END %]
168                                                         [% END %] <!-- END detail_record_view -->
169                                                     </table>
170                                                     <div>
171                                                         [% l('[_1] of [quant,_2,copy,copies] available',
172                                                             attrs.copy_counts.available, attrs.copy_counts.count) # XXX s/count/nshadow/ ?
173                                                             #rec.copy_counts.available, rec.copy_counts.visible) 
174                                                         %]
175                                                     </div>
176                                                 </div>
177                                                 <div class="hide_me">
178                                                     <span name='result_table_extra_span' class='hide_me'>
179                                                         <span name='result_table_pub_box'
180                                                             style='padding-left: 10px;'>
181                                                             <span name='result_table_edition_span'
182                                                                 style='padding-left: 10px;'></span> |
183                                                             <span name='result_table_pub_span'> </span> |
184                                                             <span name='result_table_phys_span'> </span>
185                                                         </span>
186                                                     </span>
187                                                 </div>
188                                             </td>
189
190                                             <td name='result_table_format_cell' class='result_table_format_cell' width="1">
191
192                                                 [% IF attrs.format_icon %]
193                                                 <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
194                                                 [% END %]
195
196                                                 <!-- unAPI link -->
197                                                 <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% rec.id %]'></abbr>
198
199                                                 <!-- Empty span used for creating Google Book Search-->
200                                                 <span name="googleBooksLink" class="hide_me">
201                                                     <a style='padding-left: 8px;'
202                                                         class='classic_link hide_me'
203                                                         name="googleBooks-link">[% l("Browse in Google Books Search") %]</a>
204                                                 </span>
205
206                                             </td>
207                                             <td nowrap='nowrap' width="1" align="right">
208                                                 <div style="width:250px;text-align:left;">
209                                                     <div style="float:right;">
210                                                         <div class="results_aux_utils opac-auto-010"><a
211                                                                 href="[% mkurl(ctx.opac_root _ '/place_hold', {hold_target => rec.id, hold_type => 'T'}) %]" 
212                                                                     name="place_hold_link" class="no-dec"><img
213                                                                 src="[% ctx.media_prefix %]/images/green_check.png"
214                                                                 alt=""/><span style="position:relative;top:-3px;left:3px;">[% l('Place Hold') %]</span></a>
215                                                         </div>
216                                                         <div class="results_aux_utils opac-auto-011">
217                                                             [%  
218                                                                 operation = ctx.mylist.grep(rec.id).size ? "delete" : "add";
219                                                                 label = (operation == "add") ? l("Add to my list") : l("Remove from my list");
220                                                                 href = mkurl(ctx.opac_root _ '/mylist/' _ operation, 
221                                                                         {record => rec.id, anchor => 'record_' _ rec.id}, 1);
222                                                             %]      
223                                                             <a href="[% href %]" class="no-dec">
224                                                                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
225                                                                 [% label %]
226                                                             </a>
227                                                         </div>
228                                                         [% IF ENV.OILS_CONTENT_CAFE_USER %]
229                                                         <div class="results_aux_utils opac-auto-011">
230                                                             <a title="[% l('Reviews and More') %]" target='_blank' 
231                                                                 href="[% ctx.proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
232                                                                     ENV.OILS_CONTENT_CAFE_USER %]&amp;Password=[%-
233                                                                     ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&Options=Y">
234                                                                 <img src='[% ctx.media_prefix %]/images/starz.png'/> 
235                                                                 <span style='position:relative;top:-5px;'>[% l('Reviews &amp; More') %]</span>
236                                                             </a>
237                                                         </div>
238                                                         [% END %]
239                                                     </div>
240                                                 </div>
241                                             </td>
242                                         </tr>
243                                         <tr>
244                                             <td/>
245                                             <td align='center'> <!-- Chilifresh reviews link --> 
246                                                 <div class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </div>
247                                             </td>
248                                         </tr>
249                                         <tr>
250                                             <td/>
251                                             <td colspan='5'> <!-- Chilifresh reviews panel -->
252                                                 <div id="chili_review_[% attrs.isbn_clean | html %]" style="display: none;" align="center" width="100%"></div>
253                                             </td>
254                                         </tr>
255                                         <tr><td colspan="5"><div style="height:0px;border-top:1px solid #b7b7b7;border-bottom:1px solid #d4d4d4;margin:15px 0px;"></div></td></tr>
256                                     </tbody>
257                                 </table>
258                             </td>
259                         </tr>
260                     [% END %]
261                     </tbody>
262                 </table>
263             </td>
264         </tr>
265     </table>
266 </div>
267 <div>
268     [% ctx.results_count_header %]
269 </div>