diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-03-19 23:01:21 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-03-19 23:01:21 -0700 |
commit | 791c4fba327eadcd676b53769d84db1026661ddf (patch) | |
tree | da9d92f874371de0c9ab080465cbbe9494cc00f3 /python/fatcat_web | |
parent | 1f6ef062c2aa8cd2b666a14d1906ccc26369b8ed (diff) | |
download | fatcat-791c4fba327eadcd676b53769d84db1026661ddf.tar.gz fatcat-791c4fba327eadcd676b53769d84db1026661ddf.zip |
improve url/table rendering for dweb URLs
Diffstat (limited to 'python/fatcat_web')
-rw-r--r-- | python/fatcat_web/templates/entity_macros.html | 2 | ||||
-rw-r--r-- | python/fatcat_web/templates/release_view.html | 6 |
2 files changed, 6 insertions, 2 deletions
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 %} <tr><td class="two wide right aligned">{{ url.rel }} <td class="eight wide"><small><code><a href="{{ url.url }}"> - {% if url.url.count('/') >= 3 %} + {% if url.url.count('/') >= 3 and url.rel != "dweb" %} {{ '/'.join(url.url.split('/')[0:2]) }}/<b>{{ ''.join(url.url.split('/')[2]) }}</b>/{{ '/'.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 @@ <br><small><code><a href="/fileset/{{ fileset.ident }}">fileset:{{ fileset.ident }}</a></code></small> <td class="single line"> {% for url in fileset.urls[:5] %} - <a href="{{ url.url }}">{{ url.url.split('/')[2] }}</a> ({{ url.rel }})<br> + {% if url.rel == "dweb" %} + <a href="{{ url.url }}">{{ url.url }}</a> ({{ url.rel }})<br> + {% else %} + <a href="{{ url.url }}">{{ url.url.split('/')[2] }}</a> ({{ url.rel }})<br> + {% endif %} {% endfor %} {% if fileset.urls|length > 5 %} + {{ file.urls|length - 5 }} more URLs |