$def with (work, book) $ edition_config = get_edition_config() $ is_privileged_user = ctx.user and (ctx.user.is_admin() or ctx.user.is_librarian()) $def radiobuttons(name, options, value): $for v in options: $ id = name + '--' + v.replace(' ', '-') $ checked = cond(v == value, 'checked="checked"', '')    $jsdef render_language_autocomplete_item(item):
$item.name
$# Render the ith language input field $jsdef render_language_field(i, language):

Add another language?
$# Render the ith translated_from language input field $jsdef render_translated_from_language_field(i, language):
$# Limit to only 1 $#
Add another language?
$# Render the ith work input field $jsdef render_work_field(i, work):
$# Limit to only 1 $#
$jsdef render_work_autocomplete_item(item): $if item.key == "__new__":
$_('-- Move to a new work')
$else:
$if item.cover_i: Cover of $item.title
$item.key.split('/')[2] $item.full_title $if item.first_publish_year: ($item.first_publish_year) $if item.author_name: by ${', '.join(item.author_name)} • $if item.edition_count == 1: $item.edition_count edition $else: $item.edition_count editions
$_("This Edition")
$_("Enter the title of this specific edition.")
$_("Usually distinguished by different or smaller type.") $_("For example:") envisioning the next 50 years
$_("Publishing Info")
$_("For example"): Oxford University Press; Penguin; W.W. Norton
$_("City, Country please.") $_("For example:") New York, USA; Sydney, Australia
$_("You should be able to find this in the first few pages of the book.")
$_("The year following the copyright statement.")
$_("For example:") Centennial edition; First edition
$_("The name of the publisher's series.") $_("For example:") The Story of Civilization, Part III
$:render_template("covers/book_cover", book) $:render_template("covers/change", book)
$_("Contributors")
$ work = book.works[0] $for i, a in enumerate(work.get_authors()): $for i, c in enumerate(book.contributors):
Author $a.name
$c.role $c.name [x]
$_("For example:") edited by David Anderson
Languages
$if book.languages: $for i, lang in enumerate(book.languages): $:render_language_field(i, lang) $else: $:render_language_field(0, storage(name="", key=""))
$ translation = book.translation_of or book.translated_from $ checked_yes = cond(translation, 'checked="checked"', '') $ checked_no = cond(not translation, 'checked="checked"', '') $if translation: $ style_hidden = "" $else: $ style_hidden = "display: none;"

$_("What's the original book?")
$if book.translated_from: $for i, lang in enumerate(book.translated_from): $:render_translated_from_language_field(i, lang) $else: $:render_translated_from_language_field(0, storage(name="", key=""))
$_("Only if it's different from the work's description")
$:_('Use a "*" for an indent, a "|" to add a column, and line breaks for new lines. Like this:')

 * Part 1 | THIS WORLD | 1
        ** Chapter 1 | Of the Nature of Flatland | 3
        ** Chapter 2 | Of the Climate and Houses in Flatland | 5
        * Part 2 | OTHER WORLDS | 42

$_("Anything about the book that may be of interest.") $_("For example:") A Plume Book.
$_("Use this field if the title is different on the cover or spine. If the edition is a collection or anthology, you may also add the individual titles of each work here.")
$_("For example:") Eaters of the Dead $_("is an alternate title for") The 13th Warrior.
$if book.other_titles and len(book.other_titles) > 1: $for i, t in enumerate(book.other_titles): $if i > 0:
$_("Sometimes editions can be associated with the wrong work. You can correct that here.") $_("You can search by title or by Open Library ID (like") OL262757W).
$_("WARNING: Any edits made to the work from this page will be ignored.")
$if book.works: $for i, work in enumerate(book.works): $:render_work_field(i, work) $else: $:render_work_field(0, storage(title="", key=""))
$_("ID Numbers")
$_("Like, ISBN?")
$for i, id in enumerate(book.get_identifiers().values()): $# Disable removing ocaid for regular users. $ admin_user = ctx.user and (ctx.user.is_admin() or ctx.user.is_librarian()) $if id.name == "ocaid" and not admin_user: $else:
Open Library $book.key.split("/")[-1]
$id_labels.get(id.name, id.name) $id.value [x]
$_("Classifications")
$_("Like, Dewey Decimal?")
$for i, id in enumerate(book.get_classifications().values()):
$ classification_labels = dict((d.name, d.label) for d in edition_config.classifications)
$classification_labels.get(id.name, id.name) $id.value [x]
$_("The Physical Object")
$_("Paperback; Hardcover, etc.")
$_("Note the highest number in each pagination pattern.") $_("Help")
$_("For example:") xii, 346p.
$ weight = book.get_weight() or storage(value="", units="grams") $:radiobuttons("edition--weight--units", ["grams", "kilos", "ounces", "pounds"], weight.units)
$_("Dimensions") $ dimensions = book.get_physical_dimensions() or storage(height="", width="", depth="", units="inches") $:radiobuttons("edition--physical_dimensions--units", ["centimeters", "inches"], dimensions.units)
dimensions
$if ctx.user and ctx.user.is_admin():
$_("Admin Only")
This field can accept arbitrary key:value pairs
$if ctx.user: