$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 $ url_map = { 'person': 'person:', 'place': 'place:', 'time': 'time:' }

$_("Search Subjects")

$:macros.SearchNavigation()
$:render_template("search/searchbox", q=q)
$if q: $ response = get_results(q, offset=offset, limit=results_per_page) $if not response.error: $if response.num_found:

$ungettext('%(count)s hit', '%(count)s hits', response.num_found, count=commify(response.num_found))

$else:
$:_('No subjects directly matched your search')

$:macros.LoadingIndicator(_("Checking Search Inside matches"))
$if q and response.error: $for line in response.error.splitlines(): $line $if not loop.last:
$if q and not response.error: $:macros.Pager(page, response.num_found, results_per_page)