]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/ebook_api/avail.tt2
9df0465cc43a61cf8f2f3c4658c039868ef5e1f2
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / ebook_api / avail.tt2
1 [%-
2 # Display holdings/availability info from ebook API
3 #
4 # We require the following info:
5 # - rec_id: internal ID for this record (rec.id in search results, ctx.bre_id in record summary)
6 # - ebook_id: external ID for title (ISBN for OneClickdigital, unique identifier for OverDrive)
7 # - vendor (oneclickdigital, overdrive)
8
9 IF args.ebook;
10
11     IF ctx.page == 'rresult';
12         ebook.rec_id = rec.id;
13     ELSE;
14         ebook.rec_id = ctx.bre_id;
15     END;
16
17     ebook.ebook_id = args.ebook.ebook_id;
18     ebook.vendor = args.ebook.vendor;
19
20 # This div is hidden by default. The JS layer will unhide it, use the ebook_id
21 # to retrieve holdings/availability info via the appropriate vendor API, and
22 # overwrite the div's contents with that information.
23 -%]
24 <div id="[% ebook.rec_id %]" class="ebook_avail hidden">
25     <div id="[% ebook.ebook_id %]" class="[% ebook.vendor %]_avail">
26         <table id="[% ebook.rec_id %]_ebook_holdings" class="result_holdings_table hidden">
27             <thead>
28                 <tr>
29                     <th>[% l('Available Formats') %]</th>
30                     <th>[% l('Status') %]</th>
31                 </tr>
32             <tbody>
33                 <tr>
34                     <td id="[% ebook.rec_id %]_formats"></td>
35                     <td id="[% ebook.rec_id %]_status"></td>
36                 </tr>
37             </tbody>
38         </table>
39     </div>
40 </div>
41 [% END %]