$def with (get_results) $ q = query_param('q', '').strip() $ results_per_page = 100 $ page = query_param('page') $if page: $ page = int(page) $else: $ page = 1 $ offset = (page - 1) * results_per_page $var title: $_('Search Open Library for "%(query)s"', query=q) $ sort = query_param('sort', None)

$_("Search Authors")

$:macros.SearchNavigation()
$:render_template("search/searchbox", q=q)
$ results = get_results(q, offset=offset, limit=results_per_page, sort=sort) $if q and results.error: $for line in results.error.splitlines(): $line $if not loop.last:
$if q and not results.error: $if results.num_found:
$ungettext('%(count)s hit', '%(count)s hits', results.num_found, count=commify(results.num_found)) $if results.num_found > 1: $:render_template("search/sort_options.html", selected_sort=sort, search_scheme="authors") $ user_can_merge = ctx.user and ("merge-authors" in ctx.features or ctx.user.is_admin()) $if results.num_found >= 2 and user_can_merge: $ keys = '&'.join('key=%s' % doc['key'].split("/")[-1] for doc in results.docs)
$_('Is the same author listed twice?') $_('Merge authors')
$else:
$:_('No authors directly matched your search')

$:macros.LoadingIndicator(_("Checking Search Inside matches"))
$:macros.Pager(page, results.num_found, results_per_page)