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