summaryrefslogtreecommitdiff
path: root/searx/templates/oscar/macros.html
diff options
context:
space:
mode:
authorPydo <pydo@tutanota.com>2016-09-05 14:56:53 -0400
committerPydo <pydo@tutanota.com>2016-09-05 14:56:53 -0400
commit41ce76e9c90258d97566c1f2bcf7902449c0fff0 (patch)
tree3f60941d3aa1dd4c9c1c598a80472c6c07b1b08e /searx/templates/oscar/macros.html
parent2c2123b2e8f87178dadbf82b2cefbcef483c41a7 (diff)
parent465d47283fa934eb08efab897cb9fcdcf29b21c5 (diff)
Merge branch 'master' of https://github.com/asciimoo/searx into feature/seedpeer-engine-integration
Diffstat (limited to 'searx/templates/oscar/macros.html')
-rw-r--r--searx/templates/oscar/macros.html16
1 files changed, 10 insertions, 6 deletions
diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html
index bf51d5940..06881db02 100644
--- a/searx/templates/oscar/macros.html
+++ b/searx/templates/oscar/macros.html
@@ -9,16 +9,20 @@
<img width="32" height="32" class="favicon" src="static/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>
+{%- endmacro -%}
+
<!-- Draw result header -->
-{% macro result_header(result, favicons) -%}
- <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>
+{% macro result_header(result, favicons) -%}
+<h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result_link(result.url, result.title|safe) }}</h4>
{%- endmacro %}
<!-- Draw result sub header -->
{% macro result_sub_header(result) -%}
{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
- {% if result.magnetlink %}<small> &bull; <a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} {{ _('magnet link') }}</a></small>{% endif %}
- {% if result.torrentfile %}<small> &bull; <a href="{{ result.torrentfile }}" class="torrentfile" rel="noreferrer">{{ icon('download-alt') }} {{ _('torrent file') }}</a></small>{% 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 %}
{%- endmacro %}
<!-- Draw result footer -->
@@ -28,7 +32,7 @@
{% for engine in result.engines %}
<span class="label label-default">{{ engine }}</span>
{% endfor %}
- <small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}" rel="noreferrer">{{ icon('link') }} {{ _('cached') }}</a></small>
+ <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small>
</div>
<div class="text-muted"><small>{{ result.pretty_url }}</small></div>
{%- endmacro %}
@@ -39,7 +43,7 @@
{% for engine in result.engines %}
<span class="label label-default">{{ engine }}</span>
{% endfor %}
- <small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}" rel="noreferrer">{{ icon('link') }} {{ _('cached') }}</a></small>
+ <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small>
<div class="text-muted"><small>{{ result.pretty_url }}</small></div>
{%- endmacro %}