1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-16 17:40:11 +01:00
searxng/searx/templates/simple/results.html

194 lines
9.8 KiB
HTML
Raw Normal View History

2017-02-12 15:06:01 +01:00
{% 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() %}
<input type="hidden" name="engine_data-{{ engine_name }}-{{ k|e }}" value="{{ v|e }}" />
{% endfor %}
{% endfor %}
{%- endmacro %}
{% block title %}{% if query_in_title %}{{- q|e }} - {% endif %}{% endblock %}
{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}&amp;pageno={{ pageno }}&amp;time_range={{ time_range }}&amp;language={{ current_language }}&amp;safesearch={{ safesearch }}&amp;format=rss">{% endblock %}
2017-02-12 15:06:01 +01:00
{% 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 %}
<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>
{%- 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>
{%- endfor -%}
2017-02-12 15:06:01 +01:00
</div>
{%- endif %}
2017-02-12 15:06:01 +01:00
<div id="sidebar">
{% if number_of_results != '0' -%}
<p id="result_count"><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p>
{%- endif %}
{% if unresponsive_engines and results|length >= 1 %}
<div class="dialog-error" role="alert">
{{ icon_big('warning') }}
<div>
<p><strong>{{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results') }}:</p>
{%- for engine_name, error_type in unresponsive_engines -%}
<p>{{- engine_name }} (
<a href="{{ url_for('stats', engine=engine_name|e) }}" title="{{ _('View error logs and submit a bug report') }}">
{{- error_type -}}
</a> ){{- '' -}}
</p>
{% endfor %}
</div>
2017-02-12 15:06:01 +01:00
</div>
{% endif %}
{% if infoboxes %}
<div id="infoboxes">
{% for infobox in infoboxes -%}
{% include 'simple/infobox.html' %}
{%- endfor %}
2017-02-12 15:06:01 +01:00
</div>
{% endif %}
{% if suggestions %}
2022-02-05 08:56:42 +01:00
<div id="suggestions" role="complementary" aria-labelledby="suggestions-title">
<h4 class="title" id="suggestions-title">{{ _('Suggestions') }} : </h4>
2017-02-12 15:06:01 +01:00
<div class="wrapper">
{% for suggestion in suggestions %}
<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}">
<input type="hidden" name="q" value="{{ suggestion.url }}">
{% for category in selected_categories %}
<input type="hidden" name="category_{{ category }}" value="1">
{% endfor %}
2017-02-12 15:06:01 +01:00
<input type="hidden" name="language" value="{{ current_language }}">
<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 }}">
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
2022-02-05 08:56:42 +01:00
<input type="submit" class="suggestion" role="link" value="&bull; {{ suggestion.title }}">
2017-02-12 15:06:01 +01:00
</form>
{% endfor %}
</div>
</div>
{% endif %}
{% if method == 'POST' %}
2022-02-05 08:56:42 +01:00
<div id="search_url" role="complementary" aria-labelledby="search_url-title">
<h4 class="title" id="search_url-title">{{ _('Search URL') }} :</h4>
<div class="selectable_url"><pre>{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&amp;language={{ current_language }}&amp;time_range={{ time_range }}&amp;safesearch={{ safesearch }}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if timeout_limit %}&amp;timeout_limit={{ timeout_limit|urlencode }}{% endif %}</pre></div>
2017-02-12 15:06:01 +01:00
</div>
{% endif %}
2022-02-05 08:56:42 +01:00
<div id="apis" role="complementary" aria-labelledby="apis-title">
{% if search_formats %}
2022-02-05 08:56:42 +01:00
<h4 class="title" id="apis-title">{{ _('Download results') }}</h4>
{% for output_type in search_formats %}
2017-02-12 15:06:01 +01:00
<div class="left">
<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}">
2017-02-12 15:06:01 +01:00
<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 }}">
<input type="hidden" name="language" value="{{ current_language }}">
<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="format" value="{{ output_type }}">
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
2022-02-05 08:56:42 +01:00
<input type="submit" role="link" value="{{ output_type }}">
2017-02-12 15:06:01 +01:00
</form>
</div>
{% endfor %}
{% endif %}
2017-02-12 15:06:01 +01:00
</div>
</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">
<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 }}">
<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 }}">
{% 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 }}">
</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 %}
{% 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 %}
{% 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 %}
<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 }}" >
<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 }}" >
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
{{- 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 %}
<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 }}" >
<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 }}" >
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
{{- 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>
</nav>
{% endif %}
</div>
{% endblock %}