searxng-beetroot/beetroot_template/results.html
2023-03-19 10:58:17 +01:00

11 KiB

{% extends "simple/base.html" %} {% from 'simple/icons.html' import icon, icon_big, icon_small %} {% macro engine_data_form(engine_data) -%} {% for engine_name, kv_data in engine_data.items() %} {% for k, v in kv_data.items() %} {% endfor %} {% endfor %} {%- endmacro %} {% block title %}{% if query_in_title %}{{- q|e }} - {% endif %}{% endblock %} {% block meta %}{% endblock %} {% block content %} {% include 'simple/search.html' %} {% if results and results|map(attribute='template')|unique|list|count == 1 %} {% set only_template = 'only_template_' + results[0]['template']|default('default')|replace('.html', '') %} {% else %} {% set only_template = '' %} {% endif %}
{% if answers -%}

{{ _('Answers') }} :

{%- for answer in answers.values() -%}
{% if answer.url %} {{ answer.answer }} {% else %} {{ answer.answer }} {% endif %}
{%- endfor -%}
{%- endif %}
{% if number_of_results != '0' -%}

{{ _('Number of results') }}: {{ number_of_results }}

{%- endif %} {% if unresponsive_engines and results|length >= 1 %}
{{ icon_big('warning') }}

{{ _('Error!') }} {{ _('Engines cannot retrieve results') }}:

{%- for engine_name, error_type in unresponsive_engines -%}

{{- engine_name }} ( {{- error_type -}} ){{- '' -}}

{% endfor %}
{% endif %} {% if infoboxes %}
{% for infobox in infoboxes -%} {% include 'simple/infobox.html' %} {%- endfor %}
{% endif %} {% if suggestions %}

{{ _('Suggestions') }}:

{% for suggestion in suggestions %} {% for category in selected_categories %} {% endfor %} {% if timeout_limit %}{% endif %} {% endfor %}
{% endif %} {% if method == 'POST' %}

{{ _('Search URL') }} :

{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&language={{ current_language }}&time_range={{ time_range }}&safesearch={{ safesearch }}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if timeout_limit %}&timeout_limit={{ timeout_limit|urlencode }}{% endif %}
{% endif %}
{% if search_formats %}

{{ _('Download results') }}

{% for output_type in search_formats %}
{% for category in selected_categories %} {% endfor %} {% if timeout_limit %}{% endif %}
{% endfor %} {% endif %}
{% if corrections %}

{{ _('Try searching for:') }}

{% for correction in corrections %}
{% for category in selected_categories %} {% endfor %} {% if timeout_limit %}{% endif %}
{% endfor %}
{% endif %}
{% for result in results %} {% if result.open_group and not only_template %}
{% endif %} {% set index = loop.index %} {% include get_result_template('simple', result['template']) %} {% if result.close_group and not only_template %}
{% endif %} {% endfor %} {% if not results and not answers %} {% include 'simple/messages/no_results.html' %} {% endif %}
{% if paging %} {% if pageno > 1 %}
{% for category in selected_categories %} {% endfor %} {% if timeout_limit %}{% endif %} {{- engine_data_form(engine_data) -}}
{% endif %}
{% for category in selected_categories %} {% endfor %} {% if timeout_limit %}{% endif %} {{- engine_data_form(engine_data) -}}
{% set pstart = 1 %} {% set pend = 11 %} {% if pageno > 5 %} {% set pstart = pageno - 4 %} {% set pend = pageno + 6 %} {% endif %}
{% for x in range(pstart, pend) %} {% for category in selected_categories %} {% endfor %} {% if timeout_limit %}{% endif %} {{- engine_data_form(engine_data) -}} {% if pageno == x %} {% else %} {% endif %} {% endfor %}
{% endif %}
{% endblock %}