Browse Source

[fix] add search language and time range filter to suggestions - fixes #1314

Adam Tauber 4 years ago
parent
commit
6278538890
1 changed files with 12 additions and 0 deletions
  1. 12 0
      searx/templates/oscar/results.html

+ 12 - 0
searx/templates/oscar/results.html

@@ -43,6 +43,12 @@
                 <div class="panel-body">
                     {% for suggestion in suggestions %}
                     <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item">
+                        {% 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 %}
                         <input type="hidden" name="q" value="{{ suggestion.url }}">
                         <button type="submit" class="btn btn-default btn-xs">{{ suggestion.title }}</button>
                     </form>
@@ -87,6 +93,12 @@
                     <span class="result_header text-muted form-inline pull-left suggestion_item">{{ _('Try searching for:') }}</span>
                     {% for correction in corrections -%}
                         <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-left suggestion_item">{{- "" -}}
+                            {% 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 %}
                             <input type="hidden" name="q" value="{{ correction.url }}">{{- "" -}}
                             <button type="submit" class="btn btn-default btn-xs">{{ correction.title }}</button>{{- "" -}}
                         </form>