From 973eb19ee83950a1adf5d25d6443830d229a1ef5 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 31 Mar 2022 12:35:13 -0700 Subject: web metadata display: multi-line for some array values --- python/fatcat_web/templates/entity_macros.html | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'python/fatcat_web') diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 5f8f6e0a..4386e698 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -75,6 +75,14 @@ {{ u }}
{% endfor %} + {% elif key in ("manifest", "abstracts", "refs", "releases", "files", "webcaptures", "filesets", "urls", "archive_urls", "cdx", "contribs") and value and value is iterable and value is not string %} + {{ key }}[] + + + {% for m in value %} + {% if m != None %}{{ m }}{% endif %}
+ {% endfor %} +
{% else %} {{ key }} {% if value != None %}{{ value }}{% endif %} -- cgit v1.2.3 From 5f5dd6f0582197c1773326b55ee22c7bd7f9bb98 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 31 Mar 2022 12:35:31 -0700 Subject: web: refactor fileset manifest display --- python/fatcat_web/templates/fileset_view.html | 79 ++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 14 deletions(-) (limited to 'python/fatcat_web') diff --git a/python/fatcat_web/templates/fileset_view.html b/python/fatcat_web/templates/fileset_view.html index 4e8bfbad..e4d7b687 100644 --- a/python/fatcat_web/templates/fileset_view.html +++ b/python/fatcat_web/templates/fileset_view.html @@ -3,6 +3,21 @@ {% import "entity_macros.html" as entity_macros %} {% extends "entity_base.html" %} +{% macro file_mimetype_icon(mimetype) -%} + {%- if not mimetype -%}file outline + {%- elif mimetype in ["application/pdf"] -%}file pdf outline + {%- elif mimetype in ["application/x-hdf"] -%}database + {%- elif mimetype in ["text/csv", "text/tab-separated-values"] -%}table + {%- elif mimetype in ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] -%}table + {%- elif mimetype in ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"] -%}file alternate outline + {%- elif mimetype in ["application/zip", "application/gzip", "application/x-tar", "application/x-rar", "application/x-bzip2"] -%}file archive outline + {%- elif mimetype in ["application/octet-stream"] -%}save outline + {%- elif mimetype.startswith("text/") -%}file alternate outline + {%- elif mimetype.startswith("image/") -%}file image outline + {%- elif mimetype.startswith("video/") -%}film + {%- else -%}file outline{% endif %} +{%- endmacro %} + {% block entity_main %}
@@ -23,26 +38,62 @@ No known public URL, mirror, or archive for this File Set. {% endif %} +{% set fileset_vars = namespace(archiveorg_base=None, webarchiveorg_base=None) %} +{% for u in (entity.urls or []) %} + {% if u.rel in ["archive-base"] %} + {% set fileset_vars.archiveorg_base = u.url %} + {% elif u.rel in ["webarchive-base"] %} + {% set fileset_vars.webarchiveorg_base = u.url %} + {% endif %} +{% endfor %} +

File Manifest ({{ fileset.manifest|count }})

{% if fileset.manifest %} -
+ + + + + + + + + + + {% for file in fileset.manifest %} -
-
-
- {{ file.path }} ({{ file.size|filesizeformat }}{% if file.extra.mimetype %}, {{ file.extra.mimetype }}{% endif %}) -
-
- {% if file.md5 %} md5:{{ file.md5 }}
{% endif %} - {% if file.sha1 %} sha1:{{ file.sha1 }}
{% endif %} - {% if file.sha256 %}sha256:{{ file.sha256 }}
{% endif %} +
+ + + + + + {% endfor %} - + +
PathTypeSize
+ {{ file.path }} +
+ {% if file.sha1 %} sha1:{{ file.sha1 }}
+ {% elif file.sha256 %}sha256:{{ file.sha256 }}
+ {% elif file.md5 %} md5:{{ file.md5 }}
+ {% endif %}
- - +
{% if file.mimetype %}{{ file.mimetype }}{% endif %}{{ file.size|filesizeformat }} + {% if fileset_vars.archiveorg_base %} + [archive.org]
+ {% endif %} + {% if fileset_vars.webarchiveorg_base %} + [web.archive.org]
+ {% endif %} + {% if file.extra and file.extra.original_url %} + [platform]
+ {% endif %} + {% if file.extra and file.extra.webarchive_url%} + [web.archive.org]
+ {% endif %} +
{% else %} -This File Set is empty (contains no files). +

This File Set is empty (contains no files). {% endif %} -- cgit v1.2.3 From 048985d59d3ee3e1b73df120cc6e39ae19360ed5 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 5 Apr 2022 12:03:17 -0700 Subject: web: fileset manifest table to front (z-index) and width --- python/fatcat_web/templates/fileset_view.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/fatcat_web') diff --git a/python/fatcat_web/templates/fileset_view.html b/python/fatcat_web/templates/fileset_view.html index e4d7b687..939925f6 100644 --- a/python/fatcat_web/templates/fileset_view.html +++ b/python/fatcat_web/templates/fileset_view.html @@ -49,7 +49,7 @@ No known public URL, mirror, or archive for this File Set.

File Manifest ({{ fileset.manifest|count }})

{% if fileset.manifest %} - +
-- cgit v1.2.3 From 67b71d583ea0c1e2c0cae859fbcce9bddf4df7bd Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 7 Apr 2022 14:18:02 -0700 Subject: web: fileset manifest table as 'single line' class, with scrolling overflow --- python/fatcat_web/templates/fileset_view.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'python/fatcat_web') diff --git a/python/fatcat_web/templates/fileset_view.html b/python/fatcat_web/templates/fileset_view.html index 939925f6..6f3f802e 100644 --- a/python/fatcat_web/templates/fileset_view.html +++ b/python/fatcat_web/templates/fileset_view.html @@ -49,7 +49,8 @@ No known public URL, mirror, or archive for this File Set.

