show engine errors in infobox && add new error alert

This commit is contained in:
Noémi Ványi 2017-07-09 22:09:46 +02:00
parent 3bd5ce6595
commit 243d3e4298
6 changed files with 29 additions and 5 deletions

View file

@ -1,9 +1,12 @@
{% from 'oscar/macros.html' import icon %}
{% if unresponsive_engines %}
<div class="alert alert-danger fade in" role="alert">
<p><strong class="lead">{{ icon('remove-sign') }} {{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results.') }}</p>
<p><small>{{ _('Please, try again later or find another searx instance.') }}</small></p>
</div>
{% else %}
<div class="alert alert-info fade in" role="alert">
<button class="close" data-dismiss="alert" type="button">
<span aria-hidden="true">×</span>
<span class="sr-only">{{ _('Close') }}</span>
</button>
<strong class="lead">{{ icon('info-sign') }} {{ _('Sorry!') }}</strong>
{{ _('we didn\'t find any results. Please use another query or search in more categories.') }}
</div>
{% endif %}

View file

@ -94,6 +94,16 @@
{% 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 %}
{{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}
{% endfor %}
</div>
{% endif %}
{% if infoboxes %}
{% for infobox in infoboxes %}
{% include 'oscar/infobox.html' %}