From 791c4fba327eadcd676b53769d84db1026661ddf Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 19 Mar 2019 23:01:21 -0700 Subject: improve url/table rendering for dweb URLs --- python/fatcat_web/templates/entity_macros.html | 2 +- python/fatcat_web/templates/release_view.html | 6 +++++- 2 files changed, 6 insertions(+), 2 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 13e2d305..3e83b9d4 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -72,7 +72,7 @@ {% for url in urls %} {{ url.rel }} - {% if url.url.count('/') >= 3 %} + {% 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:]) }} {% else %} {{ url.url }} diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html index df98ed15..d2078d13 100644 --- a/python/fatcat_web/templates/release_view.html +++ b/python/fatcat_web/templates/release_view.html @@ -241,7 +241,11 @@
fileset:{{ fileset.ident }} {% for url in fileset.urls[:5] %} - {{ url.url.split('/')[2] }} ({{ url.rel }})
+ {% if url.rel == "dweb" %} + {{ url.url }} ({{ url.rel }})
+ {% else %} + {{ url.url.split('/')[2] }} ({{ url.rel }})
+ {% endif %} {% endfor %} {% if fileset.urls|length > 5 %} + {{ file.urls|length - 5 }} more URLs -- cgit v1.2.3