$def with (page) $ lang = i18n.get_locale() or 'en' $ _t = i18n.get_namespace('/type/edition') $ _ = i18n.get_namespace('/mode/view') $ title = page.title_prefix + ' ' + page.title $var title: $title $ lccn = page["lccn"] and page["lccn"][0] and ("https://lccn.loc.gov/" + page["lccn"][0]) $ oclc = page["oclc_numbers"] and page["oclc_numbers"][0] and ("https://www.worldcat.org/oclc/" + page["oclc_numbers"][0] + "?tab=details") $ key = page.key $ detailbook = "//archive.org/details/XXX" $ ids = ["isbn_10", "isbn_13", "lccn", "dewey_decimal_class", "lc_classifications", "oclc_numbers"] $ object = ["physical_format", "pagination", "physical_dimensions","weight"] $ contributors = ["contributions"] $ subjects = ["subjects"] $ ednotes = ["edition_name", "translated_from", "series", "volume", "genres", "other_titles", "by_statement", "copyright_date", "source_records", "languages"] $ web = ["download_url", "purchase_url"]
$:macros.databarView(page)
$if page.works: $:thingrepr(page.works) $if page.authors: by $:thingrepr(page.authors) $else: by unknown author $# if page.books: / # editions /

$ pub_and_date = '' $if page.get('publishers'): $ pub_and_date = '' + thingrepr(page.publishers) + '' $else: $ pub_and_date = 'Publisher unknown' $if page.get('publish_date'): $ pub_and_date += ', ' + page.publish_date $:pub_and_date

$:macros.CoverImage(page)
$if ids:
$if key: $if page.get('ocaid'): $for name in ids: $if page[name]: $if name == "lccn": $if lccn: $elif name == "oclc_numbers": $if oclc: $else:
ID Numbers
Open Library $key[key.rfind('/')+1:]
Internet Archive $page.ocaid
$_t[name]$:thingrepr(page[name])
$:thingrepr(page[name])
$:thingrepr(page[name])
$if object:
$for name in object: $if page[name]:
The Physical Object
$_t[name] $:thingrepr(page[name])
$if page.description:

About the Book

$:format(page.description) $if page.first_sentence:

First Sentence

$page.first_sentence

$if contributors:

Contributors

$for name in page.contributions: $if page[name]: $:thingrepr(page[name])
$if subjects:

Subjects

$for name in subjects: $for subject in page[name]: $:utf8(thingrepr(subject)).replace(' -- ', '/'),
$if page.notes:

Edition Notes

$page.notes
$if ednotes:
$for name in ednotes: $if page[name]: $if name == 'source_records': $for src in page[name]: $if src.startswith('marc:'): $elif src.startswith('amazon:'): $elif src.startswith('ia:'): $else: $else:
$_t[name]Library MARC record
Amazon.com
Internet Archive
$:thingrepr(src)
$:thingrepr(page[name])
$if page.uris:

External Links

$for num in range(len(page['uris'])): $if num < len(page['uri_descriptions']): $ desc = page.uri_descriptions[num] $else: $ desc = page.uris[num]
$desc $page.uris[num]
$:macros.databarWork(page)
More Editions
## total
More by (Author)
## books

$_t.table_of_contents $:macros.FlourishButton("edit", changequery(m='edit'))

$if page.table_of_contents: $ first = "first" $ table_of_contents = page.table_of_contents $if isinstance(table_of_contents[0], unicode): $ table_of_contents = [{'class': 'section', 'label': '', 'title': x, 'pagenum': ''} for x in table_of_contents] $for i, toc in enumerate(table_of_contents): $ first = ""
$toc['label']   $toc['title']
$else:

No table of contents available. Add it!

History  Read all

$:render_template("lib/history", page)
$:render_template("lib/change_cover", page)
$ keys = [] $for isbn in page.get('isbn_10', []) + page.get("isbn_13", []): $ keys.append("ISBN:" + isbn) $for lccn in page.get('lccn', []): $ keys.append("LCCN:" + lccn) $for oclc in page.get('oclc', []): $ keys.append("OCLC:" + oclc) $if keys: