diff options
author | Adam Tauber <asciimoo@gmail.com> | 2020-06-09 00:31:52 +0200 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2020-06-09 00:31:52 +0200 |
commit | f0819e8826b2e8c694172296292a30198e3e60c1 (patch) | |
tree | 7fde72af304c7c7bb53da7d557fdcde47ad51f7f /searx/templates | |
parent | c6ca468df2cf0813619eb67912d3b34ac8fdfac6 (diff) | |
download | searxng-f0819e8826b2e8c694172296292a30198e3e60c1.tar.gz searxng-f0819e8826b2e8c694172296292a30198e3e60c1.zip |
[enh] add engine names to results as classes - closes #670
Diffstat (limited to 'searx/templates')
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 @@ -<div class="result {{ result.class }}"> +<div class="result {{ result.class }}{% for e in result.engines %} {{ e }}{% endfor %}"> <h3 class="result_title"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %} <p class="content">{% if result.img_src %}<img src="{{ image_proxify(result.img_src) }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p> 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 @@ -<div class="result {{ result.class }}"> +<div class="result {{ result.class }}{% for e in result.engines %} {{ e }}{% endfor %}"> {% if "icon_"~result.engine~".ico" in favicons %} <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{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 @@ -<div class="image_result"> +<div class="image_result{% for e in result.engines %} {{ e }}{% endfor %}"> <p> <a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/></a> <span class="url"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="small_font">{{ _('original context') }}</a></span> 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 @@ -<div class="result"> +<div class="result{% for e in result.engines %} {{ e }}{% endfor %}"> <table> {% 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 @@ -<div class="result {{ result.class }}"> +<div class="result {{ result.class }}{% for e in result.engines %} {{ e }}{% endfor %}"> {% if "icon_"~result.engine~".ico" in favicons %} <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{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 @@ -<div class="result torrent_result"> +<div class="result torrent_result{% for e in result.engines %} {{ e }}{% endfor %}"> {% if "icon_"~result.engine~".ico" in favicons %} <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{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 @@ -<div class="result"> +<div class="result{% for e in result.engines %} {{ e }}{% endfor %}"> {% if "icon_"~result.engine~".ico" in favicons %} <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{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 @@ -<div class="result {{ result.class }}"> +<div class="result {{ result.class }}{% for e in result.engines %} {{ e }}{% endfor %}"> <h3 class="result_title"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> <p class="url">{{ result.pretty_url }}‎ <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ _('cached') }}</a></p> {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% 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 @@ -<div class="result {{ result.class }}"> +<div class="result {{ result.class }}{% for e in result.engines %} {{ e }}{% endfor %}"> <h3 class="result_title">{% if "icon_"~result.engine~".ico" in favicons %}<img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{result.engine}}" />{% endif %}<a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> <p class="url">{{ result.pretty_url }}‎ <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ _('cached') }}</a> {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %}</p> 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 @@ -<div class="image_result"> +<div class="image_result{% for e in result.engines %} {{ e }}{% endfor %}"> <p> <a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}" /></a> <span class="url"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="small_font">{{ _('original context') }}</a></span> 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 @@ -<table class="result-table"> +<table class="result-table{% for e in result.engines %} {{ e }}{% endfor %}"> {% 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 @@ -<div class="result {{ result.class }}"> +<div class="result {{ result.class }}{% for e in result.engines %} {{ e }}{% endfor %}"> {% if "icon_"~result.engine~".ico" in favicons %} <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{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 @@ -<div class="result torrent_result"> +<div class="result torrent_result{% for e in result.engines %} {{ e }}{% endfor %}"> {% if "icon_"~result.engine~".ico" in favicons %} <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{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 @@ -<div class="result"> +<div class="result{% for e in result.engines %} {{ e }}{% endfor %}"> <h3 class="result_title">{% if "icon_"~result.engine~".ico" in favicons %}<img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{result.engine}}" />{% endif %}<a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span><br />{% endif %} <a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail" src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/></a> 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 -%} - <div class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %}"> + <div class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %}{% for e in result.engines %} {{ e }}{% endfor %}"> {%- 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 @@ <!-- Draw result header --> {% macro result_header(result, favicons, image_proxify) -%} -<article class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %} {% if result['category'] %}category-{{ result['category'] }}{% endif %}"> +<article class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %} {% if result['category'] %}category-{{ result['category'] }}{% endif %}{% for e in result.engines %} {{ e }}{% endfor %}"> {%- if result.img_src %}{{ result_open_link(result.url) }}<img class="image" src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="image" />{{ result_close_link() }}{% endif -%} {%- if result.thumbnail %}{{ result_open_link(result.url) }}<img class="thumbnail" src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/>{{ result_close_link() }}{% endif -%} <h3>{{ result_link(result.url, result.title|safe) }}</h3> |