@@ -9,16 +9,20 @@
9 <img width="32" height="32" class="favicon" src="static/themes/oscar/img/icons/{{ favicon }}.png" alt="{{ favicon }}" />
9 <img width="32" height="32" class="favicon" src="static/themes/oscar/img/icons/{{ favicon }}.png" alt="{{ favicon }}" />
10{%- endmacro %}
10{%- endmacro %}
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>
12<!-- Draw result header -->
16<!-- Draw result header -->
13−{% macro result_header(result, favicons) -%}
17+{% 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>
18+<h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result_link(result.url, result.title|safe) }}</h4>
15{%- endmacro %}
19{%- endmacro %}
17<!-- Draw result sub header -->
21<!-- Draw result sub header -->
18{% macro result_sub_header(result) -%}
22{% macro result_sub_header(result) -%}
19 {% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
23 {% 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 %}
24+ {% if result.magnetlink %}<small> • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}</small>{% endif %}
21− {% if result.torrentfile %}<small> • <a href="{{ result.torrentfile }}" class="torrentfile" rel="noreferrer">{{ icon('download-alt') }} {{ _('torrent file') }}</a></small>{% endif %}
25+ {% if result.torrentfile %}<small> • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}</small>{% endif %}
22{%- endmacro %}
26{%- endmacro %}
24<!-- Draw result footer -->
28<!-- Draw result footer -->
@@ -28,7 +32,7 @@
28 {% for engine in result.engines %}
32 {% for engine in result.engines %}
29 <span class="label label-default">{{ engine }}</span>
33 <span class="label label-default">{{ engine }}</span>
30 {% endfor %}
34 {% 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>
33 <div class="text-muted"><small>{{ result.pretty_url }}</small></div>
37 <div class="text-muted"><small>{{ result.pretty_url }}</small></div>
34{%- endmacro %}
38{%- endmacro %}
@@ -39,7 +43,7 @@
39 {% for engine in result.engines %}
43 {% for engine in result.engines %}
40 <span class="label label-default">{{ engine }}</span>
44 <span class="label label-default">{{ engine }}</span>
41 {% endfor %}
45 {% 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>
43 <div class="text-muted"><small>{{ result.pretty_url }}</small></div>
47 <div class="text-muted"><small>{{ result.pretty_url }}</small></div>
44{%- endmacro %}
48{%- endmacro %}