@@ -9,16 +9,20 @@
99 <img width="32" height="32" class="favicon" src="static/themes/oscar/img/icons/{{ favicon }}.png" alt="{{ favicon }}" />
1010{%- endmacro %}
1111
12+{%- macro result_link(url, title, classes='') -%}
13+<a href="{{ url }}" {% if classes %}class="{{ classes }} "{% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ title }}</a>
14+{%- endmacro -%}
15+
1216<!-- Draw result header -->
13−{% macro result_header(result, favicons) -%}
14− <h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}<a href="{{ result.url }}" rel="noreferrer">{{ result.title|safe }}</a></h4>
17+{% macro result_header(result, favicons) -%}
18+<h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result_link(result.url, result.title|safe) }}</h4>
1519{%- endmacro %}
1620
1721<!-- Draw result sub header -->
1822{% macro result_sub_header(result) -%}
1923 {% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
20− {% if result.magnetlink %}<small> • <a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} {{ _('magnet link') }}</a></small>{% endif %}
21− {% if result.torrentfile %}<small> • <a href="{{ result.torrentfile }}" class="torrentfile" rel="noreferrer">{{ icon('download-alt') }} {{ _('torrent file') }}</a></small>{% endif %}
24+ {% if result.magnetlink %}<small> • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}</small>{% endif %}
25+ {% if result.torrentfile %}<small> • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}</small>{% endif %}
2226{%- endmacro %}
2327
2428<!-- Draw result footer -->
@@ -28,7 +32,7 @@
2832 {% for engine in result.engines %}
2933 <span class="label label-default">{{ engine }}</span>
3034 {% endfor %}
31− <small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}" rel="noreferrer">{{ icon('link') }} {{ _('cached') }}</a></small>
35+ <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small>
3236</div>
3337 <div class="text-muted"><small>{{ result.pretty_url }}</small></div>
3438{%- endmacro %}
@@ -39,7 +43,7 @@
3943 {% for engine in result.engines %}
4044 <span class="label label-default">{{ engine }}</span>
4145 {% endfor %}
42− <small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}" rel="noreferrer">{{ icon('link') }} {{ _('cached') }}</a></small>
46+ <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small>
4347 <div class="text-muted"><small>{{ result.pretty_url }}</small></div>
4448{%- endmacro %}
4549