summaryrefslogtreecommitdiff
path: root/searx/templates
diff options
context:
space:
mode:
Diffstat (limited to 'searx/templates')
-rw-r--r--searx/templates/__common__/translations.js.tpl1
-rw-r--r--searx/templates/oscar/base.html4
-rw-r--r--searx/templates/oscar/macros.html102
-rw-r--r--searx/templates/oscar/preferences.html32
-rw-r--r--searx/templates/oscar/result_templates/default.html12
-rw-r--r--searx/templates/oscar/result_templates/files.html110
-rw-r--r--searx/templates/oscar/result_templates/map.html56
-rw-r--r--searx/templates/oscar/result_templates/torrent.html30
-rw-r--r--searx/templates/oscar/result_templates/videos.html32
-rw-r--r--searx/templates/simple/base.html3
-rw-r--r--searx/templates/simple/preferences.html15
11 files changed, 210 insertions, 187 deletions
diff --git a/searx/templates/__common__/translations.js.tpl b/searx/templates/__common__/translations.js.tpl
deleted file mode 100644
index 8453aba69..000000000
--- a/searx/templates/__common__/translations.js.tpl
+++ /dev/null
@@ -1 +0,0 @@
-var could_not_load = '{{ _('could not load data') }}!';
diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html
index f8345d9a7..b5c6ed258 100644
--- a/searx/templates/oscar/base.html
+++ b/searx/templates/oscar/base.html
@@ -9,7 +9,6 @@
<meta name="referrer" content="no-referrer">
<meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=2.0, user-scalable=1" />
{% block meta %}{% endblock %}
- <script src="{{ url_for('js_translations') }}"></script>
<title>{% block title %}{% endblock %}{{ instance_name }}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" type="text/css" />
{% if preferences.get_value('oscar-style') -%}
@@ -99,7 +98,8 @@
<script src="{{ url_for('static', filename='js/searx.min.js') }}"
data-method="{{ method or 'POST' }}"
- data-autocompleter="{% if autocomplete %}true{% else %}false{% endif %}"></script>
+ data-autocompleter="{% if autocomplete %}true{% else %}false{% endif %}"
+ data-translations="{{ translations }}"></script>
{% for script in scripts %}
{{""}}<script src="{{ url_for('static', filename=script) }}"></script>
{% endfor %}
diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html
index 571242860..1cf46074f 100644
--- a/searx/templates/oscar/macros.html
+++ b/searx/templates/oscar/macros.html
@@ -19,9 +19,9 @@
<!-- Draw result sub header -->
{% macro result_sub_header(result, id) -%}
- {% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
- {% if result.magnetlink %}<small> &bull; {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink", id) }}</small>{% endif %}
- {% if result.torrentfile %}<small> &bull; {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile", id) }}</small>{% endif %}
+ {%- if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif -%}
+ {%- if result.magnetlink %}<small> &bull; {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink", id) }}</small>{% endif -%}
+ {%- if result.torrentfile %}<small> &bull; {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile", id) }}</small>{% endif -%}
{%- endmacro %}
<!-- Draw result footer -->
@@ -32,11 +32,11 @@
<span class="label label-default">{{ engine }}</span>
{%- endfor -%}
{%- if result.url -%}
- {% if result.cached_url %}
+ {%- if result.cached_url -%}
<small>{{ result_link(result.cached_url, icon('link') + _('cached'), "text-info", id) }}</small>
- {% elif not result.is_onion %}
+ {%- elif not result.is_onion -%}
<small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small>
- {% endif %}
+ {%- endif -%}
{%- endif -%}
{%- if proxify -%}
<small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }}</small>
@@ -49,73 +49,73 @@
<!-- Draw result footer without cache link -->
{% macro result_footer_nocache(result) -%}
- <div class="clearfix"></div>
+ <div class="clearfix"></div>{{- "" -}}
<div class="pull-right">
- {% for engine in result.engines %}
+ {%- for engine in result.engines -%}
<span class="label label-default">{{ engine }}</span>
- {% endfor %}
- {% if proxify %}
+ {%- endfor -%}
+ {%- if proxify -%}
<small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small>
- {% endif %}
-</div>
+ {%- endif -%}
+</div>{{- "" -}}
<div class="external-link">{{ result.pretty_url }}</div>
{%- endmacro %}
<!-- Draw result footer -->
{% macro result_footer_rtl(result, id) -%}
- <div class="clearfix"></div>{{- "" -}}
- {% for engine in result.engines -%}
+ <div class="clearfix"></div>
+ {%- for engine in result.engines -%}
<span class="label label-default">{{ engine }}</span>
- {%- endfor %}
+ {%- endfor -%}
{%- if result.url -%}
- {% if result.cached_url %}
+ {%- if result.cached_url -%}
<small>{{ result_link(result.cached_url, icon('link') + _('cached'), "text-info", id) }}</small>
- {% elif not result.is_onion %}
+ {%- elif not result.is_onion -%}
<small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small>
- {% endif %}
+ {%- endif -%}
{%- endif -%}
- {% if proxify -%}
+ {%- if proxify -%}
<small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }}</small>
- {%- endif %}
+ {%- endif -%}
{%- if result.pretty_url -%}
<div class="external-link">{{ result.pretty_url }}</div>
- {%- endif %}
+ {%- endif -%}
{%- endmacro %}
<!-- Draw result footer without cache link -->
{% macro result_footer_nocache_rtl(result) -%}
<div class="clearfix"></div>
- {% for engine in result.engines %}
+ {%- for engine in result.engines -%}
<span class="label label-default">{{ engine }}</span>
- {% endfor %}
- {% if proxify %}
+ {%- endfor -%}
+ {%- if proxify -%}
<small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small>
- {% endif %}
+ {%- endif -%}
<div class="external-link">{{ result.pretty_url }}</div>
{%- endmacro %}
{% macro preferences_item_header(info, label, rtl, id) -%}
- {% if rtl %}
- <div class="row form-group">
- <label class="col-sm-3 col-md-2 pull-right"{% if id %} for="{{id}}"{% endif %}>{{ label }}</label>
- <span class="col-sm-5 col-md-6 help-block pull-left">{{ info }}</span>
+ {%- if rtl -%}
+ <div class="row form-group">{{- "" -}}
+ <label class="col-sm-3 col-md-2 pull-right"{% if id %} for="{{id}}"{% endif %}>{{ label }}</label>{{- "" -}}
+ <span class="col-sm-5 col-md-6 help-block pull-left">{{ info }}</span>{{- "" -}}
<div class="col-sm-4 col-md-4">
- {% else %}
- <div class="row form-group">
- <label class="col-sm-3 col-md-2"{% if id %} for="{{id}}"{% endif %}>{{ label }}</label>
+ {%- else -%}
+ <div class="row form-group">{{- "" -}}
+ <label class="col-sm-3 col-md-2"{% if id %} for="{{id}}"{% endif %}>{{ label }}</label>{{- "" -}}
<div class="col-sm-4 col-md-4">
- {% endif %}
+ {%- endif -%}
{%- endmacro %}
{% macro preferences_item_footer(info, label, rtl) -%}
- {% if rtl %}
- </div>
+ {%- if rtl -%}
+ </div>{{- "" -}}
</div>
- {% else %}
+ {%- else -%}
</div>
- <span class="col-sm-5 col-md-6 help-block">{{ info }}</span>
+ <span class="col-sm-5 col-md-6 help-block">{{ info }}</span>{{- "" -}}
</div>
- {% endif %}
+ {%- endif -%}
{%- endmacro %}
{% macro custom_select_class(rtl) -%}
@@ -123,24 +123,24 @@ custom-select{% if rtl %}-rtl{% endif %}
{%- endmacro %}
{% macro checkbox_toggle(id, blocked) -%}
- <div class="onoffswitch">
- <input type="checkbox" id="{{ id }}" name="{{ id }}"{% if blocked %} checked="checked"{% endif %} class="onoffswitch-checkbox">
- <label class="onoffswitch-label" for="{{ id }}">
- <span class="onoffswitch-inner"></span>
- <span class="onoffswitch-switch"></span>
- </label>
- <label class="visually-hidden" for="{{ id }}">{{ _('Allow') }}</label>
- </div>
+ <div class="onoffswitch">{{- "" -}}
+ <input type="checkbox" id="{{ id }}" name="{{ id }}"{% if blocked %} checked="checked"{% endif %} class="onoffswitch-checkbox">{{- "" -}}
+ <label class="onoffswitch-label" for="{{ id }}">{{- "" -}}
+ <span class="onoffswitch-inner"></span>{{- "" -}}
+ <span class="onoffswitch-switch"></span>{{- "" -}}
+ </label>{{- "" -}}
+ <label class="visually-hidden" for="{{ id }}">{{ _('Allow') }}</label>{{- "" -}}
+ </div>{{- "" -}}
{%- endmacro %}
{% macro support_toggle(supports) -%}
- {% if supports %}
+ {%- if supports -%}
<span class="label label-success">
- {{ _("supported") }}
+ {{- _("supported") -}}
</span>
- {% else %}
+ {%- else -%}
<span class="label label-danger">
- {{ _("not supported") }}
+ {{- _("not supported") -}}
</span>
- {% endif %}
+ {%- endif -%}
{%- endmacro %}
diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html
index 6253b9858..3f9192e22 100644
--- a/searx/templates/oscar/preferences.html
+++ b/searx/templates/oscar/preferences.html
@@ -1,5 +1,15 @@
{% from 'oscar/macros.html' import preferences_item_header, preferences_item_header_rtl, preferences_item_footer, preferences_item_footer_rtl, checkbox_toggle, support_toggle, custom_select_class %}
{% extends "oscar/base.html" %}
+{% macro engine_about(search_engine, id) -%}
+{% if search_engine.about is defined %}
+{% set about = search_engine.about %}
+<div class="engine-tooltip" role="tooltip" id="{{ id }}">{{- "" -}}
+ <h5><a href="{{about.website}}" rel="noreferrer">{{about.website}}</a></h5>
+ {%- if about.wikidata_id -%}<p><a href="https://www.wikidata.org/wiki/{{about.wikidata_id}}" rel="noreferrer">wikidata.org/wiki/{{about.wikidata_id}}</a></p>{%- endif -%}
+ {%- if search_engine.enable_http %}<p>{{ icon('exclamation-sign', 'No HTTPS') }}{{ _('No HTTPS')}}</p>{% endif -%}
+</div>
+{%- endif -%}
+{%- endmacro %}
{% block title %}{{ _('preferences') }} - {% endblock %}
{% block content %}
@@ -155,7 +165,7 @@
{{ preferences_item_header(info, label, rtl, 'doi_resolver') }}
<select class="form-control {{ custom_select_class(rtl) }}" name="doi_resolver" id="doi_resolver">
{% for doi_resolver_name,doi_resolver_url in doi_resolvers.items() %}
- <option value="{{ doi_resolver_name }}" {% if doi_resolver_name == current_doi_resolver %}selected="selected"{% endif %}>
+ <option value="{{ doi_resolver_name }}" {% if doi_resolver_url == current_doi_resolver %}selected="selected"{% endif %}>
{{ doi_resolver_name }} - {{ doi_resolver_url }}
</option>
{% endfor %}
@@ -227,11 +237,15 @@
{% if not search_engine.private %}
<tr>
{% if not rtl %}
- <td class="onoff-checkbox">
- {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
- </td>
- <th scope="row">{% if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif %} {{ search_engine.name }}</td></th>
- <td class="name">{{ shortcuts[search_engine.name] }}
+ <td class="onoff-checkbox">
+ {{- checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) -}}
+ </td>
+ <th scope="row"><span aria-labelledby="{{ 'tooltip_' + categ + '_' + search_engine.name }}">
+ {%- if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif -%}
+ {{- search_engine.name -}}</span>
+ {{- engine_about(search_engine, 'tooltip_' + categ + '_' + search_engine.name) -}}
+ </th>
+ <td class="name">{{ shortcuts[search_engine.name] }}</td>
<td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td>
<td>{{ support_toggle(search_engine.safesearch==True) }}</td>
<td>{{ support_toggle(search_engine.time_range_support==True) }}</td>
@@ -244,10 +258,10 @@
<td>{{ support_toggle(search_engine.safesearch==True) }}</td>
<td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td>
<td>{{ shortcuts[search_engine.name] }}</td>
- <th scope="row">{{ search_engine.name }}</th>
- <td class="onoff-checkbox">
+ <th scope="row"><span>{% if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif %}{{ search_engine.name }}</span>{{ engine_about(search_engine) }}</th>
+ <td class="onoff-checkbox">
{{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
- </td>
+ </td>
{% endif %}
</tr>
{% endif %}
diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html
index bc71d190d..d743f928e 100644
--- a/searx/templates/oscar/result_templates/default.html
+++ b/searx/templates/oscar/result_templates/default.html
@@ -9,16 +9,16 @@
{%- if result.embedded -%}
<div id="result-media-{{ index }}" class="collapse">
- {{ result.embedded|safe }}
+ {{- result.embedded|safe -}}
</div>
{%- endif -%}
{%- if result.img_src -%}
-<div class="container-fluid">
- <div class="row">
-<img src="{{ image_proxify(result.img_src) }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">
-{% if result.content %}<p class="result-content col-xs-8 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif -%}
- </div>
+<div class="container-fluid">{{- "" -}}
+ <div class="row">{{- "" -}}
+ <img src="{{ image_proxify(result.img_src) }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">
+ {%- if result.content %}<p class="result-content col-xs-8 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif -%}
+ </div>{{- "" -}}
</div>
{%- else -%}
{%- if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif -%}
diff --git a/searx/templates/oscar/result_templates/files.html b/searx/templates/oscar/result_templates/files.html
index 5e3894e0a..e2fec6f63 100644
--- a/searx/templates/oscar/result_templates/files.html
+++ b/searx/templates/oscar/result_templates/files.html
@@ -1,55 +1,55 @@
-{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer_nocache, result_footer_nocache_rtl, icon with context %}
-
-{{ result_header(result, favicons) }}
-{{ result_sub_header(result) }}
-
-{% if result.embedded %}
- <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">
- {% if result.mtype == 'audio' %}{{ icon('music') }}
- {% elif result.mtype == 'video' %} {{ icon('film') }}
- {% endif %} {{ _('show media') }}</a></small>
-{% endif %}
-
-{% if result.embedded %}
-<div id="result-media-{{ index }}" class="collapse">
- {{ result.embedded|safe }}
-</div>
-{% endif %}
-
-{% if result.abstract %}<p class="result-content result-abstract">{{ result.abstract|safe }}</p>{% endif %}
-
-{% if result.img_src %}
-<div class="container-fluid">
- <div class="row">
-<img src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">
-{% if result.content %}<p class="result-content col-xs-8 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif %}
- </div>
-</div>
-{% else %}
-{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
-{% endif %}
-
-<table class="result-metadata result-content">
-{% if result.author %}<tr><td>{{ _('Author') }}</td><td>{{ result.author|safe }}</td></tr>{% endif %}
-
-{% if result.filename %}<tr><td>{{ _('Filename') }}</td><td>{{ result.filename|safe }}</td></tr>{% endif %}
-
-{% if result.size %}<tr><td>{{ _('Filesize') }}</td><td>
- {% if result.size < 1024 %}{{ result.size }} {{ _('Bytes') }}
- {% elif result.size < 1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024) }} {{ _('kiB') }}
- {% elif result.size < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024/1024) }} {{ _('MiB') }}
- {% elif result.size < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024/1024/1024) }} {{ _('GiB') }}
- {% else %}{{ '{0:0.2f}'.format(result.size/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif %}
- </td></tr>
-{% endif %}
-
-{% if result.time %}<tr><td>{{ _('Date') }}</td><td>{{ result.time|safe }}</td></tr>{% endif %}
-
-{% if result.mtype %}<tr><td>{{ _('Type') }}</td><td>{{ result.mtype|safe }}/{{ result.subtype|safe }}</td></tr>{% endif %}
-</table>
-
-{% if rtl %}
-{{ result_footer_nocache_rtl(result) }}
-{% else %}
-{{ result_footer_nocache(result) }}
-{% endif %}
+{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer_nocache, result_footer_nocache_rtl, icon with context %}
+
+{{- result_header(result, favicons) -}}
+{{- result_sub_header(result) -}}
+
+{%- if result.embedded -%}
+ <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">
+ {%- if result.mtype == 'audio' %}{{ icon('music') -}}
+ {%- elif result.mtype == 'video' %} {{ icon('film') -}}
+ {%- endif %} {{ _('show media') }}</a></small>
+{%- endif -%}
+
+{%- if result.embedded -%}
+<div id="result-media-{{ index }}" class="collapse">
+ {{- result.embedded|safe -}}
+</div>
+{%- endif -%}
+
+{%- if result.abstract %}<p class="result-content result-abstract">{{ result.abstract|safe }}</p>{% endif -%}
+
+{%- if result.img_src -%}
+<div class="container-fluid">
+ <div class="row">
+<img src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">
+{%- if result.content %}<p class="result-content col-xs-8 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif -%}
+ </div>
+</div>
+{%- else -%}
+{%- if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif -%}
+{%- endif -%}
+
+<table class="result-metadata result-content">
+{%- if result.author %}<tr><td>{{ _('Author') }}</td><td>{{ result.author|safe }}</td></tr>{% endif -%}
+
+{%- if result.filename %}<tr><td>{{ _('Filename') }}</td><td>{{ result.filename|safe }}</td></tr>{% endif -%}
+
+{%- if result.size %}<tr><td>{{ _('Filesize') }}</td><td>
+ {%- if result.size < 1024 %}{{ result.size }} {{ _('Bytes') -}}
+ {%- elif result.size < 1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024) }} {{ _('kiB') -}}
+ {%- elif result.size < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024/1024) }} {{ _('MiB') -}}
+ {%- elif result.size < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024/1024/1024) }} {{ _('GiB') -}}
+ {%- else %}{{ '{0:0.2f}'.format(result.size/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%}
+ </td></tr>
+{%- endif -%}
+
+{%- if result.time %}<tr><td>{{ _('Date') }}</td><td>{{ result.time|safe }}</td></tr>{% endif -%}
+
+{%- if result.mtype %}<tr><td>{{ _('Type') }}</td><td>{{ result.mtype|safe }}/{{ result.subtype|safe }}</td></tr>{% endif -%}
+</table>
+
+{%- if rtl -%}
+{{ result_footer_nocache_rtl(result) }}
+{%- else -%}
+{{ result_footer_nocache(result) }}
+{%- endif -%}
diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html
index be34d65d0..9713452b3 100644
--- a/searx/templates/oscar/result_templates/map.html
+++ b/searx/templates/oscar/result_templates/map.html
@@ -1,15 +1,15 @@
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
-{{ result_header(result, favicons, loop.index) }}
-{{ result_sub_header(result, loop.index) }}
+{{- result_header(result, favicons, loop.index) -}}
+{{- result_sub_header(result, loop.index) -}}
-{% if (result.latitude and result.longitude) or result.boundingbox %}
+{%- if (result.latitude and result.longitude) or result.boundingbox -%}
<small> &bull; <a class="text-info btn-collapse collapsed searx_init_map cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}">{{ icon('globe') }} {{ _('show map') }}</a></small>
-{% endif %}
+{%- endif -%}
-{% if result.osm and (result.osm.type and result.osm.id) %}
+{%- if result.osm and (result.osm.type and result.osm.id) -%}
<small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer searx_overpass_request disabled_if_nojs" data-toggle="collapse" data-target="#result-overpass-{{ index }}" data-osm-type="{{ result.osm.type }}" data-osm-id="{{ result.osm.id }}" data-result-table="result-overpass-table-{{ index }}" data-result-table-loadicon="result-overpass-table-loading-{{ index }}" data-btn-text-collapsed="{{ _('show details') }}" data-btn-text-not-collapsed="{{ _('hide details') }}">{{ icon('map-marker') }} {{ _('show details') }}</a></small>
-{% endif %}
+{%- endif -%}
{# {% if (result.latitude and result.longitude) %}
<small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-geodata-{{ index }}" data-btn-text-collapsed="{{ _('show geodata') }}" data-btn-text-not-collapsed="{{ _('hide geodata') }}">{{ icon('map-marker') }} {{ _('show geodata') }}</a></small>
@@ -17,36 +17,36 @@
<div class="container-fluid">
-{% if result.address %}
+{%- if result.address -%}
<p class="row result-content result-adress col-xs-12 col-sm-5 col-md-4" itemscope itemtype="http://schema.org/PostalAddress">
- {% if result.address.name %}
+ {%- if result.address.name -%}
<strong itemprop="name">{{ result.address.name }}</strong><br/>
- {% endif %}
- {% if result.address.road %}
+ {%- endif -%}
+ {%- if result.address.road -%}
<span itemprop="streetAddress">
- {% if result.address.house_number %}{{ result.address.house_number }}, {% endif %}
- {{ result.address.road }}
+ {%- if result.address.house_number %}{{ result.address.house_number }}, {% endif -%}
+ {{- result.address.road -}}
</span><br/>
- {% endif %}
- {% if result.address.locality %}
+ {%- endif -%}
+ {%- if result.address.locality -%}
<span itemprop="addressLocality">{{ result.address.locality }}</span>
- {% if result.address.postcode %}, <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif %}
+ {%- if result.address.postcode %}, <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif -%}
<br/>
- {% endif %}
- {% if result.address.country %}
+ {%- endif -%}
+ {%- if result.address.country -%}
<span itemprop="addressCountry">{{ result.address.country }}</span>
- {% endif %}
+ {%- endif -%}
</p>
-{% endif %}
+{%- endif %}
-{% if result.osm and (result.osm.type and result.osm.id) %}
+{%- if result.osm and (result.osm.type and result.osm.id) -%}
<div class="row result-content collapse col-xs-12 col-sm-7 col-md-8" id="result-overpass-{{ index }}"{% if rtl %} dir="ltr"{% endif %}>
<div class="text-center" id="result-overpass-table-loading-{{ index }}"><img src="{{ url_for('static', filename='img/loader.gif') }}" alt="Loading ..."/></div>
<table class="table table-striped table-condensed hidden" id="result-overpass-table-{{ index }}">
<tr><th>key</th><th>value</th></tr>
</table>
</div>
-{% endif %}
+{%- endif -%}
{# {% if (result.latitude and result.longitude) %}
<div class="row collapse col-xs-12 col-sm-5 col-md-4" id="result-geodata-{{ index }}">
@@ -55,18 +55,18 @@
</div>
{% endif %} #}
-{% if result.content %}<p class="row result-content col-xs-12 col-sm-12 col-md-12">{{ result.content|safe }}</p>{% endif %}
+{%- if result.content %}<p class="row result-content col-xs-12 col-sm-12 col-md-12">{{ result.content|safe }}</p>{% endif -%}
</div>
-{% if (result.latitude and result.longitude) or result.boundingbox %}
+{%- if (result.latitude and result.longitude) or result.boundingbox -%}
<div class="collapse" id="result-map-{{ index }}">
<div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
</div>
-{% endif %}
+{%- endif -%}
-{% if rtl %}
-{{ result_footer_rtl(result, loop.index) }}
+{%- if rtl -%}
+{{- result_footer_rtl(result, loop.index) -}}
{% else %}
-{{ result_footer(result, loop.index) }}
-{% endif %}
+{{- result_footer(result, loop.index) -}}
+{%- endif -%}
diff --git a/searx/templates/oscar/result_templates/torrent.html b/searx/templates/oscar/result_templates/torrent.html
index 0bba61417..9f6671549 100644
--- a/searx/templates/oscar/result_templates/torrent.html
+++ b/searx/templates/oscar/result_templates/torrent.html
@@ -1,25 +1,25 @@
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
-{{ result_header(result, favicons, loop.index) }}
-{{ result_sub_header(result, loop.index) }}
+{{- result_header(result, favicons, loop.index) -}}
+{{- result_sub_header(result, loop.index) -}}
-{% if result.seed is defined %}<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> &bull; {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>{% endif %}
-{% if result.filesize %}<br />{{ icon('floppy-disk') }} {{ _('Filesize') }}
+{%- if result.seed is defined %}<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> &bull; {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>{% endif -%}
+{%- if result.filesize %}<br />{{ icon('floppy-disk') }} {{ _('Filesize') -}}
<span class="badge">
- {% if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }}
- {% elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') }}
- {% elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') }}
- {% elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') }}
- {% else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif %}
- </span>{% endif %}
-{% if result.files %}<br />{{ icon('file') }} {{ _('Number of Files') }} <span class="badge">{{ result.files }}</span>{% endif %}
+ {%- if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') -}}
+ {%- elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') -}}
+ {%- elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') -}}
+ {%- elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') -}}
+ {%- else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%}
+ </span>{% endif -%}
+{%- if result.files %}<br />{{ icon('file') }} {{ _('Number of Files') }} <span class="badge">{{ result.files }}</span>{% endif -%}
-{% if result.content %}<br />{{ result.content|safe }}{% endif %}
+{%- if result.content %}<br />{{ result.content|safe }}{% endif -%}
</p>
-{% if rtl %}
+{%- if rtl -%}
{{ result_footer_rtl(result, loop.index) }}
-{% else %}
+{%- else -%}
{{ result_footer(result, loop.index) }}
-{% endif %}
+{%- endif -%}
diff --git a/searx/templates/oscar/result_templates/videos.html b/searx/templates/oscar/result_templates/videos.html
index bf02a553a..ad17ffe33 100644
--- a/searx/templates/oscar/result_templates/videos.html
+++ b/searx/templates/oscar/result_templates/videos.html
@@ -1,29 +1,29 @@
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
-{{ result_header(result, favicons, loop.index) }}
-{{ result_sub_header(result, loop.index) }}
+{{- result_header(result, favicons, loop.index) -}}
+{{- result_sub_header(result, loop.index) -}}
-{% if result.embedded %}
+{%- if result.embedded -%}
<small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}" aria-labelledby="result-{{loop.index}}">{{ icon('film') }} {{ _('show video') }}</a></small>
-{% endif %}
+{%- endif -%}
-{% if result.embedded %}
+{%- if result.embedded -%}
<div id="result-video-{{ index }}" class="collapse">
- {{ result.embedded|safe }}
+ {{- result.embedded|safe -}}
</div>
-{% endif %}
+{%- endif -%}
-<div class="container-fluid">
- <div class="row">
+<div class="container-fluid">{{- "" -}}
+ <div class="row">{{- "" -}}
<a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ image_proxify(result.thumbnail) }}" aria-labelledby="result-{{loop.index}}" /></a>
- {% if result.author %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Author') }}</b>: {{ result.author }}</p>{% endif %}
- {% if result.length %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Length') }}</b>: {{ result.length }}</p>{% endif %}
- {% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}
- </div>
+ {%- if result.author %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Author') }}</b>: {{ result.author }}</p>{% endif -%}
+ {%- if result.length %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Length') }}</b>: {{ result.length }}</p>{% endif -%}
+ {%- if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif -%}
+ </div>{{- "" -}}
</div>
-{% if rtl %}
+{%- if rtl -%}
{{ result_footer_rtl(result, loop.index) }}
-{% else %}
+{%- else -%}
{{ result_footer(result, loop.index) }}
-{% endif %}
+{%- endif -%}
diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html
index a7255e672..17c9785e7 100644
--- a/searx/templates/simple/base.html
+++ b/searx/templates/simple/base.html
@@ -12,7 +12,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<title>{% block title %}{% endblock %}{{ instance_name }}</title>
{% block meta %}{% endblock %}
- <script src="{{ url_for('js_translations') }}"></script>
{% if rtl %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/searx-rtl.min.css') }}" type="text/css" media="screen" />
{% else %}
@@ -26,7 +25,7 @@
data-search-on-category-select="{{ 'true' if 'plugins/js/search_on_category_select.js' in scripts else 'false'}}"
data-infinite-scroll="{{ 'true' if 'plugins/js/infinite_scroll.js' in scripts else 'false' }}"
data-static-path="{{ url_for('static', filename='themes/simple') }}/"
- data-no-item-found="{{ _('No item found') }}"></script>
+ data-translations="{{ translations }}"></script>
<!--<![endif]-->
{% block head %}
<link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/>
diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html
index dff7ffba6..504610c6d 100644
--- a/searx/templates/simple/preferences.html
+++ b/searx/templates/simple/preferences.html
@@ -18,6 +18,17 @@
{%- endfor -%}
{%- endmacro -%}
+{% macro engine_about(search_engine) -%}
+{% if search_engine.about is defined %}
+{% set about = search_engine.about %}
+<div class="engine-tooltip" role="tooltip">{{- "" -}}
+ <p><a href="{{about.website}}" rel="noreferrer">{{about.website}}</a></p>
+ {%- if about.wikidata_id -%}<p><a href="https://www.wikidata.org/wiki/{{about.wikidata_id}}" rel="noreferrer">wikidata.org/wiki/{{about.wikidata_id}}</a></p>{%- endif -%}
+ {%- if search_engine.enable_http %}<p>{{ icon('exclamation-sign', 'No HTTPS') }}{{ _('No HTTPS')}}</p>{% endif -%}
+</div>
+{%- endif -%}
+{%- endmacro %}
+
{% block head %} {% endblock %}
{% block content %}
@@ -85,7 +96,7 @@
<p class="value">
<select id='doi_resolver' name='doi_resolver'>
{%- for doi_resolver_name,doi_resolver_url in doi_resolvers.items() -%}
- <option value="{{ doi_resolver_name }}" {% if doi_resolver_name == current_doi_resolver %}selected="selected"{% endif %}>
+ <option value="{{ doi_resolver_name }}" {% if doi_resolver_url == current_doi_resolver %}selected="selected"{% endif %}>
{{- doi_resolver_name }} - {{ doi_resolver_url -}}
</option>
{%- endfor -%}
@@ -121,7 +132,7 @@
{% set engine_id = 'engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_') %}
<tr>
<td class="engine_checkbox">{{ checkbox_onoff(engine_id, (search_engine.name, categ) in disabled_engines) }}</td>
- <th class="name">{% if search_engine.enable_http %}{{ icon('warning', 'No HTTPS') }}{% endif %} {{ search_engine.name }}</th>
+ <th class="name">{% if search_engine.enable_http %}{{ icon('warning', 'No HTTPS') }}{% endif %} {{ search_engine.name }} {{ engine_about(search_engine) }}</th>
<td class="shortcut">{{ shortcuts[search_engine.name] }}</td>
<td>{{ checkbox(engine_id + '_supported_languages', current_language == 'all' or current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages, true, true) }}</td>
<td>{{ checkbox(engine_id + '_safesearch', search_engine.safesearch==True, true, true) }}</td>