@@ -1,156 +1,156 @@
1−{% extends "oscar/base.html" %}
2−{% macro search_form_attrs(pageno) -%}
3− {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
4− <input type="hidden" name="q" value="{{ q|e }}" />
5− <input type="hidden" name="pageno" value="{{ pageno }}" />
6− <input type="hidden" name="time_range" value="{{ time_range }}" />
7− <input type="hidden" name="language" value="{{ current_language }}" />
8− {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" />{% endif %}
9−{%- endmacro %}
10−{%- macro search_url() %}{{ base_url }}?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 -%}
11−
12−{% block title %}{{ q|e }} - {% endblock %}
13−{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ search_url() }}&format=rss">{% endblock %}
14−{% block content %}
15− {% include 'oscar/search.html' %}
16− <div class="row">
17− <div class="col-sm-8" id="main_results">
18− <h1 class="sr-only">{{ _('Search results') }}</h1>
19−
20− {% if corrections %}
21− <div class="result">
22− <span class="result_header text-muted form-inline pull-left suggestion_item">{{ _('Try searching for:') }}</span>
23− {% for correction in corrections %}
24− <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-left suggestion_item">
25− <input type="hidden" name="q" value="{{ correction.url }}">
26− <button type="submit" class="btn btn-default btn-xs">{{ correction.title }}</button>
27− </form>
28− {% endfor %}
29− </div>
30− {% endif %}
31−
32− {% if answers %}
33− {% for answer in answers %}
34− <div class="result well">
35− <span>{{ answer }}</span>
36− </div>
37− {% endfor %}
38− {% endif %}
39−
40− {% for result in results %}
41− <div class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %}">
42− {% set index = loop.index %}
43− {% if result.template %}
44− {% include get_result_template('oscar', result['template']) %}
45− {% else %}
46− {% include 'oscar/result_templates/default.html' %}
47− {% endif %}
48− </div>
49− {% endfor %}
50−
51− {% if not results and not answers %}
52− {% include 'oscar/messages/no_results.html' %}
53− {% endif %}
54−
55− <div class="clearfix"></div>
56−
57− {% if paging %}
58− {% if rtl %}
59− <div id="pagination">
60− <div class="pull-left">
61− <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
62− {{ search_form_attrs(pageno+1) }}
63− <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
64− </form>
65− </div>
66− <div class="pull-right">
67− <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
68− {{ search_form_attrs(pageno-1) }}
69− <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
70− </form>
71− </div>
72− </div><!-- /#pagination -->
73− <div class="clearfix"></div>
74− {% else %}
75− <div id="pagination">
76− <div class="pull-left">
77− <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
78− {{ search_form_attrs(pageno-1) }}
79− <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
80− </form>
81− </div>
82− <div class="pull-right">
83− <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
84− {{ search_form_attrs(pageno+1) }}
85− <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
86− </form>
87− </div>
88− </div><!-- /#pagination -->
89− <div class="clearfix"></div>
90− {% endif %}
91− {% endif %}
92− </div><!-- /#main_results -->
93−
94− <div class="col-sm-4" id="sidebar_results">
95− {% if number_of_results != '0' %}
96− <p><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p>
97− {% endif %}
98−
99− {% if unresponsive_engines and results|length >= 1 %}
100− <div class="alert alert-danger fade in" role="alert">
101− <p>{{ _('Engines cannot retrieve results') }}:</p>
102− {% for engine_name, error_type in unresponsive_engines %}
103− {{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}
104− {% endfor %}
105− </div>
106− {% endif %}
107−
108− {% if infoboxes %}
109− {% for infobox in infoboxes %}
110− {% include 'oscar/infobox.html' %}
111− {% endfor %}
112− {% endif %}
113−
114− {% if suggestions %}
115− <div class="panel panel-default">
116− <div class="panel-heading">
117− <h4 class="panel-title">{{ _('Suggestions') }}</h4>
118− </div>
119− <div class="panel-body">
120− {% for suggestion in suggestions %}
121− <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item">
122− <input type="hidden" name="q" value="{{ suggestion.url }}">
123− <button type="submit" class="btn btn-default btn-xs">{{ suggestion.title }}</button>
124− </form>
125− {% endfor %}
126− </div>
127− </div>
128− {% endif %}
129−
130− <div class="panel panel-default">
131− <div class="panel-heading">
132− <h4 class="panel-title">{{ _('Links') }}</h4>
133− </div>
134− <div class="panel-body">
135− <form role="form">
136− <div class="form-group">
137− <label for="search_url">{{ _('Search URL') }}</label>
138− <input id="search_url" type="url" class="form-control select-all-on-click cursor-text" name="search_url" value="{{ search_url() }}" readonly>
139− </div>
140− </form>
141−
142− <label>{{ _('Download results') }}</label>
143− <div class="clearfix"></div>
144− {% for output_type in ('csv', 'json', 'rss') %}
145− <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download">
146− {{ search_form_attrs(pageno) }}
147− <input type="hidden" name="format" value="{{ output_type }}">
148− <button type="submit" class="btn btn-default">{{ output_type }}</button>
149− </form>
150− {% endfor %}
151− <div class="clearfix"></div>
152− </div>
153− </div>
154− </div><!-- /#sidebar_results -->
155− </div>
156−{% endblock %}
1+{% extends "oscar/base.html" %}
2+{% macro search_form_attrs(pageno) -%}
3+ {%- for category in selected_categories -%}<input type="hidden" name="category_{{ category }}" value="1"/>{%- endfor -%}
4+ <input type="hidden" name="q" value="{{ q|e }}" />{{- "" -}}
5+ <input type="hidden" name="pageno" value="{{ pageno }}" />{{- "" -}}
6+ <input type="hidden" name="time_range" value="{{ time_range }}" />{{- "" -}}
7+ <input type="hidden" name="language" value="{{ current_language }}" />{{- "" -}}
8+ {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" />{% endif -%}
9+{%- endmacro %}
10+{%- macro search_url() %}{{ base_url }}?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 -%}
11+
12+{% block title %}{{ q|e }} - {% endblock %}
13+{% block meta %}{{" "}}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ search_url() }}&format=rss">{% endblock %}
14+{% block content %}
15+ {% include 'oscar/search.html' %}
16+
17+ <div class="row">
18+ <div class="col-sm-8" id="main_results">
19+ <h1 class="sr-only">{{ _('Search results') }}</h1>
20+
21+ {% if corrections -%}
22+ <div class="result">
23+ <span class="result_header text-muted form-inline pull-left suggestion_item">{{ _('Try searching for:') }}</span>
24+ {% for correction in corrections -%}
25+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-left suggestion_item">{{- "" -}}
26+ <input type="hidden" name="q" value="{{ correction.url }}">{{- "" -}}
27+ <button type="submit" class="btn btn-default btn-xs">{{ correction.title }}</button>{{- "" -}}
28+ </form>
29+ {% endfor %}
30+ </div>
31+ {%- endif %}
32+
33+ {% if answers -%}
34+ {%- for answer in answers %}
35+ <div class="result well">
36+ <span>{{ answer }}</span>
37+ </div>
38+ {%- endfor %}
39+ {%- endif %}
40+
41+ {% for result in results -%}
42+ <div class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %}">
43+ {%- set index = loop.index -%}
44+ {%- if result.template -%}
45+ {% include get_result_template('oscar', result['template']) %}
46+ {%- else -%}
47+ {% include 'oscar/result_templates/default.html' %}
48+ {%- endif -%}
49+ </div>
50+ {% endfor %}
51+
52+ {% if not results and not answers -%}
53+ {% include 'oscar/messages/no_results.html' %}
54+ {% endif %}
55+
56+ <div class="clearfix"></div>
57+
58+ {% if paging -%}
59+ {% if rtl %}
60+ <div id="pagination">
61+ <div class="pull-left">{{- "" -}}
62+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
63+ {{- search_form_attrs(pageno+1) -}}
64+ <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>{{- "" -}}
65+ </form>{{- "" -}}
66+ </div>
67+ <div class="pull-right">{{- "" -}}
68+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
69+ {{- search_form_attrs(pageno-1) -}}
70+ <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>{{- "" -}}
71+ </form>{{- "" -}}
72+ </div>
73+ </div><!-- /#pagination -->
74+ <div class="clearfix"></div>
75+ {% else %}
76+ <div id="pagination">
77+ <div class="pull-left">{{- "" -}}
78+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
79+ {{- search_form_attrs(pageno-1) -}}
80+ <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>{{- "" -}}
81+ </form>{{- "" -}}
82+ </div>
83+ <div class="pull-right">{{- "" -}}
84+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
85+ {{- search_form_attrs(pageno+1) -}}
86+ <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>{{- "" -}}
87+ </form>{{- "" -}}
88+ </div>
89+ </div><!-- /#pagination -->
90+ <div class="clearfix"></div>
91+ {% endif %}
92+ {% endif %}
93+ </div><!-- /#main_results -->
94+
95+ <div class="col-sm-4" id="sidebar_results">
96+ {% if number_of_results != '0' -%}
97+ <p><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p>
98+ {%- endif %}
99+
100+ {% if unresponsive_engines and results|length >= 1 -%}
101+ <div class="alert alert-danger fade in" role="alert">
102+ <p>{{ _('Engines cannot retrieve results') }}:</p>
103+ {%- for engine_name, error_type in unresponsive_engines -%}AAAA
104+ {{- engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}{{- "" -}}
105+ {%- endfor -%}
106+ </div>
107+ {%- endif %}
108+
109+ {% if infoboxes -%}
110+ {% for infobox in infoboxes %}
111+ {% include 'oscar/infobox.html' %}{{- "\n\n" -}}
112+ {% endfor %}
113+ {%- endif %}
114+
115+ {% if suggestions %}
116+ <div class="panel panel-default">
117+ <div class="panel-heading">
118+ <h4 class="panel-title">{{ _('Suggestions') }}</h4>
119+ </div>
120+ <div class="panel-body">
121+ {% for suggestion in suggestions %}
122+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item">
123+ <input type="hidden" name="q" value="{{ suggestion.url }}">
124+ <button type="submit" class="btn btn-default btn-xs">{{ suggestion.title }}</button>
125+ </form>
126+ {% endfor %}
127+ </div>
128+ </div>
129+ {%- endif %}
130+
131+ <div class="panel panel-default">
132+ <div class="panel-heading">{{- "" -}}
133+ <h4 class="panel-title">{{ _('Links') }}</h4>{{- "" -}}
134+ </div>
135+ <div class="panel-body">
136+ <form role="form">{{- "" -}}
137+ <div class="form-group">{{- "" -}}
138+ <label for="search_url">{{ _('Search URL') }}</label>{{- "" -}}
139+ <input id="search_url" type="url" class="form-control select-all-on-click cursor-text" name="search_url" value="{{ search_url() }}" readonly>{{- "" -}}
140+ </div>{{- "" -}}
141+ </form>
142+ <label>{{ _('Download results') }}</label>
143+ <div class="clearfix"></div>
144+ {% for output_type in ('csv', 'json', 'rss') %}
145+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download">
146+ {{- search_form_attrs(pageno) -}}
147+ <input type="hidden" name="format" value="{{ output_type }}">{{- "" -}}
148+ <button type="submit" class="btn btn-default">{{ output_type }}</button>{{- "" -}}
149+ </form>
150+ {% endfor %}
151+ <div class="clearfix"></div>
152+ </div>
153+ </div>
154+ </div><!-- /#sidebar_results -->
155+ </div>
156+{% endblock %}