$def with (page) $if ctx.user and ("merge-authors" in ctx.features or ctx.user.is_admin()) and query_param('merge', 'false') == 'true': $# 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.works: $ book_titles_excerpt = [work.title for work in books.works[:8]] $ book_list_excerpt = ', '.join(book_titles_excerpt) $ 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)
$:macros.databarView(page)

$title

$if page.birth_date or page.death_date: $page.birth_date - $page.death_date $else: $if page.date: $page.date

$if ctx.user and ("merge-authors" in ctx.features or ctx.user.is_admin()) and query_param('merge', 'false') == 'true':
$:format(page.get('bio', ''))
$if page.website:
$_("Website")
$page.website
$if page.location:

$ungettext("1 work", "%(count)d works", books.num_found, count=books.num_found) $_('Add another?')

$if books.num_found > 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.num_found)
    $for doc in books.works: $:macros.SearchResultsWork(doc)
$:macros.Pager(page=safeint(query_param('page'), default=1), num_found=books.num_found)
$:render_template("covers/author_photo", page) $:render_template("covers/change", page, ".bookCover img")
$def render_subjects(label, subjects, prefix): $if subjects:
$label
$for subject, count in subjects: $subject$cond(not loop.last, ",", "")
$if books.num_found > 0: $:render_subjects(_("Subjects"), books.get_facet('subject_facet'), '') $:render_subjects(_("Places"), books.get_facet('place_facet'), 'place:') $:render_subjects(_("People"), books.get_facet('person_facet'), 'person:') $:render_subjects(_("Time"), books.get_facet('time_facet'), 'time:') $if "lists" in ctx.features:
$:render_template("lists/widget", page, include_rating=False)

$:_('Links (outside Open Library)')

$if page.links or page.remote_ids or (page.wikipedia and page.wikipedia.startswith("http")): $else:

$_('No links yet.') $_('Add one')?

$if page.alternate_names: $if page.alternate_names != [""]:

$_("Alternative names")

$:render_template("lib/history", page)