$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 object:
$if page.description:
About the Book
$:format(page.description)
$if page.first_sentence:
First Sentence
$page.first_sentence
$if contributors:
$if subjects:
$if page.notes:
$if ednotes:
$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]
$_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):
$toc['label'] |
$toc['title'] |
|
$toc['pagenum'] |
$ first = ""
$else:
No table of contents available. Add it!
$: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: