add cache and morty proxy buttons

master
Shokara Kou 11 months ago
parent 85269e2af8
commit 7b67ae6446
  1. 23
      macros.html
  2. 2
      result_templates/default.html

@ -15,28 +15,13 @@
<!-- Draw result header -->
{% macro result_header(result) -%}
<h3>{% if result.url %}{{ result_link(result.url, result.title|safe) }}{% else %}{{ result.title|safe}}{% endif %}</h3>
<p>{{ result.url }}</p>
<p>{{ result.url }}
<span>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + 'cached') }}</span>
<span>{{ result_link("https://haku.ahmia.fi/morty/post?mortyurl=" + result.url, icon('link') + 'proxy') }}</span>
</p>
{%- endmacro %}
<!-- Draw result sub header -->
{% 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", 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) -%}
<div>
{%- if result.url -%}
{%- if result.cached_url -%}
<small>{{ result_link(result.cached_url, icon('link') + _('cached')) }}</small>
{%- elif not result.is_onion -%}
<small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached')) }}</small>
{%- endif -%}
{%- endif -%}
</div>
{%- if result.pretty_url -%}
<div class="external-link">{{ result.pretty_url }}</div>
{%- endif -%}
{%- endmacro %}

@ -1,4 +1,4 @@
{% from 'sost/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context %}
{% from 'sost/macros.html' import result_header, result_sub_header, icon with context %}
{{- result_header(result) -}}
{{- result_sub_header(result) -}}

Loading…
Cancel
Save