]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/result/table.tt2
4bb8f85ce35eda7e76638dafc5d7460dab6f5a87
[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 [% 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">
24                 [% INCLUDE "opac/parts/staff_saved_searches.tt2" %]
25                 [% INCLUDE 'opac/parts/result/facets.tt2' %]
26             </div>
27             <div class="result_block">
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                         <tr class="result_table_row">
35                                             <td class="results_row_count" name="results_row_count">[%
36                                                     result_count; result_count = result_count + 1
37                                                 %].</td>
38                                             <td class='result_table_pic_header'>
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' name='result_table_title_cell'>
46                                                 <div class="bold">
47                                                     <a name='record_[% rec.id %]' name='item_title'
48                                                         href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
49                                                         [% HTML.attributes(title => l('Display record details for "[_1]"', attrs.title)) %]
50                                                         class='search_link'>[% attrs.title | html %]</a>
51                                                 </div>
52                                                 <div>
53                                                     <div>
54                                                         <em><a title="[% l("Perform an Author Search") %]"
55                                                                 name='item_author'
56                                                                 href="[%- 
57                                                                     authorquery = attrs.author | replace('[,\.:;]', '');
58                                                                     mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page'])
59                                                                     -%]">[% attrs.author | html %]</a></em>
60                                                         &nbsp;&nbsp;
61                                                         [% attrs.pubdate | html %]
62                                                     </div>
63                                                     <table cellpadding="0" cellspacing="0" border="0"
64                                                         class="results_info_table">
65                                                         [% IF args.holdings.size > 0 %]
66                                                         <tr name='bib_cn_list' class='result_table_title_cell'>
67                                                             <td valign='top'>
68                                                                 <strong>[% l('Call number:') %]</strong>
69                                                             </td>
70                                                             <td>[% args.holdings.0.label | html %]</td>
71                                                         </tr>
72                                                         [% END %]
73
74                                                         [% IF CGI.param('detail_record_view') %]
75                                                         <!-- These fields are visible when viewing the results page in 'detailed' mode -->
76
77                                                         [% IF attrs.publisher %]
78                                                             <tr name="results_pub_tr">
79                                                                 <td valign="top">
80                                                                     <strong>[% l('Publisher:') %]</strong>
81                                                                 </td>
82                                                                 <td>[% attrs.publisher | html %]</td>
83                                                             </tr>
84                                                         [% END %]
85                                                         [% IF attrs.isbns.size > 0 %]
86                                                             <tr name="results_isbn_tr">
87                                                                 <td valign="top">
88                                                                     <strong>[% l('ISBN:') %]</strong>
89                                                                 </td>
90                                                                 <td>[% attrs.isbns.0 | html %]</td>
91                                                             </tr>
92                                                         [% END %]
93                                                         [%- IF openurl.enabled == 'true';
94                                                             FOREACH issn IN args.issns;
95                                                                 NEXT IF issn == '';
96                                                                 res_urls = ResolverResolver.resolve_issn(issn, openurl.baseurl);
97                                                                 FOREACH res IN res_urls;
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                                                                 FOREACH copy IN args.holdings;
138                                                                     IF copy.part_label != '';
139                                                                         has_parts = 'true';
140                                                                         LAST;
141                                                                     END;
142                                                                 END;
143                                                             %]
144                                                             <tr name='bib_cn_list' class='result_table_title_cell'>
145                                                                 <td colspan='2'>
146                                                                     <table class='result_holdings_table'>
147                                                                         <thead><tr>
148                                                                             <th>[% l('Library') %]</th>
149                                                                             <th>[% l('Shelving location') %]</th>
150                                                                             <th>[% l('Call number') %]</th>
151                                                                             [%- IF has_parts == 'true'; %]
152                                                                             <th>[% l('Part') %]</th>
153                                                                             [%- END %]
154                                                                             <th>[% l('Status') %]</th>
155                                                                         </tr></thead>
156                                                                         <tbody>
157                                                                 [% FOR copy IN args.holdings %]
158                                                                         <tr>
159                                                                             <td>[% copy.library | html %]</td>
160                                                                             <td>[% copy.location | html %]</td>
161                                                                             <td>[% copy.label | html %]</td>
162                                                                             [%- IF has_parts == 'true'; %]
163                                                                             <td>[% copy.part_label %]</td>
164                                                                             [%- END %]
165                                                                             <td>[% copy.status | html %]</td>
166                                                                         </tr>
167                                                                 [% END %]
168                                                                         </tbody>
169                                                                     </table>
170                                                                 </td>
171                                                             </tr>
172                                                             [%- has_parts = 'false';
173                                                                 END;
174                                                              %]
175                                                         [% END %] <!-- END detail_record_view -->
176                                                     </table>
177                                                     [% PROCESS "opac/parts/result/copy_counts.tt2" %]
178                                                     [% IF rec.user_circulated %]
179                                                     <div class="result_item_circulated">
180                                                         <img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('Checked Out Before') %]"/>
181                                                         <span>[% l('I have checked this item out before') %]</span>
182                                                     </div>
183                                                     [% END %]
184                                                     [% IF ctx.bookbag;
185                                                         rec_id = rec.id;
186                                                         FOR note IN ctx.bookbag_items_by_bre_id.$rec_id.notes %]
187                                                     <div class="result-bookbag-item-note">
188                                                         [% note.note | html %]
189                                                     </div>
190                                                         [% END %]
191                                                     [% END %]
192                                                 </div>
193                                             </td>
194
195                                             <td name='result_table_format_cell' class='result_table_format_cell' width="1">
196
197                                                 [% IF attrs.format_icon %]
198                                                 <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
199                                                 [% END %]
200
201                                                 <!-- unAPI link -->
202                                                 <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% rec.id %]'></abbr>
203
204                                                 <!-- Empty span used for creating Google Book Search-->
205                                                 <span name="googleBooksLink" class="hide_me">
206                                                     <a style='padding-left: 8px;'
207                                                         class='classic_link hide_me'
208                                                         name="googleBooks-link">[% l("Browse in Google Books Search") %]</a>
209                                                 </span>
210                                             </td>
211                                             <td nowrap='nowrap' width="1" align="right">
212                                                 <div class="result_table_utils_cont">
213                                                     <div class="result_table_utils">
214                                                         <div class="results_aux_utils place_hold"><a
215                                                                 href="[% mkurl(ctx.opac_root _ '/place_hold', 
216                                                                     {hold_target => rec.id, hold_type => 'T', hold_source_page => mkurl()}) %]" 
217                                                                     name="place_hold_link" class="no-dec"><img
218                                                                 src="[% ctx.media_prefix %]/images/green_check.png"
219                                                                 alt=""/><span class="result_place_hold">[% l('Place Hold') %]</span></a>
220                                                         </div>
221                                                         <div class="results_aux_utils result_util">
222                                                             [%  
223                                                                 operation = ctx.mylist.grep(rec.id).size ? "delete" : "add";
224                                                                 label = (operation == "add") ? l("Add to my list") : l("Remove from my list");
225                                                                 href = mkurl(ctx.opac_root _ '/mylist/' _ operation, 
226                                                                         {record => rec.id, anchor => 'record_' _ rec.id}, 1);
227                                                             %]      
228                                                             <a href="[% href %]" class="no-dec">
229                                                                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
230                                                                 [% label %]
231                                                             </a>
232                                                         </div>
233                                                         [% IF ENV.OILS_CONTENT_CAFE_USER %]
234                                                         <div class="results_aux_utils result_util">
235                                                             <a title="[% l('Reviews and More') %]" target='_blank' 
236                                                                 href="[% ctx.proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
237                                                                     ENV.OILS_CONTENT_CAFE_USER %]&amp;Password=[%-
238                                                                     ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&Options=Y">
239                                                                 <img src='[% ctx.media_prefix %]/images/starz.png'/> 
240                                                                 <span class="results_reviews">[% l('Reviews &amp; More') %]</span>
241                                                             </a>
242                                                         </div>
243                                                         [% END %]
244                                                     </div>
245                                                 </div>
246                                             </td>
247                                         [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %]
248                                         </tr>
249                                         <tr>
250                                             <td/>
251                                             <td align='center'> <!-- Chilifresh reviews link --> 
252                                                 <span class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </span>
253                                             </td>
254                                         </tr>
255                                         <tr>
256                                             <td/>
257                                             <td colspan='5'> <!-- Chilifresh reviews panel -->
258                                                 <div id="chili_review_[% attrs.isbn_clean | html %]" style="display: none;" align="center"></div>
259                                             </td>
260                                         </tr>
261                                         [%- END %]
262                         </tr>
263                     [% END %]
264                     </tbody>
265                 </table>
266             </div>
267 </div>
268 <div>
269     [% ctx.results_count_header %]
270 </div>