$if work:
$ share_url = request.home + (edition or work).key $ component_times['databarWork: Modal Links'] = time() $ modal_links = render_template("type/edition/modal_links", work, edition, share_url) $ component_times['databarWork: Modal Links'] = time() - component_times['databarWork: Modal Links'] $:macros.databarWork(edition or work, editions_page=True, render_times=component_times,summary=render_summary, modal_links=modal_links)
$ component_times['EditTopbar'] = time() $:macros.databarView(page, edition) $ component_times['EditTopbar'] = time() - component_times['EditTopbar']
$:render_summary $if page.type.key in ["/type/work", "/type/edition", "/type/author"]: $if edition and page.type.key in ["/type/work"]: $ edit_url = edition.url(suffix="/edit") $else: $ edit_url = page.url(suffix="/edit") $else: $ edit_url = page.key + "?m=edit"
$:render_template("type/edition/compact_title", book_title, edit_url) $:macros.EditionNavBar(work.edition_count, show_observations)
$if edition:
$if edition.publish_date:
$_("Publish Date")
$if edition.publishers:
$_("Publisher")
$for p in edition.publishers: $if "publishers" in ctx.features: $p$cond(loop.last, "", ", ") $else: $p$cond(loop.last, "", ", ")
$if edition.languages:
$_("Language")
$:thingrepr(edition.languages)
$if edition.number_of_pages:
$_("Pages")
$edition.number_of_pages
$if is_librarian: $if ocaid:
Internet Archive
$ocaid
$ edition_identifiers = edition.get_identifiers() $ isbns = [] $for name, values in edition_identifiers.multi_items(): $if name in ["isbn_10", "isbn_13"]: $for value in values: $isbns.append(value['value']) $if isbns:
ISBNs
$for isbn in isbns: $isbn
$ seen = set() $if previews and any([len(e.languages) for e in previews]):

Previews available in: $for e in previews: $if e.languages[0].name not in seen: $ seen.add(e.languages[0].name) $get_language_name(e.languages[0].key)

$if work and work.description or edition and edition.description: $if edition and edition.description: $ overview_desc = edition.description $else: $ overview_desc = work.description
$:sanitize(format(overview_desc))
$:macros.ReadMore("book-description")
$elif edition:

$:_("This edition doesn't have a description yet. Can you add one?", url=edition.url('/edit')+"#about/about")

$ component_times['SubjectsTags'] = time() $:macros.SubjectTags(work, ["Subjects", "People", "Places", "Times"]) $ component_times['SubjectsTags'] = time() - component_times['SubjectsTags']
$ component_times['EditionsTable'] = time() $:render_template("type/work/editions_datatable", work, editions=editions, edition=edition, editions_limit=editions_limit) $ component_times['EditionsTable'] = time() - component_times['EditionsTable']
$if edition:

$_("Book Details")


$if edition.publish_places:

$_('Published in')

$for p in edition.publish_places: $(p)$cond(loop.last, "", ", ")

$if edition.first_sentence:

$_("First Sentence")

"$(edition.first_sentence)"

$ component_times['TableOfContents'] = time() $:macros.TableOfContents(edition, ocaid) $ component_times['TableOfContents'] = time() - component_times['TableOfContents'] $if edition.notes or edition.series or edition.volume or edition.genres or edition.other_titles or edition.copyright_date or edition.translation_of or edition.translated_from:

$_("Edition Notes")

$if edition.notes: $:format(edition.notes)
$:display_value(_("Series"), edition.series) $:display_value(_("Volume"), edition.volume) $:display_value(_("Genre"), edition.genres) $:display_value(_("Other Titles"), edition.other_titles) $:display_value(_("Copyright Date"), edition.copyright_date) $:display_value(_("Translation Of"), edition.translation_of) $:display_value(_("Translated From"), edition.translated_from)
$ classifications = edition.get_classifications().multi_items() $if classifications:

$_("Classifications")

