From 6d79479347752e450e9a8eeb4fbac84691044c67 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 7 Jul 2020 17:10:38 -0700 Subject: update container view stats - show release type counts - new-style preservation status (single bar) - show release_type preservation break down on coverage page --- python/fatcat_web/templates/container_view.html | 50 ++++++------ .../templates/container_view_coverage.html | 89 +++++++++------------- python/fatcat_web/templates/entity_macros.html | 89 ++++++++++++++++++++++ 3 files changed, 148 insertions(+), 80 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/container_view.html b/python/fatcat_web/templates/container_view.html index cf444956..785ad1ee 100644 --- a/python/fatcat_web/templates/container_view.html +++ b/python/fatcat_web/templates/container_view.html @@ -64,35 +64,33 @@
Known Releases
+ +
+ Preservation Status
{% if container._stats.total >= 1 %} - - {% set frac_kbart = container._stats.in_kbart/container._stats.total %} - {% set frac_preserved = container._stats.is_preserved/container._stats.total %} - {% set frac_web = container._stats.in_web/container._stats.total %} - -
-
-
{{ (frac_web*100)|int }}%
-
-
- {{ "{:,}".format(container._stats.in_web) }} preserved and available (bright) - -
-
-
{{ (frac_preserved*100)|int }}%
-
-
- {{ "{:,}".format(container._stats.is_preserved) }} preserved at all (bright or dark) - -
-
-
{{ (frac_kbart*100)|int }}%
-
-
- {{ "{:,}".format(container._stats.in_kbart ) }} preserved by Keeper (dark) - + {{ entity_macros.preservation_bar(container._stats.preservation) }} + {{ entity_macros.preservation_small_table(container._stats.preservation) }} {% endif %}
+{% if container._stats.total >= 1 %} +{% endif %} +
+ Work Types
+ + + {% for type_row in container._stats.release_type %} + + +
+ {% if type_row == "_unknown" %} + Unknown + {% else %} + {{ type_row }} + {% endif %} + {{ container._stats.release_type[type_row] }} + {% endfor %} +
+
{% endif %} {% if container.issnl != None or container.wikidata_qid != None %} diff --git a/python/fatcat_web/templates/container_view_coverage.html b/python/fatcat_web/templates/container_view_coverage.html index fc643f81..fd173cd4 100644 --- a/python/fatcat_web/templates/container_view_coverage.html +++ b/python/fatcat_web/templates/container_view_coverage.html @@ -14,73 +14,54 @@
Known Releases
{% if container._stats.total >= 1 %} - - {% set frac_kbart = container._stats.in_kbart/container._stats.total %} - {% set frac_preserved = container._stats.is_preserved/container._stats.total %} - {% set frac_web = container._stats.in_web/container._stats.total %} - - {% set pstats = container._stats.preservation %} - {% set frac_bright = container._stats.preservation.bright/container._stats.total %} - {% set frac_dark = container._stats.preservation.dark/container._stats.total %} - {% set frac_shadows_only = container._stats.preservation.shadows_only/container._stats.total %} - {% set frac_none = container._stats.preservation.none/container._stats.total %} - -
-
-
{# {{ (frac_bright*100)|int }}% #}
-
-
-
{# {{ (frac_dark*100)|int }}% #}
-
-
-
{# {{ (frac_shadows_only*100)|int }}% #}
-
-
-
{# {{ (frac_none*100)|int }}% #}
-
-
- - - - - - - -
- {{ "{:,}".format(pstats.bright) }} - {{ (frac_bright*100)|round(2,method='ceil') }}% - preserved and publicly available (bright) -
- {{ "{:,}".format(pstats.dark) }} - {{ (frac_dark*100)|round(2,method='ceil') }}% - preserved but not publicly accessible (dark) -
- {{ "{:,}".format(pstats.shadows_only) }} - {{ (frac_shadows_only*100)|round(2,method='ceil') }}% - only independently preserved in "shadow" libraries -
- {{ "{:,}".format(pstats.none) }} - {{ (frac_none*100)|round(2,method='ceil') }}% - no known independent preservation -
- + {{ entity_macros.preservation_bar(container._stats.preservation, extra_class="large") }} + {{ entity_macros.preservation_table(container._stats.preservation) }} {% endif %} {% if container._stats.total >= 1 %} -
-
+

Perpetual Access Coverage by Year

- + +
+ +
+ Download as JSON +
+ +

+

Perpetual Access Coverage by Volume

+ +
+
- Download as JSON + Download as JSON
+ +

+

Perpetual Access Coverage by Release Type

+ + + + + + {% for type_row in container._type_preservation %} + + +
Release Type + Total Count + Coverage +
{{ type_row.release_type }} + {{ type_row.total }} + {{ entity_macros.preservation_bar(type_row) }} + {% endfor %} +
{% endif %} {% endblock %} diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 8e4c4f6a..c3ae099a 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -260,3 +260,92 @@ yellow {% endif %} {%- endmacro %} + +{% macro preservation_bar(stats, extra_class="") -%} + + {% set frac_bright = stats.bright/stats.total %} + {% set frac_dark = stats.dark/stats.total %} + {% set frac_shadows_only = stats.shadows_only/stats.total %} + {% set frac_none = stats.none/stats.total %} + +
+
+
{# {{ (frac_bright*100)|int }}% #}
+
+
+
{# {{ (frac_dark*100)|int }}% #}
+
+
+
{# {{ (frac_shadows_only*100)|int }}% #}
+
+
+
{# {{ (frac_none*100)|int }}% #}
+
+
+ + +{%- endmacro %} + +{% macro preservation_table(stats) -%} + + {% set frac_bright = stats.bright/stats.total %} + {% set frac_dark = stats.dark/stats.total %} + {% set frac_shadows_only = stats.shadows_only/stats.total %} + {% set frac_none = stats.none/stats.total %} + + + + + + + + +
+ {{ "{:,}".format(stats.bright) }} + {{ (frac_bright*100)|round(2,method='ceil') }}% + preserved and publicly available (bright) +
+ {{ "{:,}".format(stats.dark) }} + {{ (frac_dark*100)|round(2,method='ceil') }}% + preserved but not publicly accessible (dark) +
+ {{ "{:,}".format(stats.shadows_only) }} + {{ (frac_shadows_only*100)|round(2,method='ceil') }}% + only independently preserved in "shadow" libraries +
+ {{ "{:,}".format(stats.none) }} + {{ (frac_none*100)|round(2,method='ceil') }}% + no known independent preservation +
+ +{%- endmacro %} + +{% macro preservation_small_table(stats) -%} + + {% set frac_bright = stats.bright/stats.total %} + {% set frac_dark = stats.dark/stats.total %} + {% set frac_shadows_only = stats.shadows_only/stats.total %} + {% set frac_none = stats.none/stats.total %} + + + + + + + + +
+ {{ "{:,}".format(stats.bright) }} + preserved and accessble (bright) +
+ {{ "{:,}".format(stats.dark) }} + preserved, inaccessible (dark) +
+ {{ "{:,}".format(stats.shadows_only) }} + shadow library only +
+ {{ "{:,}".format(stats.none) }} + no known preservation +
+ +{%- endmacro %} -- cgit v1.2.3