File Manifest ({{ fileset.manifest|count }})

{% if fileset.manifest %} -
+
+
@@ -92,6 +93,7 @@ No known public URL, mirror, or archive for this File Set. {% endfor %}
+
{% else %}

This File Set is empty (contains no files). {% endif %} -- cgit v1.2.3 From 0aaa2a839d7a14716ee1a84b730203a7953dc5e0 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 7 Apr 2022 14:19:17 -0700 Subject: web: improve no-file release page behavior --- python/fatcat_web/templates/release_view.html | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'python/fatcat_web') diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html index f2e3f670..e21896ca 100644 --- a/python/fatcat_web/templates/release_view.html +++ b/python/fatcat_web/templates/release_view.html @@ -131,8 +131,9 @@ {% endif %} {% if entity.state == 'active' %} + +{% if entity.files != [] and entity.files != None %}

Archived Files and Locations

-{% if entity.files != [] %} {% for file in entity.files %} @@ -151,15 +152,9 @@ {% endfor %}
-{% else %} -

There are no accessible files associated with this release. You could check -other releases for this work for an -accessible version. -{% endif %} {% endif %} -{% if entity.state == 'active' %} -{% if entity.filesets != [] %} +{% if entity.filesets != [] and entity.filesets != None %}

File Sets

@@ -181,10 +176,8 @@ accessible version.
{% endif %} -{% endif %} -{% if entity.state == 'active' %} -{% if entity.webcaptures != [] %} +{% if entity.webcaptures != [] and entity.webcaptures != None %}

Web Captures

@@ -203,9 +196,17 @@ accessible version.
{% endif %} + +{% if not (entity.files or entity.filesets or entity.webcaptures) %} +

Archived Content

+

There are no accessible files associated with this release. You could check +other releases for this work for an +accessible version. +{% endif %} + {% endif %} -

+
-- cgit v1.2.3