summaryrefslogtreecommitdiff
path: root/searx/templates/oscar/macros.html
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2020-06-29 06:14:42 +0000
committerGitHub <noreply@github.com>2020-06-29 06:14:42 +0000
commitbdd24a6e7100d6df44400ca792b0468e4993a317 (patch)
tree0a42e07e87a0cf27f5b47cc644763aa68e27205b /searx/templates/oscar/macros.html
parentc9795ad01f62babd282074d1d6e836b3e66ad564 (diff)
parente39ad892de49b93d39df893f3b134387b3a933b2 (diff)
Merge branch 'master' into blog-dev-in-lxc
Diffstat (limited to 'searx/templates/oscar/macros.html')
-rw-r--r--searx/templates/oscar/macros.html32
1 files changed, 16 insertions, 16 deletions
diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html
index c4b2a7ddb..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> &bull; {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}</small>{% endif %}
- {% if result.torrentfile %}<small> &bull; {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}</small>{% 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 -->
-{% 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,31 +44,31 @@
{%- 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>
{%- endif %}
{%- endmacro %}
-{% macro preferences_item_header(info, label, rtl) -%}
+{% 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">{{ label }}</label>
+ <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">{{ label }}</label>
+ <label class="col-sm-3 col-md-2"{% if id %} for="{{id}}"{% endif %}>{{ label }}</label>
<div class="col-sm-4 col-md-4">
{% endif %}
{%- endmacro %}