diff --git a/openlibrary/macros/DownloadOptions.html b/openlibrary/macros/DownloadOptions.html new file mode 100644 index 00000000000..9b2177f3302 --- /dev/null +++ b/openlibrary/macros/DownloadOptions.html @@ -0,0 +1,24 @@ +$def with(page) + +$ downloadbook = page.get_ia_download_link(".pdf") +$ pdfbw = page.get_ia_download_link("_bw.pdf") +$ epub = page.get_ia_download_link(".epub") +$ mobi = page.get_ia_download_link(".mobi") +$ kindle = "https://www.amazon.com/gp/digital/fiona/web-to-kindle?clientid=IA&itemid=XXX&docid=XXX" +$ djvutxt = page.get_ia_download_link("_djvu.txt") + +$if downloadbook or djvutxt or epub or mobi: +
Download Options
+ +- Read eBook -
- $ return_url = page.url().rsplit('/', 1)[0] + '/do_return/borrow' - - $:macros.daisy(page) +$if user_loan: ++ Read eBook +
+ $ return_url = page.url().rsplit('/', 1)[0] + '/do_return/borrow' + + +$elif (availability == 'borrow_available') or my_turn_to_borrow: ++ + Borrow eBook + +
+ +$elif (availability == 'borrow_unavailable'): + $if waiting_loan: ++ $ spot = ctx.user.get_waiting_loan_for(page)['position'] + $if spot == 1: + You are next on the waiting list + $else: + You are #$(spot) of $(wlsize) on the waiting list. +
+ - $elif (availability == 'borrow_available') or my_turn_to_borrow: -- - Borrow eBook - -
- $:macros.daisy(page) + $else: ++ $("Readers waiting for this title: %s" % wlsize if wlsize else "You'll be next in line.") +
+ - $else: - $if waiting_loan: -- $ spot = ctx.user.get_waiting_loan_for(page)['position'] - $if spot == 1: - You are next on the waiting list - $else: - You are #$(spot) of $(wlsize) on the waiting list. -
- - $:macros.daisy(page) - $else: -- $("Readers waiting for this title: %s" % wlsize if wlsize else "You'll be next in line.") -
- - $:macros.daisy(page) +$elif page.get('ocaid') and not page.is_access_restricted() and editions_page: + $ viewbook = "//%s/stream/XXX?ref=ol" % bookreader_host() + - $if editions_page: - $ checkedout = current_and_available_loans[0] if current_and_available_loans else [] - $if checkedout and not user_loan: - $if work and work.edition_count > 1: -- Other editions of this book may be available: -
- -No ebook available.
-$if editions_page: - $:macros.WorldcatLink(isbn=isbn, oclc_numbers=oclc_numbers) -$if editions_page: - $ share_links = ctx.get('share_links') - $if share_links: -+ Other editions of this book may be available: +
+ +