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