$def with (page)
$# Most authors are people, so only use org in the exceptional case that
$# the record explicitly is labelled as such.
$if page.entity_type == 'org':
$ entityTypeSchema = "https://schema.org/Organization"
$else:
$ entityTypeSchema = "https://schema.org/Person"
$ bodyattrs = ctx.setdefault('bodyattrs', [])
$ bodyattrs.append('itemscope')
$ bodyattrs.append('itemtype="%s"' % entityTypeSchema)
$ title = page.get('name', _('name missing'))
$ title_with_site = _("%(page_title)s | Open Library", page_title=title)
$ meta_photo_url = item_image(page.get_photo_url("L"), "https://openlibrary.org/images/icons/avatar_author-lg.png")
$var title: $title
$var history: $page.history
$ olid = page.key.split('/')[-1]
$ books = page.get_books(q=query_param('q'))
$ book_list_excerpt = ''
$if books and books.docs:
$ book_titles_excerpt = [work.title for work in books.docs[:8]]
$ book_list_excerpt = ', '.join(book_titles_excerpt)
$ books_count = books.num_found or 0
$ description = _("Author of %(book_titles)s", book_titles=book_list_excerpt)
$putctx("description", description)
$add_metatag(property="og:title", content=title_with_site)
$add_metatag(property="og:type", content="books.author")
$add_metatag(property="og:image", content=meta_photo_url)
$add_metatag(property="og:url", content=request.canonical_url)
$add_metatag(property="og:site_name", content="Open Library")
$add_metatag(property="og:description", content=description)
$set_share_links(url=request.canonical_url, title=title, view_context=ctx)
$ show_librarian_extras = ctx.user and (ctx.user.is_admin() or ctx.user.is_librarian())
$if ctx.user and ("merge-authors" in ctx.features or ctx.user.is_admin()) and query_param('merge', 'false') == 'true':
$ mrid = query_param('mrid', None)
$ comment = query_param('comment', None)
$ duplicate_olids = query_param('duplicates', '').split(',')
$ duplicates = ["/authors/" + k for k in duplicate_olids]
$ data = {'master': page.key, 'duplicates': duplicates}
$if mrid:
$ data['mrid'] = mrid
$if comment:
$ data['comment'] = comment
$ olids = '%s,%s' % (page.key.split('/')[-1], query_param('duplicates', ''))
$ data['olids'] = olids
$_('Merging Authors...')

$_('Duplicates')
$for key in duplicates:
$ doc = get_document(key)
$if doc:
- $doc.name; ($key)
$_('Refresh the page?')
$_('Success!')
$:_('OK. The merge is in motion. It will take a few minutes to finish the update.')
$_('Argh!')
$_("That merge didn't work. It's our fault, and we've made a note of it.")
$:format(page.get('bio', ''))
$if page.location:
$_("Location")
$page.location
$:render_template("authors/infobox", page, imagesId="mobile")
$ungettext("%(count)d work", "%(count)d works", books_count, count=books_count)
$_('Add another?')
$if books_count > 1:
$:render_template("search/sort_options.html", books.sort, exclude='relevance', default_sort='editions')
$if input(mode="everything").mode == "everything":
$:_('Showing all works by author. Would you like to see only ebooks?', url=changequery(mode='ebooks'))
$else:
$:_('Showing ebooks only. Would you like to see everything by this author?', url=changequery(mode='everything'))
$:macros.Pager(page=safeint(query_param('page'), default=1), num_found=books_count)
$for doc in books.docs:
$:macros.SearchResultsWork(doc, show_librarian_extras=show_librarian_extras, include_dropper=True)
$:macros.Pager(page=safeint(query_param('page'), default=1), num_found=books_count)
$:render_template("authors/infobox", page, imagesId="desktop")
$def render_subjects(label, subjects, prefix):
$if subjects:
$if books_count > 0:
$:render_subjects(_("Subjects"), books.facet_counts.get('subject_facet'), '')
$:render_subjects(_("Places"), books.facet_counts.get('place_facet'), 'place:')
$:render_subjects(_("People"), books.facet_counts.get('person_facet'), 'person:')
$:render_subjects(_("Time"), books.facet_counts.get('time_facet'), 'time:')
$if "lists" in ctx.features:
$:render_template("lists/widget", page, include_rating=False, async_load=True, show_active_lists=True, include_showcase=False)
$_('ID Numbers')
- $_('OLID'): $olid
$if page.remote_ids:
$ configured_ids = get_author_config()['identifiers']
$for id in configured_ids:
$if id.name in page.remote_ids:
$ href = id.url.replace('@@@', page.remote_ids[id.name])
- $id.label: $page.remote_ids[id.name]
$if id.name == 'wikidata' and 'inventaire' not in page.remote_ids:
- $_("Inventaire.io:") wd:$page.remote_ids[id.name]
$:_('Links outside Open Library')
$if page.links or (page.wikipedia and page.wikipedia.startswith("http")):
$else:
$_('No links yet.') $_('Add one')?
$if page.alternate_names:
$if page.alternate_names != [""]:
$_("Alternative names")
$for alternate_name in page.alternate_names:
- $alternate_name
$:render_template("lib/history", page)