{% import "search_macros.html" as search_macros %} {% extends "base.html" %} {% macro format_query_time(query_time_ms) -%} {% if query_time_ms >= 10000 %} {{ "{:0.3}".format(hits.query_time_ms/1000.0) }} {% else %} {{ "{:0.2}".format(hits.query_time_ms/1000.0) }} {% endif %} {%- endmacro %} {% block extra_head %} {# among other things, this prevents query parameters from ending up in goatcounter #} {% endblock %} {% block title %} {% if query and query.q %}{{ query.q }} - {% endif %}{{ super() }} {% endblock %} {% block fullmain %} {{ search_macros.query_hidden(query.time_options, query.filter_time) }} {{ search_macros.query_hidden(query.type_options, query.filter_type) }} {{ search_macros.query_hidden(query.availability_options, query.filter_availability) }} {{ search_macros.query_hidden(query.sort_options, query.sort_order) }} {% if query.debug %} {% endif %}
{{ "Filters" }}
{{ search_macros.query_option(query.time_options, query.filter_time) }} {{ search_macros.query_option(query.type_options, query.filter_type) }} {{ search_macros.query_option(query.availability_options, query.filter_availability) }} {{ search_macros.query_option(query.sort_options, query.sort_order) }} {{ search_macros.clear_query(query) }}
{% if hits %} {{ babel_numbers.format_decimal(hits.count_found, locale=locale) }} Hit Hits {% else %}   {% endif %}
{% if search_error %}

Computer said: {{ search_error.message }}

{% elif hits and hits.results %} {% if hits.results %} {% if hits.offset != 0 %}
{{ search_macros.search_pagination(hits, locale=locale) }}
{% endif %} {# search results (rendered via macro) #} {% set expand_result = hits.query_type == 'lookup' %} {% for paper in hits.results %} {{ search_macros.fulltext_search_result_row(paper, locale=locale, debug_mode=query.debug, expand=expand_result) }} {% endfor %} {% if hits.count_found > hits.limit %}
{{ search_macros.search_pagination(hits, locale=locale) }}
{% endif %} {% endif %} {% elif hits %}
{% if query.filter_type != "everything" %} {% endif %} {% if query.filter_time and query.filter_time != "all_time" %} {% endif %} {% if query.filter_availability != "everything" %} {% endif %} {{ "Start Over" }}
{% else %}
{% endif %}
{% endblock %}