From f0819e8826b2e8c694172296292a30198e3e60c1 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Tue, 9 Jun 2020 00:31:52 +0200 Subject: [PATCH 1/3] [enh] add engine names to results as classes - closes #670 --- searx/templates/courgette/result_templates/code.html | 2 +- searx/templates/courgette/result_templates/default.html | 2 +- searx/templates/courgette/result_templates/images.html | 2 +- searx/templates/courgette/result_templates/key-value.html | 2 +- searx/templates/courgette/result_templates/map.html | 2 +- searx/templates/courgette/result_templates/torrent.html | 2 +- searx/templates/courgette/result_templates/videos.html | 2 +- searx/templates/legacy/result_templates/code.html | 2 +- searx/templates/legacy/result_templates/default.html | 2 +- searx/templates/legacy/result_templates/images.html | 2 +- searx/templates/legacy/result_templates/key-value.html | 2 +- searx/templates/legacy/result_templates/map.html | 2 +- searx/templates/legacy/result_templates/torrent.html | 2 +- searx/templates/legacy/result_templates/videos.html | 2 +- searx/templates/oscar/results.html | 2 +- searx/templates/simple/macros.html | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/searx/templates/courgette/result_templates/code.html b/searx/templates/courgette/result_templates/code.html index d6dbd5ed7..b83116ec2 100644 --- a/searx/templates/courgette/result_templates/code.html +++ b/searx/templates/courgette/result_templates/code.html @@ -1,4 +1,4 @@ -
+

{{ result.title|safe }}

{% if result.publishedDate %}{{ result.publishedDate }}{% endif %}

{% if result.img_src %}{% endif %}{% if result.content %}{{ result.content|safe }}
{% endif %}

diff --git a/searx/templates/courgette/result_templates/default.html b/searx/templates/courgette/result_templates/default.html index 5f2ead63f..1cbedc32b 100644 --- a/searx/templates/courgette/result_templates/default.html +++ b/searx/templates/courgette/result_templates/default.html @@ -1,4 +1,4 @@ -
+
{% if "icon_"~result.engine~".ico" in favicons %} {{result.engine}} diff --git a/searx/templates/courgette/result_templates/images.html b/searx/templates/courgette/result_templates/images.html index 49acb3b61..e8ac5072b 100644 --- a/searx/templates/courgette/result_templates/images.html +++ b/searx/templates/courgette/result_templates/images.html @@ -1,4 +1,4 @@ -
+

{{ result.title|striptags }} {{ _('original context') }} diff --git a/searx/templates/courgette/result_templates/key-value.html b/searx/templates/courgette/result_templates/key-value.html index 789e8de92..e9382b8d8 100644 --- a/searx/templates/courgette/result_templates/key-value.html +++ b/searx/templates/courgette/result_templates/key-value.html @@ -1,4 +1,4 @@ -

+
{% for key, value in result.items() %} {% if key in ['engine', 'engines', 'template', 'score', 'category', 'positions'] %} diff --git a/searx/templates/courgette/result_templates/map.html b/searx/templates/courgette/result_templates/map.html index 5f2ead63f..1cbedc32b 100644 --- a/searx/templates/courgette/result_templates/map.html +++ b/searx/templates/courgette/result_templates/map.html @@ -1,4 +1,4 @@ -
+
{% if "icon_"~result.engine~".ico" in favicons %} {{result.engine}} diff --git a/searx/templates/courgette/result_templates/torrent.html b/searx/templates/courgette/result_templates/torrent.html index 7f94a221e..8b9a68fa9 100644 --- a/searx/templates/courgette/result_templates/torrent.html +++ b/searx/templates/courgette/result_templates/torrent.html @@ -1,4 +1,4 @@ -
+
{% if "icon_"~result.engine~".ico" in favicons %} {{result.engine}} {% endif %} diff --git a/searx/templates/courgette/result_templates/videos.html b/searx/templates/courgette/result_templates/videos.html index b3e19e024..576c483eb 100644 --- a/searx/templates/courgette/result_templates/videos.html +++ b/searx/templates/courgette/result_templates/videos.html @@ -1,4 +1,4 @@ -
+
{% if "icon_"~result.engine~".ico" in favicons %} {{result.engine}} {% endif %} diff --git a/searx/templates/legacy/result_templates/code.html b/searx/templates/legacy/result_templates/code.html index fee6c8221..ea89563ef 100644 --- a/searx/templates/legacy/result_templates/code.html +++ b/searx/templates/legacy/result_templates/code.html @@ -1,4 +1,4 @@ -
+

{{ result.title|safe }}

{{ result.pretty_url }}‎ {{ _('cached') }}

{% if result.publishedDate %}

{{ result.publishedDate }}

{% endif %} diff --git a/searx/templates/legacy/result_templates/default.html b/searx/templates/legacy/result_templates/default.html index da091174d..13e2d2913 100644 --- a/searx/templates/legacy/result_templates/default.html +++ b/searx/templates/legacy/result_templates/default.html @@ -1,4 +1,4 @@ -
+

