diff options
author | bnewbold <bnewbold@robocracy.org> | 2019-06-06 00:17:16 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-06-13 14:33:20 -0700 |
commit | 743940ce6075c1a1b547915a33ad8874094ae762 (patch) | |
tree | 0b1fb6f9b0105869a0d3effc37777f6f0db77122 /python/fatcat_web/templates/release_files.html | |
parent | ff843b1fcb73d8446c16f0aadd7a044e66e70a80 (diff) | |
download | fatcat-743940ce6075c1a1b547915a33ad8874094ae762.tar.gz fatcat-743940ce6075c1a1b547915a33ad8874094ae762.zip |
experiment with entity view tabs
Diffstat (limited to 'python/fatcat_web/templates/release_files.html')
-rw-r--r-- | python/fatcat_web/templates/release_files.html | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/python/fatcat_web/templates/release_files.html b/python/fatcat_web/templates/release_files.html new file mode 100644 index 00000000..c8432cb5 --- /dev/null +++ b/python/fatcat_web/templates/release_files.html @@ -0,0 +1,91 @@ +{% set entity = release %} +{% set entity_view = "files" %} +{% set entity_type = "release" %} +{% import "entity_macros.html" as entity_macros %} +{% extends "entity_base.html" %} + +{% block entity_main %} + +<h3>Known Files and URLs</h3> +{% if entity.files != [] %} +<table class="ui compact fixed table"> +<!-- + <thead> + <tr><th>SHA-1 + <th>Size (bytes) + <th>File Type + <th>Links + </thead> +--> + <tbody> + {% for file in entity.files %} + <tr><td>{% if file.mimetype != None %}{{ file.mimetype }} {% endif %} + {% if file.size != None %}{{ file.size|filesizeformat }}{% endif %} + <br><small><code><a href="/file/{{ file.ident }}"> + {% 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 %} + </a></code></small> + <td class="single line"> + {% for url in file.urls[:5] %} + <a href="{{ url.url }}">{{ url.url.split('/')[2] }}</a> ({{ url.rel }})<br> + {% endfor %} + {% if file.urls|length > 5 %} + <a href="/file/{{ file.ident }}">+ {{ file.urls|length - 5 }} more URLs</a> + {% endif %} + {% endfor %} + </tbody> +</table> +{% else %} +<p>There are no known files associated with this release (you could try +<a href="/work/{{ release.work_id }}">other releases for this work?</a>). +{% endif %} + + +{% if entity.filesets != [] %} +<h3>File Sets</h3> +<table class="ui compact fixed table"> + <tbody> + {% for fileset in entity.filesets %} + <tr><td>{{ fileset.manifest|count }} files {{ fileset.total_size|filesizeformat }} + <br><small><code><a href="/fileset/{{ fileset.ident }}">fileset:{{ fileset.ident }}</a></code></small> + <td class="single line"> + {% for url in fileset.urls[:5] %} + {% 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 + {% endif %} + {% endfor %} + </tbody> +</table> +{% endif %} + + +{% if entity.webcaptures != [] %} +<h3>Web Captures</h3> +<table class="ui single line compact fixed table"> + <tbody> + {% for webcapture in entity.webcaptures %} + <tr><td><b><a href="{{ webcapture.original_url }}">{{ webcapture.original_url }}</a></b> + <br>{{ webcapture.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} | {{ webcapture.cdx|count }} resources + <br><small><code><a href="/webcapture/{{ webcapture.ident }}">webcapture:{{ webcapture.ident }}</a></code></small> + <td class="single line"> + {% for url in webcapture.archive_urls[:5] %} + <a href="{{ url.url }}{% if url.rel == "wayback" %}{{ webcapture.wayback_suffix }}{% endif %}">{{ url.url.split('/')[2] }}</a> ({{ url.rel }})<br> + {% endfor %} + {% if webcapture.urls|length > 5 %} + + {{ file.urls|length - 5 }} more URLs + {% endif %} + {% endfor %} + </tbody> +</table> +{% endif %} + +{% endblock %} + |