$def with (page, work, edition, ocaid, work_title, star_ratings_stats, for_desktop=False) $def icon_link(link_class, img_src, link_text, login_redirect=True, ga_data=None): $ href = 'javascript:;' $ ga_attr = 'data-ol-link-track=%s' % ga_data if ga_data else '' $ page_url = page.url() $ view_type = 'desktop' if for_desktop else 'mobile'
$_("An edition of") $work_title$cond(work.subtitle, ': %s' % work.subtitle) $if work.first_publish_year: ($work.first_publish_year)
$ book_title = edition.get('title', '') or (work.title if work else '')

$book_title

$if edition: $if edition.subtitle:

$edition.subtitle

$if edition.edition_name:
$edition.edition_name
$ authors = (work or edition).get_authors() $ author_names = (work or edition).author_names $if authors: $elif author_names: $:star_ratings_stats
$if not for_desktop: $# On mobile, the 'Share' button appears next to the title and author $ share_content = icon_link("share-modal-link", "/static/images/icons/share.svg", _("Share"), login_redirect=False, ga_data="ModalLinkClick|ShareIcon") $ share_links = ctx.get('share_links') $:macros.ShareModal(share_links, page_url, share_content)