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