2 # Display holdings/availability info from ebook API
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)
10 ebook.ebook_id = args.ebook_test_id;
11 ebook.vendor = 'ebook_test';
12 ELSIF args.oneclickdigital_id;
13 ebook.ebook_id = args.oneclickdigital_id;
14 ebook.vendor = 'oneclickdigital';
15 ELSIF args.overdrive_id;
16 ebook.ebook_id = args.overdrive_id;
17 ebook.vendor = 'overdrive';
22 IF ctx.page == 'rresult';
23 ebook.rec_id = rec.id;
25 ebook.rec_id = ctx.bre_id;
28 # This div is hidden by default. The JS layer will unhide it, use the ebook_id
29 # to retrieve holdings/availability info via the appropriate vendor API, and
30 # overwrite the div's contents with that information.
32 <div id="[% ebook.rec_id %]" class="ebook_avail hidden">
33 <div id="[% ebook.ebook_id %]" class="[% ebook.vendor %]_avail">
34 <table id="[% ebook.rec_id %]_ebook_holdings" class="result_holdings_table hidden">
37 <th>[% l('Available Formats') %]</th>
38 <th>[% l('Status') %]</th>
42 <td id="[% ebook.rec_id %]_formats"></td>
43 <td id="[% ebook.rec_id %]_status"></td>