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

This commit is contained in:
Adam Tauber 2020-08-27 14:26:38 +02:00
parent 9b9b5e9625
commit 6278538890

View File

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