diff options
| author | Markus Heiser <markus.heiser@darmarIT.de> | 2020-06-29 06:47:06 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-29 06:47:06 +0000 |
| commit | 02017bc624e13341d29ec63a48566dbd618ccee1 (patch) | |
| tree | af61bed20c47fec9603fd62cb23142a5be6462d3 /searx/templates/oscar/macros.html | |
| parent | 93cbd85b8a5becdf69e6d70dd7c60f7122531262 (diff) | |
| parent | 0fdd9339d09864ae0f5caca2b8aa9210d8757744 (diff) | |
Merge branch 'master' into duckduckgo_correction
Diffstat (limited to 'searx/templates/oscar/macros.html')
| -rw-r--r-- | searx/templates/oscar/macros.html | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html index 809c9f595..58f966997 100644 --- a/searx/templates/oscar/macros.html +++ b/searx/templates/oscar/macros.html @@ -8,34 +8,34 @@ <img width="32" height="32" class="favicon" src="{{ url_for('static', filename='themes/oscar/img/icons/' + favicon + '.png') }}" alt="{{ favicon }}" /> {%- endmacro %} -{%- macro result_link(url, title, classes='') -%} -<a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ title }}</a> +{%- macro result_link(url, title, classes='', id='') -%} +<a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}{% if id %} aria-labelledby="result-{{id}}"{%endif%}>{{ title }}</a> {%- endmacro -%} <!-- Draw result header --> -{% macro result_header(result, favicons) -%} -<h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{% if result.url %}{{ result_link(result.url, result.title|safe) }}{% else %}{{ result.title|safe}}{% endif %}</h4> +{% macro result_header(result, favicons, id) -%} +<h4 class="result_header" id="result-{{id}}">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{% if result.url %}{{ result_link(result.url, result.title|safe, id=id) }}{% else %}{{ result.title|safe}}{% endif %}</h4> {%- endmacro %} <!-- Draw result sub header --> -{% macro result_sub_header(result) -%} +{% macro result_sub_header(result, id) -%} {% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %} - {% if result.magnetlink %}<small> • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}</small>{% endif %} - {% if result.torrentfile %}<small> • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}</small>{% endif %} + {% if result.magnetlink %}<small> • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink", id) }}</small>{% endif %} + {% if result.torrentfile %}<small> • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile", id) }}</small>{% endif %} {%- endmacro %} <!-- Draw result footer --> -{% macro result_footer(result) -%} +{% macro result_footer(result, id) -%} <div class="clearfix"></div>{{- "" -}} <div class="pull-right"> {%- for engine in result.engines -%} <span class="label label-default">{{ engine }}</span> {%- endfor -%} {%- if result.url -%} - <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small> + <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small> {%- endif -%} {%- if proxify -%} - <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small> + <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }}</small> {%- endif -%} </div> {%- if result.pretty_url -%} @@ -44,16 +44,16 @@ {%- endmacro %} <!-- Draw result footer --> -{% macro result_footer_rtl(result) -%} +{% macro result_footer_rtl(result, id) -%} <div class="clearfix"></div>{{- "" -}} {% for engine in result.engines -%} <span class="label label-default">{{ engine }}</span> {%- endfor %} {%- if result.url -%} - <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small> + <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small> {%- endif -%} {% if proxify -%} - <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small> + <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }}</small> {%- endif %} {%- if result.pretty_url -%} <div class="external-link">{{ result.pretty_url }}</div> |