{% if "icon_"~result.engine~".ico" in favicons %}{{result.engine}}{% endif %}{{ result.title|safe }}

{{ result.pretty_url }}‎ {{ _('cached') }} {% if result.publishedDate %}{{ result.publishedDate }}{% endif %}

diff --git a/searx/templates/legacy/result_templates/images.html b/searx/templates/legacy/result_templates/images.html index 00f62abcc..514cdf8bc 100644 --- a/searx/templates/legacy/result_templates/images.html +++ b/searx/templates/legacy/result_templates/images.html @@ -1,4 +1,4 @@ -
+

{{ result.title|striptags }} {{ _('original context') }} diff --git a/searx/templates/legacy/result_templates/key-value.html b/searx/templates/legacy/result_templates/key-value.html index a5bb509d9..15717a1a8 100644 --- a/searx/templates/legacy/result_templates/key-value.html +++ b/searx/templates/legacy/result_templates/key-value.html @@ -1,4 +1,4 @@ -

+
{% for key, value in result.items() %} {% if key in ['engine', 'engines', 'template', 'score', 'category', 'positions'] %} {% continue %} diff --git a/searx/templates/legacy/result_templates/map.html b/searx/templates/legacy/result_templates/map.html index 0200e0f6b..6937ba459 100644 --- a/searx/templates/legacy/result_templates/map.html +++ b/searx/templates/legacy/result_templates/map.html @@ -1,4 +1,4 @@ -
+
{% if "icon_"~result.engine~".ico" in favicons %} {{result.engine}} diff --git a/searx/templates/legacy/result_templates/torrent.html b/searx/templates/legacy/result_templates/torrent.html index 068e05373..f251496bf 100644 --- a/searx/templates/legacy/result_templates/torrent.html +++ b/searx/templates/legacy/result_templates/torrent.html @@ -1,4 +1,4 @@ -
+
{% if "icon_"~result.engine~".ico" in favicons %} {{result.engine}} {% endif %} diff --git a/searx/templates/legacy/result_templates/videos.html b/searx/templates/legacy/result_templates/videos.html index 727f44c71..50f4d1e98 100644 --- a/searx/templates/legacy/result_templates/videos.html +++ b/searx/templates/legacy/result_templates/videos.html @@ -1,4 +1,4 @@ -
+

{% if "icon_"~result.engine~".ico" in favicons %}{{result.engine}}{% endif %}{{ result.title|safe }}

{% if result.publishedDate %}{{ result.publishedDate }}
{% endif %} {{ result.title|striptags }} diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html index 43e3e26d9..9ce324490 100644 --- a/searx/templates/oscar/results.html +++ b/searx/templates/oscar/results.html @@ -100,7 +100,7 @@ {%- endif %} {% for result in results -%} -
+
{%- set index = loop.index -%} {%- if result.template -%} {% include get_result_template('oscar', result['template']) %} diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html index f0b36276c..cacbbec9f 100644 --- a/searx/templates/simple/macros.html +++ b/searx/templates/simple/macros.html @@ -26,7 +26,7 @@ {% macro result_header(result, favicons, image_proxify) -%} -
+
{%- if result.img_src %}{{ result_open_link(result.url) }}{{ result.title|striptags }}{{ result_close_link() }}{% endif -%} {%- if result.thumbnail %}{{ result_open_link(result.url) }}{{ result.title|striptags }}{{ result_close_link() }}{% endif -%}

{{ result_link(result.url, result.title|safe) }}

From d5e146251f8a7de7790653105eefd4f95b54943f Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Tue, 9 Jun 2020 01:05:15 +0200 Subject: [PATCH 2/3] [enh] add subscribe link to rss results - closes #468 --- searx/templates/oscar/results.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html index 9ce324490..fc4efadfa 100644 --- a/searx/templates/oscar/results.html +++ b/searx/templates/oscar/results.html @@ -72,6 +72,8 @@ {% endfor %}
+
+
From 785f0938fdc6c0b587d5f416f005ab5046260ba6 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Tue, 9 Jun 2020 01:31:34 +0200 Subject: [PATCH 3/3] [fix] add link to wikidata entities in infobox - fixes #1097 --- searx/templates/oscar/infobox.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/searx/templates/oscar/infobox.html b/searx/templates/oscar/infobox.html index 9802f11e2..de595b922 100644 --- a/searx/templates/oscar/infobox.html +++ b/searx/templates/oscar/infobox.html @@ -16,7 +16,11 @@ {%- if attribute.image -%}
{%- else -%} - + {% if attribute.label == 'Instance of' %} + + {% else %} + + {%- endif -%} {%- endif -%} {% endfor -%}
{{ attribute.image.alt }}{{ attribute.value }}{{ attribute.value.id }}{{ attribute.value }}