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/entity_macros.html | 89 ++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) (limited to 'python/fatcat_web/templates/entity_macros.html') 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