diff options
Diffstat (limited to 'searx/templates')
-rw-r--r-- | searx/templates/oscar/results.html | 11 | ||||
-rw-r--r-- | searx/templates/simple/results.html | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html index eada8cd26..df2d42430 100644 --- a/searx/templates/oscar/results.html +++ b/searx/templates/oscar/results.html @@ -7,6 +7,13 @@ <input type="hidden" name="language" value="{{ current_language }}" />{{- "" -}} {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" />{% endif -%} {%- endmacro %} +{% 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 %} {%- 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 -%} {% block title %}{{ q|e }} - {% endblock %} @@ -142,12 +149,14 @@ <div class="pull-left">{{- "" -}} <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="pull-left"> {{- search_form_attrs(pageno+1) -}} + {{- engine_data_form(engine_data) -}} <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>{{- "" -}} </form>{{- "" -}} </div> <div class="pull-right">{{- "" -}} <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="pull-left"> {{- search_form_attrs(pageno-1) -}} + {{- engine_data_form(engine_data) -}} <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>{{- "" -}} </form>{{- "" -}} </div> @@ -158,12 +167,14 @@ <div class="pull-left">{{- "" -}} <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="pull-left"> {{- search_form_attrs(pageno-1) -}} + {{- engine_data_form(engine_data) -}} <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">{{- "" -}} <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="pull-left"> {{- search_form_attrs(pageno+1) -}} + {{- engine_data_form(engine_data) -}} <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>{{- "" -}} </form>{{- "" -}} </div> diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.html index 936de8831..7ece6c7ad 100644 --- a/searx/templates/simple/results.html +++ b/searx/templates/simple/results.html @@ -1,5 +1,12 @@ {% extends "simple/base.html" %} {% from 'simple/macros.html' import icon, 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 method == 'GET' %}{{- 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 }}&categories={{ selected_categories|join(",") | replace(' ','+') }}&pageno={{ pageno }}&time_range={{ time_range }}&language={{ current_language }}&safesearch={{ safesearch }}&format=rss">{% endblock %} {% block content %} @@ -136,6 +143,7 @@ <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div class="{% if rtl %}right{% else %}left{% endif %}"> <input type="hidden" name="q" value="{{ q|e }}" > + {{- engine_data_form(engine_data) -}} {% for category in selected_categories %} <input type="hidden" name="category_{{ category }}" value="1" > {% endfor %} @@ -152,6 +160,7 @@ <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div class="{% if rtl %}left{% else %}right{% endif %}"> <input type="hidden" name="q" value="{{ q|e }}" > + {{- engine_data_form(engine_data) -}} {% for category in selected_categories %} <input type="hidden" name="category_{{ category }}" value="1" > {% endfor %} |