$for name, values in classifications: $:display_identifiers(values[0].label, values)
$ links = page.get_links() $if links: $ contributors = edition.get('contributors', []) $if contributors:

$_("Contributors")

$for c in contributors: $:display_value(c.role, c.name)
$if has_any("physical_format", "pagination", "physical_dimensions", "weight"):

$_("The Physical Object")

$:display_value(_("Format"), edition.physical_format) $:display_value(_("Pagination"), edition.pagination) $:display_value(_("Number of pages"), edition.number_of_pages, itemprop="numberOfPages") $:display_value(_("Dimensions"), edition.physical_dimensions) $:display_value(_("Weight"), edition.weight)

$_("ID Numbers")

$:display_identifiers("Open Library", [storage(url=None, value=edition.key.split("/")[-1])]) $ no_index = edition.get_ia_meta_fields().get('noindex', False) $for name, values in edition.get_identifiers().multi_items(): $ identifier_label = values[0].label $if not (edition.is_in_private_collection() and identifier_label == 'Internet Archive'): $if is_privileged_user or not (no_index and identifier_label == 'Internet Archive'): $:display_identifiers(identifier_label, values, itemprop=cond(name in ["isbn_10", "isbn_13"], "isbn", None)) $:display_goodreads("Open Library", [storage(url=None, value=edition.key.split("/")[-1])]) $for name, values in edition.get_identifiers().multi_items(): $:display_goodreads(values[0].label, values)
$if work: $if not work.excerpts and work.first_sentence:

$_("First Sentence")

"$work.first_sentence"

$if work.description and work.description != overview_desc:

$_("Work Description")

$:sanitize(format(work.description))
$:macros.ReadMore('work-description')
$if work.original_languages:
$_("Original languages")
$', '.join(lang.name for lang in work.original_languages)

$if work.excerpts:

$_("Excerpts")

$for excerpt in work.excerpts:
$for line in excerpt.excerpt.split('\n'): $line
$if excerpt.pages: $_("Page %(page)s", page=excerpt.pages), $if excerpt.author: $def excerpt_author_link(): $excerpt.author.displayname $:_("added by %(authorlink)s.", authorlink=str(excerpt_author_link()).strip()) $else: $_("added anonymously.") $if excerpt.comment: "$excerpt.comment"
$if work.links or (work.wikipedia and work.wikipedia.startswith("http")):

$:_('Links outside Open Library')

$if show_observations: $ component_times['get_observation_metrics'] = time() $ reader_observations = get_observation_metrics(work['key']) $ component_times['get_observation_metrics'] = time() - component_times['get_observation_metrics'] $ component_times['Review component'] = time() $:render_template("observations/review_component", work, reader_observations, page.key) $ component_times['Review component'] = time() - component_times['Review component']
$# pages like /books/ia:foo00bar are fake records created from metadata API. $# Adding them to lists doesn't work. Disabling it to avoid any issues. $if "lists" in ctx.features and not page.is_fake_record():

$_('Lists containing this Book')

$if work: $ component_times['lists widget: WorkListTime'] = time() $:render_template("lists/widget", work, include_header=False, include_widget=False) $ component_times['lists widget: WorkListTime'] = time() - component_times['lists widget: WorkListTime'] $if edition and is_editionless_work: $ component_times['lists widget: EditionListTime'] = time() $:render_template("lists/widget", edition, include_header=False, include_widget=False) $ component_times['lists widget: EditionListTime'] = time() - component_times['lists widget: EditionListTime']
$ component_times['RelatedWorksCarousel'] = time()
$ component_times['RelatedWorksCarousel'] = time() -component_times['RelatedWorksCarousel'] $ component_times['HistoryTable'] = time() $:render_template("lib/history", page) $ component_times['HistoryTable'] = time() - component_times['HistoryTable'] $ component_times['TotalTime'] = time() - component_times['TotalTime'] $if query_param('debug'): $:macros.Profile(component_times)