]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/default/opac/parts/result/table.tt2
Address ISBN issues in T-PAC
[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
14 [% PROCESS "default/opac/parts/result/paginate.tt2" %] 
15 [% ctx.results_count_header = PROCESS results_count_header;
16     ctx.results_count_header %]
17
18 <div id="result_table_div">
19     <table cellpadding="0" cellspacing="0" border="0" width="100%">
20         <tr>
21             <td valign="top" width="1" style="padding-right:20px;">
22                 <div style="width:174px;" class="hide_me" id="tehSideBar">SIDEBAR TODO
23                 </div>
24             </td>
25             <td class='opac-auto-015' width="1"></td>
26             <td valign="top">
27                 <table id="res_table" cellpadding="0" cellspacing="0"
28                     border="0" width="100%" style="margin-top:10px;">
29                     <tbody id="result_table">
30                     [%  FOR rec IN ctx.records;
31                             attrs = {marc_xml => rec.marc_xml};
32                             PROCESS get_marc_attrs args=attrs %]
33                         <tr>
34                             <td class='result_table_row' align='left' width='100%'>
35                                 <table cellpadding="0" cellspacing="0" class='result_table_subtable'>
36                                     <tbody class='result_table_subtbody'>
37                                         <tr name='counts_row'>
38                                             <td width="58" valign="top"
39                                                 style="font-weight:bold;padding-left:10px;"
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 %]' /></a><br />
49                                                 [% END %]
50                                             </td>
51                                             <td class='result_table_title_cell'
52                                                 name='result_table_title_cell'
53                                                 valign="top">
54                                                 <div class="bold">
55                                                     <a title="[% attrs.title %]" name='item_title'
56                                                         href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
57                                                         class='search_link'>[% attrs.title | html_entity%]</a>
58                                                 </div>
59                                                 <div style="font-size:11px;">
60                                                     <div>
61                                                         <em><a title="[% l("Perform an Author Search") %]"
62                                                                 name='item_author'
63                                                                 href="[%- 
64                                                                     authorquery = attrs.author | replace('[,\.:;]', '');
65                                                                     mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery})
66                                                                     -%]">[% attrs.author | html_entity %]</a></em>
67                                                         &nbsp;&nbsp;
68                                                         [% attrs.pubdate %]
69                                                     </div>
70                                                     <table cellpadding="0" cellspacing="0" border="0"
71                                                         class="results_info_table">
72                                                         [% IF args.holdings.size > 0 %]
73                                                         <tr name='bib_cn_list' class='result_table_title_cell'>
74                                                             <td valign='top'>
75                                                                 <strong>[% l('Call number:') %]</strong>
76                                                             </td>
77                                                             <td>[% args.holdings.0.label %]</td>
78                                                         </tr>
79                                                         [% END %]
80
81                                                         [% IF CGI.param('detail_record_view') %]
82                                                         <!-- These fields are visible when viewing the results page in 'detailed' mode -->
83
84                                                         [% IF attrs.publisher %]
85                                                             <tr name="results_pub_tr">
86                                                                 <td valign="top">
87                                                                     <strong>[% l('Publisher:') %]</strong>
88                                                                 </td>
89                                                                 <td>[% attrs.publisher; %]</td>
90                                                             </tr>
91                                                         [% END %]
92                                                         [% IF attrs.isbns.size > 0 %]
93                                                             <tr name="results_isbn_tr">
94                                                                 <td valign="top">
95                                                                     <strong>[% l('ISBN:') %]</strong>
96                                                                 </td>
97                                                                 <td>[% attrs.isbns.0 %]</td>
98                                                             </tr>
99                                                         [% END %]
100                                                         [% IF openurl.enabled == 'true';
101                                                             FOR issn IN args.issns;
102                                                                 sfx = ResolverResolver.resolve_issn(issn, openurl.baseurl);
103                                                                 FOR res IN sfx;
104                                                         %]
105                                                         <tr name="results_issn_tr">
106                                                             <td valign="top">
107                                                                 <strong><a href="[% res.target_url %]">
108                                                                 [% res.public_name %]</a></strong>
109                                                             </td>
110                                                             <td>[% res.target_coverage %]</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 %]</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 %]
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 %]</a>[% ' - ' _ uri.note IF uri.note %]</td>
140                                                             </tr>
141                                                             [% END %]
142                                                             [% IF args.holdings.size > 0 %]
143                                                             <tr name='bib_cn_list' class='result_table_title_cell'>
144                                                                 <td colspan='2'>
145                                                                     <table class='result_holdings_table'>
146                                                                         <thead><tr>
147                                                                             <th>[% l('Library') %]</th>
148                                                                             <th>[% l('Shelving location') %]</th>
149                                                                             <th>[% l('Call number') %]</th>
150                                                                             <th>[% l('Status') %]</th>
151                                                                         </tr></thead>
152                                                                         <tbody>
153                                                                 [% FOR copy IN args.holdings %]
154                                                                         <tr>
155                                                                             <td>[% copy.library %]</td>
156                                                                             <td>[% copy.location %]</td>
157                                                                             <td>[% copy.label %]</td>
158                                                                             <td>[% copy.status %]</td>
159                                                                         </tr>
160                                                                 [% END %]
161                                                                         </tbody>
162                                                                     </table>
163                                                                 </td>
164                                                             </tr>
165                                                         [% END %]
166                                                         [% END %] <!-- END detail_record_view -->
167                                                     </table>
168                                                     <div>
169                                                         [% l('[_1] of [quant,_2,copy,copies] available',
170                                                             attrs.copy_counts.available, attrs.copy_counts.count) # XXX s/count/nshadow/ ?
171                                                             #rec.copy_counts.available, rec.copy_counts.visible) 
172                                                         %]
173                                                     </div>
174                                                 </div>
175                                                 <div class="hide_me">
176                                                     <span name='result_table_extra_span' class='hide_me'>
177                                                         <span name='result_table_pub_box'
178                                                             style='padding-left: 10px;'>
179                                                             <span name='result_table_edition_span'
180                                                                 style='padding-left: 10px;'></span> |
181                                                             <span name='result_table_pub_span'> </span> |
182                                                             <span name='result_table_phys_span'> </span>
183                                                         </span>
184                                                     </span>
185                                                 </div>
186                                             </td>
187
188                                             <td name='result_table_format_cell' class='result_table_format_cell' width="1">
189
190                                                 [% IF attrs.format_icon %]
191                                                 <img title="[% attrs.format_label %]" alt="[% attrs.format_label %]" src="[% attrs.format_icon %]" />
192                                                 [% END %]
193
194                                                 <!-- unAPI link -->
195                                                 <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% rec.id %]'></abbr>
196
197                                                 <!-- Empty span used for creating Google Book Search-->
198                                                 <span name="googleBooksLink" class="hide_me">
199                                                     <a style='padding-left: 8px;'
200                                                         class='classic_link hide_me'
201                                                         name="googleBooks-link">[% l("Browse in Google Books Search") %]</a>
202                                                 </span>
203
204                                             </td>
205                                             <td nowrap='nowrap' width="1" align="right">
206                                                 <div style="width:250px;text-align:left;">
207                                                     <div style="float:right;">
208                                                         <div class="results_aux_utils opac-auto-010"><a
209                                                                 href="[% mkurl(ctx.opac_root _ '/place_hold', {hold_target => rec.id, hold_type => 'T'}) %]" 
210                                                                     name="place_hold_link" class="no-dec"><img
211                                                                 src="[% ctx.media_prefix %]/images/green_check.png"
212                                                                 alt=""/><span style="position:relative;top:-3px;left:3px;">[% l('Place Hold') %]</span></a>
213                                                         </div>
214                                                         <div class="results_aux_utils opac-auto-011">
215                                                             [%  
216                                                                 operation = ctx.mylist.grep(rec.id).size ? "delete" : "add";
217                                                                 label = (operation == "add") ? l("Add to my list") : l("Remove from my list");
218                                                             %]      
219                                                             <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => rec.id}, 1) %]" class="no-dec">
220                                                                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
221                                                                 [% label %]
222                                                             </a>
223                                                         </div>
224                                                     </div>
225                                                 </div>
226                                             </td>
227                                         </tr>
228                                         <tr>
229                                             <td/>
230                                             <td align='center'> <!-- Chilifresh reviews link --> 
231                                                 <div class="chili_review" id="isbn_[% attrs.isbn_clean %]"> </div>
232                                             </td>
233                                         </tr>
234                                         <tr>
235                                             <td/>
236                                             <td colspan='5'> <!-- Chilifresh reviews panel -->
237                                                 <div id="chili_review_[% attrs.isbn_clean %]" style="display: none;" align="center" width="100%"></div>
238                                             </td>
239                                         </tr>
240                                         <tr><td colspan="5"><div style="height:0px;border-top:1px solid #b7b7b7;border-bottom:1px solid #d4d4d4;margin:15px 0px;"></div></td></tr>
241                                     </tbody>
242                                 </table>
243                             </td>
244                         </tr>
245                     [% END %]
246                     </tbody>
247                 </table>
248             </td>
249         </tr>
250     </table>
251 </div>
252 <div>
253     [% ctx.results_count_header %]
254 </div>