From f1a1fc9af060a07029546e7fde51c9c1f24d9fa3 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sat, 24 Aug 2019 13:53:00 +0200 Subject: simplify url_list() template macro --- python/fatcat_web/templates/entity_macros.html | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 56ec6c5d..e553fe79 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -96,22 +96,16 @@ {%- endmacro %} -{% macro url_list(urls, wayback_suffix="") -%} +{% macro url_list(urls) -%} {% for url in urls %} - {% if url.rel == "wayback" %} - {% set suffix = wayback_suffix %} - {% else %} - {% set suffix = "" %} - {% endif %} - {% set entity = release %}
{{ url.rel }} - + {% if url.url.count('/') >= 3 and url.rel != "dweb" %} - {{ '/'.join(url.url.split('/')[0:2]) }}/{{ ''.join(url.url.split('/')[2]) }}/{{ '/'.join(url.url.split('/')[3:]) }}{{ suffix }} + {{ '/'.join(url.url.split('/')[0:2]) }}/{{ ''.join(url.url.split('/')[2]) }}/{{ '/'.join(url.url.split('/')[3:]) }} {% else %} - {{ url.url }}{{ suffix }} + {{ url.url }} {% endif %} {% endfor %} -- cgit v1.2.3