From b51d4ec041c59001f8365904d799b5188ec60c3c Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sun, 28 Jun 2020 20:40:48 +0200 Subject: [fix] add aria labels to result links - #350 --- searx/templates/oscar/macros.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'searx/templates/oscar/macros.html') 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 @@ {{ favicon }} {%- endmacro %} -{%- macro result_link(url, title, classes='') -%} -{{ title }} +{%- macro result_link(url, title, classes='', id='') -%} +{{ title }} {%- endmacro -%} -{% macro result_header(result, favicons) -%} -

{% 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 %}

+{% macro result_header(result, favicons, 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 %}

{%- endmacro %} -{% macro result_sub_header(result) -%} +{% macro result_sub_header(result, id) -%} {% if result.publishedDate %}{% endif %} - {% if result.magnetlink %} • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}{% endif %} - {% if result.torrentfile %} • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}{% endif %} + {% if result.magnetlink %} • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink", id) }}{% endif %} + {% if result.torrentfile %} • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile", id) }}{% endif %} {%- endmacro %} -{% macro result_footer(result) -%} +{% macro result_footer(result, id) -%}
{{- "" -}}
{%- for engine in result.engines -%} {{ engine }} {%- endfor -%} {%- if result.url -%} - {{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }} + {{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }} {%- endif -%} {%- if proxify -%} - {{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }} + {{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }} {%- endif -%}
{%- if result.pretty_url -%} @@ -44,16 +44,16 @@ {%- endmacro %} -{% macro result_footer_rtl(result) -%} +{% macro result_footer_rtl(result, id) -%}
{{- "" -}} {% for engine in result.engines -%} {{ engine }} {%- endfor %} {%- if result.url -%} - {{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }} + {{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }} {%- endif -%} {% if proxify -%} - {{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }} + {{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }} {%- endif %} {%- if result.pretty_url -%} -- cgit v1.2.3