2017-02-12 15:06:01 +01:00
|
|
|
{% extends "simple/base.html" %}
|
2021-11-13 10:42:07 +01:00
|
|
|
{% from 'simple/icons.html' import icon, icon_big, icon_small %}
|
2021-03-02 14:24:55 +01:00
|
|
|
{% macro engine_data_form(engine_data) -%}
|
|
|
|
{% for engine_name, kv_data in engine_data.items() %}
|
|
|
|
{% for k, v in kv_data.items() %}
|
|
|
|
<input type="hidden" name="engine_data-{{ engine_name }}-{{ k|e }}" value="{{ v|e }}" />
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
{%- endmacro %}
|
2021-11-29 11:08:21 +01:00
|
|
|
{% block title %}{% if query_in_title %}{{- q|e }} - {% endif %}{% endblock %}
|
2019-07-30 06:25:05 +02:00
|
|
|
{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&categories={{ selected_categories|join(",") | replace(' ','+') }}&pageno={{ pageno }}&time_range={{ time_range }}&language={{ current_language }}&safesearch={{ safesearch }}&format=rss">{% endblock %}
|
2017-02-12 15:06:01 +01:00
|
|
|
{% block content %}
|
|
|
|
{% include 'simple/search.html' %}
|
2018-08-09 16:13:50 +02:00
|
|
|
|
|
|
|
{% if results and results|map(attribute='template')|unique|list|count == 1 %}
|
|
|
|
{% set only_template = 'only_template_' + results[0]['template']|default('default')|replace('.html', '') %}
|
|
|
|
{% else %}
|
2022-02-21 22:18:48 +01:00
|
|
|
{% set only_template = '' %}
|
2018-08-09 16:13:50 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div id="results" class="{{ only_template }}">
|
|
|
|
{% if answers -%}
|
2022-02-05 08:56:42 +01:00
|
|
|
<div id="answers" role="complementary" aria-labelledby="answers-title"><h4 class="title" id="answers-title">{{ _('Answers') }} : </h4>
|
2020-06-09 17:01:59 +02:00
|
|
|
{%- for answer in answers.values() -%}
|
|
|
|
<div class="answer">
|
|
|
|
{% if answer.url %}
|
|
|
|
<a href="{{ answer.url }}">{{ answer.answer }}</a>
|
|
|
|
{% else %}
|
|
|
|
<span>{{ answer.answer }}</span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2018-08-09 16:13:50 +02:00
|
|
|
{%- endfor -%}
|
2017-02-12 15:06:01 +01:00
|
|
|
</div>
|
2018-08-09 16:13:50 +02:00
|
|
|
{%- endif %}
|
2017-02-12 15:06:01 +01:00
|
|
|
|
|
|
|
<div id="sidebar">
|
|
|
|
|
2023-04-23 13:19:21 +02:00
|
|
|
{%- if number_of_results != '0' -%}
|
2017-02-12 15:06:01 +01:00
|
|
|
<p id="result_count"><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p>
|
2023-04-23 13:19:21 +02:00
|
|
|
{%- endif -%}
|
2017-02-12 15:06:01 +01:00
|
|
|
|
2023-04-23 13:19:21 +02:00
|
|
|
{%- if infoboxes -%}
|
|
|
|
<div id="infoboxes">
|
|
|
|
<details open>
|
|
|
|
<summary class="title">{{ _('Info') }}</summary>
|
|
|
|
{%- for infobox in infoboxes -%}
|
|
|
|
{%- include 'simple/elements/infobox.html' -%}
|
|
|
|
{%- endfor -%}
|
|
|
|
</details>
|
|
|
|
</div>
|
|
|
|
{%- endif -%}
|
2017-02-12 15:06:01 +01:00
|
|
|
|
2023-04-23 13:19:21 +02:00
|
|
|
{%- if suggestions -%}
|
|
|
|
{%- include 'simple/elements/suggestions.html' -%}
|
|
|
|
{%- endif -%}
|
2017-02-12 15:06:01 +01:00
|
|
|
|
2023-04-23 13:19:21 +02:00
|
|
|
{%- if method == 'POST' -%}
|
|
|
|
{%- include 'simple/elements/search_url.html' -%}
|
|
|
|
{%- endif -%}
|
|
|
|
|
|
|
|
{%- if unresponsive_engines and results|length >= 1 -%}
|
|
|
|
{%- include 'simple/elements/engines_msg.html' -%}
|
|
|
|
{%- endif -%}
|
|
|
|
|
|
|
|
{%- if search_formats -%}
|
|
|
|
{%- include 'simple/elements/apis.html' -%}
|
|
|
|
{%- endif -%}
|
2017-02-12 15:06:01 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if corrections %}
|
2022-02-05 08:56:42 +01:00
|
|
|
<div id="corrections" role="complementary" aria-labelledby="corrections-title">
|
|
|
|
<h4 id="corrections-title">{{ _('Try searching for:') }}</h4>
|
2017-02-12 15:06:01 +01:00
|
|
|
{% for correction in corrections %}
|
|
|
|
<div class="left">
|
2022-03-24 18:18:19 +01:00
|
|
|
<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="navigation">
|
|
|
|
{% for category in selected_categories %}
|
|
|
|
<input type="hidden" name="category_{{ category }}" value="1">
|
|
|
|
{% endfor %}
|
2019-10-23 06:38:21 +02:00
|
|
|
<input type="hidden" name="q" value="{{ correction.url }}">
|
2017-02-12 15:06:01 +01:00
|
|
|
<input type="hidden" name="language" value="{{ current_language }}">
|
2022-03-24 18:18:19 +01:00
|
|
|
<input type="hidden" name="time_range" value="{{ time_range }}">
|
2017-02-12 15:06:01 +01:00
|
|
|
<input type="hidden" name="safesearch" value="{{ safesearch }}">
|
|
|
|
<input type="hidden" name="theme" value="{{ theme }}">
|
2019-08-02 13:50:51 +02:00
|
|
|
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit }}" >{% endif %}
|
2022-02-05 08:56:42 +01:00
|
|
|
<input type="submit" role="link" value="{{ correction.title }}">
|
2022-03-24 18:18:19 +01:00
|
|
|
</form>
|
2017-02-12 15:06:01 +01:00
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2022-02-05 08:56:42 +01:00
|
|
|
<div id="urls" role="main">
|
2017-02-12 15:06:01 +01:00
|
|
|
{% for result in results %}
|
2022-02-21 22:18:48 +01:00
|
|
|
{% if result.open_group and not only_template %}<div class="template_group_{{ result['template']|replace('.html', '') }}">{% endif %}
|
2017-02-12 15:06:01 +01:00
|
|
|
{% set index = loop.index %}
|
2022-02-21 22:18:48 +01:00
|
|
|
{% include get_result_template('simple', result['template']) %}
|
|
|
|
{% if result.close_group and not only_template %}</div>{% endif %}
|
2017-02-12 15:06:01 +01:00
|
|
|
{% endfor %}
|
|
|
|
{% if not results and not answers %}
|
|
|
|
{% include 'simple/messages/no_results.html' %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div id="backToTop">
|
2022-02-05 08:56:42 +01:00
|
|
|
<a href="#" aria-label="{{ _('Back to top') }}">{{ icon_small('chevron-up-outline') }}</a>
|
2017-02-12 15:06:01 +01:00
|
|
|
</div>
|
|
|
|
{% if paging %}
|
2022-02-05 08:56:42 +01:00
|
|
|
<nav id="pagination" role="navigation">
|
2017-02-12 15:06:01 +01:00
|
|
|
{% if pageno > 1 %}
|
2021-08-24 11:31:29 +02:00
|
|
|
<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="previous_page">
|
2017-02-12 15:06:01 +01:00
|
|
|
<div class="{% if rtl %}right{% else %}left{% endif %}">
|
|
|
|
<input type="hidden" name="q" value="{{ q|e }}" >
|
|
|
|
{% for category in selected_categories %}
|
|
|
|
<input type="hidden" name="category_{{ category }}" value="1" >
|
|
|
|
{% endfor %}
|
|
|
|
<input type="hidden" name="pageno" value="{{ pageno-1 }}" >
|
|
|
|
<input type="hidden" name="language" value="{{ current_language }}" >
|
2022-03-24 18:18:19 +01:00
|
|
|
<input type="hidden" name="time_range" value="{{ time_range }}" >
|
2017-02-12 15:06:01 +01:00
|
|
|
<input type="hidden" name="safesearch" value="{{ safesearch }}" >
|
|
|
|
<input type="hidden" name="theme" value="{{ theme }}" >
|
2019-08-02 13:50:51 +02:00
|
|
|
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
|
2022-03-24 18:18:19 +01:00
|
|
|
{{- engine_data_form(engine_data) -}}
|
2022-02-05 08:56:42 +01:00
|
|
|
<button role="link" type="submit">{{ icon_small('chevron-left') }} {{ _('Previous page') }}</button>
|
2017-02-12 15:06:01 +01:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
2021-08-24 11:31:29 +02:00
|
|
|
<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="next_page">
|
2017-02-12 15:06:01 +01:00
|
|
|
<div class="{% if rtl %}left{% else %}right{% endif %}">
|
|
|
|
<input type="hidden" name="q" value="{{ q|e }}" >
|
|
|
|
{% for category in selected_categories %}
|
|
|
|
<input type="hidden" name="category_{{ category }}" value="1" >
|
|
|
|
{% endfor %}
|
|
|
|
<input type="hidden" name="pageno" value="{{ pageno+1 }}" >
|
|
|
|
<input type="hidden" name="language" value="{{ current_language }}" >
|
2022-03-24 18:18:19 +01:00
|
|
|
<input type="hidden" name="time_range" value="{{ time_range }}" >
|
2017-02-12 15:06:01 +01:00
|
|
|
<input type="hidden" name="safesearch" value="{{ safesearch }}" >
|
|
|
|
<input type="hidden" name="theme" value="{{ theme }}" >
|
2019-08-02 13:50:51 +02:00
|
|
|
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
|
2022-03-24 18:18:19 +01:00
|
|
|
{{- engine_data_form(engine_data) -}}
|
2022-02-05 08:56:42 +01:00
|
|
|
<button role="link" type="submit">{{ _('Next page') }} {{ icon_small('chevron-right') }}</button>
|
2017-02-12 15:06:01 +01:00
|
|
|
</div>
|
|
|
|
</form>
|
2023-01-05 03:18:48 +01:00
|
|
|
{% set pstart = 1 %}
|
|
|
|
{% set pend = 11 %}
|
|
|
|
{% if pageno > 5 %}
|
|
|
|
{% set pstart = pageno - 4 %}
|
|
|
|
{% set pend = pageno + 6 %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div class="numbered_pagination">
|
|
|
|
{% for x in range(pstart, pend) %}
|
|
|
|
<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="page_number">
|
|
|
|
<input type="hidden" name="q" value="{{ q|e }}" >
|
|
|
|
{% for category in selected_categories %}
|
|
|
|
<input type="hidden" name="category_{{ category }}" value="1" >
|
|
|
|
{% endfor %}
|
|
|
|
<input type="hidden" name="pageno" value="{{ x }}" >
|
|
|
|
<input type="hidden" name="language" value="{{ current_language }}" >
|
|
|
|
<input type="hidden" name="time_range" value="{{ time_range }}" >
|
|
|
|
<input type="hidden" name="safesearch" value="{{ safesearch }}" >
|
|
|
|
<input type="hidden" name="theme" value="{{ theme }}" >
|
|
|
|
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
|
|
|
|
{{- engine_data_form(engine_data) -}}
|
|
|
|
{% if pageno == x %}
|
2023-01-23 22:56:55 +01:00
|
|
|
<input role="link" class="page_number_current" type="button" value="{{ x }}">
|
2023-01-05 03:18:48 +01:00
|
|
|
{% else %}
|
2023-01-23 22:56:55 +01:00
|
|
|
<input role="link" class="page_number" type="submit" value="{{ x }}">
|
2023-01-05 03:18:48 +01:00
|
|
|
{% endif %}
|
|
|
|
</form>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2017-02-12 15:06:01 +01:00
|
|
|
</nav>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|