From f75190ab7979c411bc8d90fab13c931933f4595c Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 4 Sep 2019 13:24:44 -0700 Subject: finish container coverage page Also re-worked container view sidebar a bit more. --- python/fatcat_web/templates/container_view.html | 38 +++++--------- .../templates/container_view_coverage.html | 61 ++++++++++++++++++++-- python/fatcat_web/templates/entity_macros.html | 13 +++++ 3 files changed, 84 insertions(+), 28 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 87e70f2b..0efc18a0 100644 --- a/python/fatcat_web/templates/container_view.html +++ b/python/fatcat_web/templates/container_view.html @@ -3,18 +3,6 @@ {% import "entity_macros.html" as entity_macros %} {% extends "entity_base.html" %} -{% macro progress_color(frac) -%} -{% if frac >= 1 %} -green -{% elif frac > 0.95 %} -olive -{% elif frac < 0.5 %} -red -{% else %} -yellow -{% endif %} -{%- endmacro %} - {% block entity_main %}
@@ -69,7 +57,7 @@ yellow {% if container._stats %}
-
+
{{ "{:,}".format(container._stats.total) }}
Known Releases
@@ -80,26 +68,26 @@ yellow {% set frac_preserved = container._stats.is_preserved/container._stats.total %} {% set frac_web = container._stats.in_web/container._stats.total %} -
-
-
{{ "{:.1f}".format(frac_kbart*100) }}%
+
+
+
{{ (frac_web*100)|int }}%
- {{ "{:,}".format(container._stats.in_kbart ) }} preserved (dark) + {{ "{:,}".format(container._stats.in_web) }} preserved and available (bright) -
-
-
{{ "{:.1f}".format(frac_preserved*100) }}%
+
+
+
{{ (frac_preserved*100)|int }}%
- {{ "{:,}".format(container._stats.is_preserved) }} preserved or available + {{ "{:,}".format(container._stats.is_preserved) }} preserved at all (bright or dark) -
-
-
{{ "{:.1f}".format(frac_web*100) }}%
+
+
+
{{ (frac_kbart*100)|int }}%
- {{ "{:,}".format(container._stats.in_web) }} fulltext available to read + {{ "{:,}".format(container._stats.in_kbart ) }} preserved by Keeper (dark) {% endif %}
diff --git a/python/fatcat_web/templates/container_view_coverage.html b/python/fatcat_web/templates/container_view_coverage.html index eb9dba8a..db435181 100644 --- a/python/fatcat_web/templates/container_view_coverage.html +++ b/python/fatcat_web/templates/container_view_coverage.html @@ -6,10 +6,65 @@ {% block entity_main %} -

Preservation Coverage By Year

+
+
+
+
+
{{ "{:,}".format(container._stats.total) }}
+
Known Releases
+
+ {% if container._stats.total >= 1 %} - -
Download as JSON + {% 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) +
+
+ + {% endif %} +
+
+
+ +{% if container._stats.total >= 1 %} +
+

Perpetual Access Coverage by Year

+ +
+ +
+ + +{% endif %} {% endblock %} diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 6124630c..fc199c21 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -221,3 +221,16 @@ {% endif %}
{% endmacro %} + +{% macro progress_color(frac) -%} +{% if frac >= 1 %} +green +{% elif frac > 0.95 %} +olive +{% elif frac < 0.5 %} +red +{% else %} +yellow +{% endif %} +{%- endmacro %} + -- cgit v1.2.3