From 210f39a845e676e162eaa73d7ca401a8d3d89bcf Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 10 Jun 2019 17:46:47 -0700 Subject: entity view tweaks --- python/fatcat_web/templates/release_view.html | 106 +++++++++++++++++++------- 1 file changed, 78 insertions(+), 28 deletions(-) (limited to 'python/fatcat_web/templates/release_view.html') diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html index a5fb0962..ad863a64 100644 --- a/python/fatcat_web/templates/release_view.html +++ b/python/fatcat_web/templates/release_view.html @@ -104,7 +104,6 @@
-
{% if release.abstracts != [] %} @@ -180,34 +179,85 @@
-{% if release.contribs|length > 0 %} -
-
- All Contributors ({{ release.contribs|length }}) -
- - -{% for contrib in release.contribs %} - +

Known Files and URLs

+{% if entity.files != [] %} +
{% if contrib.index or contrib.index == 0 %} {{ contrib.index + 1 }}{% endif %} -
{{ contrib.role or 'unknown' }} -{% endfor %} -
+ + + {% for file in entity.files %} +
{% if file.mimetype != None %}{{ file.mimetype }}  {% endif %} + {% if file.size != None %}{{ file.size|filesizeformat }}{% endif %} +
+ {% if file.sha1 != None %}sha1:{{ file.sha1[:20] + "..." }} + {% elif file.sha256!= None %}sha256:{{ file.md5[:20] + "..." }} + {% elif file.md5 != None %}md5:{{ file.md5[:20] + "..." }} + {% endif %} + +
+ {% for url in file.urls[:5] %} + {{ url.url.split('/')[2] }} ({{ url.rel }})
+ {% endfor %} + {% if file.urls|length > 5 %} + + {{ file.urls|length - 5 }} more URLs + {% endif %} + {% endfor %} +
-
-
{% else %} -

No known contributors (authors, translators, etc). +

There are no known files associated with this release (you could try +other releases for this work?). +{% endif %} + + +{% if entity.filesets != [] %} +

File Sets

+ + + {% for fileset in entity.filesets %} + +
{{ fileset.manifest|count }} files  {{ fileset.total_size|filesizeformat }} +
fileset:{{ fileset.ident }} +
+ {% for url in fileset.urls[:5] %} + {% 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 + {% endif %} + {% endfor %} +
+{% endif %} + + +{% if entity.webcaptures != [] %} +

Web Captures

+ + + {% for webcapture in entity.webcaptures %} + +
{{ webcapture.original_url }} +
{{ webcapture.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} | {{ webcapture.cdx|count }} resources +
webcapture:{{ webcapture.ident }} +
+ {% for url in webcapture.archive_urls[:5] %} + {{ url.url.split('/')[2] }} ({{ url.rel }})
+ {% endfor %} + {% if webcapture.urls|length > 5 %} + + {{ file.urls|length - 5 }} more URLs + {% endif %} + {% endfor %} +
{% endif %}

Known Files and URLs

@@ -293,7 +343,7 @@ -
+
{% if entity.files != [] and entity.files[0].urls != [] %} Download Full Text -- cgit v1.2.3