2019-08-06 09:41:16 +00:00
{% extends "oscar/base.html" %}
{% macro search_form_attrs(pageno) -%}
{%- for category in selected_categories -%}< input type = "hidden" name = "category_{{ category }}" value = "1" / > {%- endfor -%}
< input type = "hidden" name = "q" value = "{{ q|e }}" / > {{- "" -}}
< input type = "hidden" name = "pageno" value = "{{ pageno }}" / > {{- "" -}}
< input type = "hidden" name = "time_range" value = "{{ time_range }}" / > {{- "" -}}
< input type = "hidden" name = "language" value = "{{ current_language }}" / > {{- "" -}}
{% if timeout_limit %}< input type = "hidden" name = "timeout_limit" value = "{{ timeout_limit|e }}" / > {% endif -%}
{%- endmacro %}
2021-03-02 13:24:55 +00: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 %}
2019-07-30 04:25:05 +00:00
{%- macro search_url() %}{{ url_for('search', _external=True) }}?q={{ q|urlencode }}{% if selected_categories %}& categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}& pageno={{ pageno }}{% endif %}{% if time_range %}& time_range={{ time_range }}{% endif %}{% if current_language != 'all' %}& language={{ current_language }}{% endif %}{% endmacro -%}
2019-08-06 09:41:16 +00:00
{% block title %}{{ q|e }} - {% endblock %}
{% block meta %}{{" "}}< link rel = "alternate" type = "application/rss+xml" title = "Searx search: {{ q|e }}" href = "{{ search_url() }}&format=rss" > {% endblock %}
{% block content %}
{% include 'oscar/search.html' %}
< div class = "row" >
2019-12-20 23:34:22 +00:00
< div class = "col-sm-4 col-sm-push-8" id = "sidebar_results" >
{% if number_of_results != '0' -%}
< p > < small > {{ _('Number of results') }}: {{ number_of_results }}< / small > < / p >
{%- endif %}
{% if unresponsive_engines and results|length >= 1 -%}
< div class = "alert alert-danger fade in" role = "alert" >
< p > {{ _('Engines cannot retrieve results') }}:< / p >
{%- for engine_name, error_type in unresponsive_engines -%}
2021-04-25 12:19:35 +00:00
< 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 >
2019-12-20 23:34:22 +00:00
{%- endfor -%}
< / div >
{%- endif %}
{% if infoboxes -%}
{% for infobox in infoboxes %}
{% include 'oscar/infobox.html' %}{{- "\n\n" -}}
{% endfor %}
{%- endif %}
{% if suggestions %}
< div class = "panel panel-default" >
< div class = "panel-heading" >
< h4 class = "panel-title" > {{ _('Suggestions') }}< / h4 >
< / div >
< div class = "panel-body" >
{% for suggestion in suggestions %}
2019-07-30 04:25:05 +00:00
< form method = "{{ method or 'POST' }}" action = "{{ url_for('search') }}" role = "navigation" class = "form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item" >
2020-08-27 12:26:38 +00:00
{% if current_language != 'all' %}
< input type = "hidden" name = "language" value = "{{ current_language }}" >
{% endif %}
{% if time_range %}
< input type = "hidden" name = "time_range" value = "{{ time_range }}" >
{% endif %}
2019-12-20 23:34:22 +00:00
< input type = "hidden" name = "q" value = "{{ suggestion.url }}" >
< button type = "submit" class = "btn btn-default btn-xs" > {{ suggestion.title }}< / button >
< / form >
{% endfor %}
< / div >
< / div >
{%- endif %}
2021-01-12 03:40:21 +00:00
< div class = "panel panel-default hidden-xs" >
2019-12-20 23:34:22 +00:00
< div class = "panel-heading" > {{- "" -}}
< h4 class = "panel-title" > {{ _('Links') }}< / h4 > {{- "" -}}
< / div >
< div class = "panel-body" >
< form role = "form" > {{- "" -}}
< div class = "form-group" > {{- "" -}}
< label for = "search_url" > {{ _('Search URL') }}< / label > {{- "" -}}
< input id = "search_url" type = "url" class = "form-control select-all-on-click cursor-text" name = "search_url" value = "{{ search_url() }}" readonly > {{- "" -}}
< / div > {{- "" -}}
< / form >
< label > {{ _('Download results') }}< / label >
< div class = "clearfix" > < / div >
{% for output_type in ('csv', 'json', 'rss') %}
2019-07-30 04:25:05 +00:00
< form method = "{{ method or 'POST' }}" action = "{{ url_for('search') }}" class = "form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download" >
2019-12-20 23:34:22 +00:00
{{- search_form_attrs(pageno) -}}
< input type = "hidden" name = "format" value = "{{ output_type }}" > {{- "" -}}
< button type = "submit" class = "btn btn-default" > {{ output_type }}< / button > {{- "" -}}
< / form >
{% endfor %}
< div class = "clearfix" > < / div >
2020-06-08 23:05:15 +00:00
< br / > < label > < a href = "{{ search_url() }}&format=rss" > {{ _('RSS subscription') }}< / a > < / label >
< div class = "clearfix" > < / div >
2019-12-20 23:34:22 +00:00
< / div >
< / div >
< / div > <!-- /#sidebar_results -->
< div class = "col-sm-8 col-sm-pull-4" id = "main_results" >
2019-08-06 09:41:16 +00:00
< h1 class = "sr-only" > {{ _('Search results') }}< / h1 >
{% if corrections -%}
< div class = "result" >
2020-07-31 17:08:45 +00:00
< div class = "clearfix" >
< span class = "result_header text-muted form-inline pull-left suggestion_item" > {{ _('Try searching for:') }}< / span >
{% for correction in corrections -%}
2019-07-30 04:25:05 +00:00
< form method = "{{ method or 'POST' }}" action = "{{ url_for('search') }}" role = "navigation" class = "form-inline pull-left suggestion_item" > {{- "" -}}
2020-08-27 12:26:38 +00:00
{% if current_language != 'all' %}
< input type = "hidden" name = "language" value = "{{ current_language }}" >
{% endif %}
{% if time_range %}
< input type = "hidden" name = "time_range" value = "{{ time_range }}" >
{% endif %}
2020-07-31 17:08:45 +00:00
< input type = "hidden" name = "q" value = "{{ correction.url }}" > {{- "" -}}
< button type = "submit" class = "btn btn-default btn-xs" > {{ correction.title }}< / button > {{- "" -}}
< / form >
{% endfor %}
< / div >
2019-08-06 09:41:16 +00:00
< / div >
{%- endif %}
{% if answers -%}
2020-06-09 15:01:59 +00:00
{%- for answer in answers.values() %}
2019-08-06 09:41:16 +00:00
< div class = "result well" >
2020-06-09 15:01:59 +00:00
{% if answer.url %}
< a href = "{{ answer.url }}" > {{ answer.answer }}< / a >
{% else %}
< span > {{ answer.answer }}< / span >
{% endif %}
2019-08-06 09:41:16 +00:00
< / div >
{%- endfor %}
{%- endif %}
{% for result in results -%}
2020-06-08 22:31:52 +00:00
< div class = "result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %}{% for e in result.engines %} {{ e }}{% endfor %}" >
2019-08-06 09:41:16 +00:00
{%- set index = loop.index -%}
{%- if result.template -%}
{% include get_result_template('oscar', result['template']) %}
{%- else -%}
{% include 'oscar/result_templates/default.html' %}
{%- endif -%}
< / div >
{% endfor %}
{% if not results and not answers -%}
{% include 'oscar/messages/no_results.html' %}
{% endif %}
< div class = "clearfix" > < / div >
{% if paging -%}
{% if rtl %}
< div id = "pagination" >
< div class = "pull-left" > {{- "" -}}
2019-07-30 04:25:05 +00:00
< form method = "{{ method or 'POST' }}" action = "{{ url_for('search') }}" class = "pull-left" >
2019-08-06 09:41:16 +00:00
{{- search_form_attrs(pageno+1) -}}
2021-03-02 13:24:55 +00:00
{{- engine_data_form(engine_data) -}}
2019-08-06 09:41:16 +00:00
< button type = "submit" class = "btn btn-default" > < span class = "glyphicon glyphicon-backward" > < / span > {{ _('next page') }}< / button > {{- "" -}}
< / form > {{- "" -}}
< / div >
< div class = "pull-right" > {{- "" -}}
2019-07-30 04:25:05 +00:00
< form method = "{{ method or 'POST' }}" action = "{{ url_for('search') }}" class = "pull-left" >
2019-08-06 09:41:16 +00:00
{{- search_form_attrs(pageno-1) -}}
2021-03-02 13:24:55 +00:00
{{- engine_data_form(engine_data) -}}
2019-08-06 09:41:16 +00:00
< button type = "submit" class = "btn btn-default" { % if pageno = = 1 % } disabled { % endif % } > < span class = "glyphicon glyphicon-forward" > < / span > {{ _('previous page') }}< / button > {{- "" -}}
< / form > {{- "" -}}
< / div >
< / div > <!-- /#pagination -->
< div class = "clearfix" > < / div >
{% else %}
< div id = "pagination" >
< div class = "pull-left" > {{- "" -}}
2019-07-30 04:25:05 +00:00
< form method = "{{ method or 'POST' }}" action = "{{ url_for('search') }}" class = "pull-left" >
2019-08-06 09:41:16 +00:00
{{- search_form_attrs(pageno-1) -}}
2021-03-02 13:24:55 +00:00
{{- engine_data_form(engine_data) -}}
2019-08-06 09:41:16 +00:00
< button type = "submit" class = "btn btn-default" { % if pageno = = 1 % } disabled { % endif % } > < span class = "glyphicon glyphicon-backward" > < / span > {{ _('previous page') }}< / button > {{- "" -}}
< / form > {{- "" -}}
< / div >
< div class = "pull-right" > {{- "" -}}
2019-07-30 04:25:05 +00:00
< form method = "{{ method or 'POST' }}" action = "{{ url_for('search') }}" class = "pull-left" >
2019-08-06 09:41:16 +00:00
{{- search_form_attrs(pageno+1) -}}
2021-03-02 13:24:55 +00:00
{{- engine_data_form(engine_data) -}}
2019-08-06 09:41:16 +00:00
< button type = "submit" class = "btn btn-default" > < span class = "glyphicon glyphicon-forward" > < / span > {{ _('next page') }}< / button > {{- "" -}}
< / form > {{- "" -}}
< / div >
< / div > <!-- /#pagination -->
< div class = "clearfix" > < / div >
{% endif %}
{% endif %}
< / div > <!-- /#main_results -->
< / div >
{% endblock %}