]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/default/opac/parts/result/table.tt2
Merge branch 'master' of git.evergreen-ils.org:Evergreen into template-toolkit-opac...
[working/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 = mkurl('', {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 = mkurl('', {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="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"><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="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
95                                                         class='search_link'>[% attrs.title | html_entity%]</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="[%- 
102                                                                     authorquery = attrs.author | replace('[,\.:;]', '');
103                                                                     mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery})
104                                                                     -%]">[% attrs.author | html_entity %]</a></em>
105                                                         &nbsp;&nbsp;
106                                                         [% attrs.pubdate %]
107                                                     </div>
108                                                     <table cellpadding="0" cellspacing="0" border="0"
109                                                         class="results_info_table">
110                                                     [% IF attrs.publisher %]
111                                                         <tr name="results_pub_tr">
112                                                             <td valign="top">
113                                                                 <strong>[% l('Publisher:') %]</strong>
114                                                             </td>
115                                                             <td>[% attrs.publisher; %]</td>
116                                                         </tr>
117                                                     [% END %]
118                                                     [% IF attrs.isbn.0 %]
119                                                         <tr name="results_isbn_tr">
120                                                             <td valign="top">
121                                                                 <strong>[% l('ISBN:') %]</strong>
122                                                             </td>
123                                                             <td>[% attrs.isbns.0 %]</td>
124                                                         </tr>
125                                                     [% END %]
126                                                         [% IF openurl.enabled == 'true';
127                                                             FOR issn IN args.issns;
128                                                                 sfx = ResolverResolver.resolve_issn(issn, openurl.baseurl);
129                                                                 FOR res IN sfx;
130                                                         %]
131                                                         <tr name="results_issn_tr">
132                                                             <td valign="top">
133                                                                 <strong><a href="[% res.target_url %]">
134                                                                 [% res.public_name %]</a></strong>
135                                                             </td>
136                                                             <td>[% res.target_coverage %]</td>
137                                                         </tr>
138                                                                 [% END %]
139                                                             [% END %]
140                                                         [% END %]
141
142                                                     [% IF attrs.edition %]
143                                                         <tr name="results_edition_tr">
144                                                             <td valign="top">
145                                                                 <strong>[% l('Edition:') %]</strong>
146                                                             </td>
147                                                             <td>[% attrs.edition %]</td>
148                                                         </tr>
149                                                     [% END %]
150                                                     [% IF attrs.phys_desc %]
151                                                         <tr name="results_phys_desc_tr">
152                                                             <td nowrap="nowrap" valign="top">
153                                                                 <strong>[% l('Phys. Desc.:') %]</strong>
154                                                             </td>
155                                                             <td>
156                                                                 [% args.phys_desc %]
157                                                             </td>
158                                                         </tr>
159                                                     [% END %]
160                                                         [% FOR uri IN args.uris %]
161                                                         <tr name='bib_uri_list' class='result_table_title_cell'>
162                                                             <td valign='top'>
163                                                                 <strong>[% l('Electronic resource') %]</strong>
164                                                             </td>
165                                                             <td><a href="[% uri.href %]">[% uri.link %]</a>[% ' - ' _ uri.note IF uri.note %]</td>
166                                                         </tr>
167                                                         [% END %]
168                                                         [% IF args.holdings.size > 0 %]
169                                                         <tr name='bib_cn_list' class='result_table_title_cell'>
170                                                             <td colspan='2'>
171                                                                 <table class='result_holdings_table'>
172                                                                     <thead><tr>
173                                                                         <th>[% l('Library') %]</th>
174                                                                         <th>[% l('Shelving location') %]</th>
175                                                                         <th>[% l('Call number') %]</th>
176                                                                         <th>[% l('Status') %]</th>
177                                                                     </tr></thead>
178                                                                     <tbody>
179                                                             [% FOR copy IN args.holdings %]
180                                                                     <tr>
181                                                                         <td>[% copy.library %]</td>
182                                                                         <td>[% copy.location %]</td>
183                                                                         <td>[% copy.label %]</td>
184                                                                         <td>[% copy.status %]</td>
185                                                                     </tr>
186                                                             [% END %]
187                                                                     </tbody>
188                                                                 </table>
189                                                             </td>
190                                                         </tr>
191                                                         [% END %]
192                                                     </table>
193                                                     <div>
194                                                         [% l('[_1] of [quant,_2,copy,copies] available',
195                                                             attrs.copy_counts.available, attrs.copy_counts.count) # XXX s/count/nshadow/ ?
196                                                             #rec.copy_counts.available, rec.copy_counts.visible) 
197                                                         %]
198                                                     </div>
199                                                 </div>
200                                                 <div class="hide_me">
201                                                     <span name='result_table_extra_span' class='hide_me'>
202                                                         <span name='result_table_pub_box'
203                                                             style='padding-left: 10px;'>
204                                                             <span name='result_table_edition_span'
205                                                                 style='padding-left: 10px;'></span> |
206                                                             <span name='result_table_pub_span'> </span> |
207                                                             <span name='result_table_phys_span'> </span>
208                                                         </span>
209                                                     </span>
210                                                 </div>
211                                             </td>
212
213                                             <td name='result_table_format_cell' class='result_table_format_cell' width="1">
214
215                                                 [% IF attrs.format_icon %]
216                                                 <img title="[% attrs.format_label %]" alt="[% attrs.format_label %]" src="[% attrs.format_icon %]" />
217                                                 [% END %]
218
219                                                 <!-- unAPI link -->
220                                                 <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% rec.id %]'></abbr>
221
222                                                 <!-- Empty span used for creating Google Book Search-->
223                                                 <span name="googleBooksLink" class="hide_me">
224                                                     <a style='padding-left: 8px;'
225                                                         class='classic_link hide_me'
226                                                         name="googleBooks-link">[% l("Browse in Google Books Search") %]</a>
227                                                 </span>
228
229                                             </td>
230                                             <td nowrap='nowrap' width="1" align="right">
231                                                 <div style="width:250px;text-align:left;">
232                                                     <div style="float:right;">
233                                                         <div class="results_aux_utils opac-auto-010"><a
234                                                                 href="[% mkurl(ctx.opac_root _ '/place_hold', {hold_target => rec.id, hold_type => 'T'}) %]" 
235                                                                     name="place_hold_link" class="no-dec"><img
236                                                                 src="[% ctx.media_prefix %]/images/green_check.png"
237                                                                 alt=""/><span style="position:relative;top:-3px;left:3px;">[% l('Place Hold') %]</span></a>
238                                                         </div>
239                                                         <div class="results_aux_utils opac-auto-011">
240                                                             [%  
241                                                                 operation = ctx.mylist.grep(rec.id).size ? "delete" : "add";
242                                                                 label = (operation == "add") ? l("Add to my list") : l("Remove from my list");
243                                                             %]      
244                                                             <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => rec.id}, 1) %]" class="no-dec">
245                                                                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
246                                                                 [% label %]
247                                                             </a>
248                                                         </div>
249                                                     </div>
250                                                 </div>
251                                             </td>
252                                         </tr>
253                                         <tr>
254                                             <td/>
255                                             <td align='center'>
256                                                 <!-- Chilifresh link and reviews panel --> 
257                                                 <div class="chili_review" id="isbn_[% attrs.isbn_clean %]"> </div>
258                                                 <div id="chili_review_[% attrs.isbn_clean %]" style="display: none;" align="center" width="100%"></div>
259                                             </td>
260                                         </tr>
261                                         <tr><td colspan="5"><div style="height:0px;border-top:1px solid #b7b7b7;border-bottom:1px solid #d4d4d4;margin:15px 0px;"></div></td></tr>
262                                     </tbody>
263                                 </table>
264                             </td>
265                         </tr>
266                     [% END %]
267                     </tbody>
268                 </table>
269             </td>
270         </tr>
271     </table>
272 </div>
273 <div>
274     [% ctx.results_count_header %]
275 </div>