searxng-beetroot/beetroot_template/results.html
2024-03-06 00:19:57 +01:00

8.4 KiB

{% extends "beetroot/base.html" %} {% from 'beetroot/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 'beetroot/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() -%}
{{ answer.answer }} {% if answer.url -%} {{ urlparse(answer.url).hostname }} {% endif -%}
{%- endfor -%}
{%- endif %}
{%- if number_of_results != '0' -%}

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

{%- endif -%} {%- if infoboxes -%}
{{ _('Info') }} {%- for infobox in infoboxes -%} {%- include 'beetroot/elements/infobox.html' -%} {%- endfor -%}
{%- endif -%} {%- if suggestions -%} {%- include 'beetroot/elements/suggestions.html' -%} {%- endif -%} {%- if method == 'POST' -%} {%- include 'beetroot/elements/search_url.html' -%} {%- endif -%} {%- if unresponsive_engines -%} {%- include 'beetroot/elements/engines_msg.html' -%} {%- endif -%} {%- if search_formats -%} {%- include 'beetroot/elements/apis.html' -%} {%- 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('beetroot', result['template']) %} {% if result.close_group and not only_template %}
{% endif %} {% endfor %} {% if not results and not answers %} {% include 'beetroot/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 %} {%- if results | count > 0 -%}
{% for category in selected_categories %} {% endfor %} {% if timeout_limit %}{% endif %} {{- engine_data_form(engine_data) -}}
{%- endif -%} {% 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 %}