$def with (page, worldcat_links, affiliate_links, editions_page=False, render_times={}) $ viewbook = "//%s/stream/XXX?ref=ol" % bookreader_host()
$if page.volumes:

### $_("Browse")

$for v in page.volumes: $if v.ia_id != "-":

$_('View Volume %(num)d', num=v.volume_number)

$:render_template('covers/book_cover', page, preload=True) $# Don't display add/change cover link for /books/ia:foo00bar pages $if not page.is_fake_record(): $:render_template('covers/change', page, ".edition-cover .bookCover img")
$ work = (page.works and page.works[0]) or page $ edition = page.works and page $ render_times['databarWork: List widget'] = time() $ lists_widget = render_template('lists/widget', edition or work, include_rating=True, include_header=False, include_widget=True, include_showcase=False, async_load=True, show_active_lists=True) $ render_times['databarWork: List widget'] = time() - render_times['databarWork: List widget'] $# For the Works & Editions page, only use ground_truth_availability API for selected Edition $# if edition availability status is error $ render_times['databarWork: LoanStatus'] = time() $ expensive_check = page.get('availability', {}).get('status') in ['error'] $:macros.LoanStatus(page, allow_expensive_availability_check=expensive_check, secondary_action=editions_page, check_loan_status=editions_page, post=lists_widget) $ render_times['databarWork: LoanStatus'] = time() - render_times['databarWork: LoanStatus']

$ share_url = request.home + (edition or work).key $ render_times['databarWork: Modal Links - Desktop'] = time() $:render_template("type/edition/modal_links", work, edition, share_url) $ render_times['databarWork: Modal Links - Desktop'] = time() - render_times['databarWork: Modal Links - Desktop']
$ star_ratings_stats = macros.StarRatingsStats(work, mobile=True) $:star_ratings_stats

$ render_times['databarWork: Modal Links - Mobile'] = time() $:render_template("type/edition/modal_links", work, edition, share_url, mobile=True) $ render_times['databarWork: Modal Links - Mobile'] = time() - render_times['databarWork: Modal Links - Mobile']
$if editions_page: $ render_times['databarWork: Book provider'] = time() $ book_provider = get_book_provider(page) $ availability = (page.availability or {}) if hasattr(page, 'availability') else {} $if book_provider and ((availability.get('is_readable') or availability.get('status') == 'open') or book_provider.get_access(page).to_solr_str() == "public"): $:book_provider.render_download_options(page) $ render_times['databarWork: Book provider'] = time() - render_times['databarWork: Book provider']
$:worldcat_links

$_('Buy this book')

$:affiliate_links