From 9cca4e5494235029656757a3dcc066068da190e6 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 17 Sep 2020 19:25:20 -0700 Subject: coverage: clarify available/accessible terminology --- python/fatcat_web/templates/entity_macros.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 0ce646bf..d5ecd9b6 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -302,7 +302,7 @@ yellow {{ "{:,}".format(stats.bright) }} {{ (frac_bright*100)|round(2,method='ceil') }}% - preserved and publicly available (bright) + preserved and publicly accessible (bright) {{ "{:,}".format(stats.dark) }} -- cgit v1.2.3 From 4365f7d61b8458c06102e4cb58fd373bbada872a Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 17 Sep 2020 19:31:12 -0700 Subject: coverage search: pretty display for ES query errors --- python/fatcat_web/routes.py | 13 ++++++++++++- python/fatcat_web/templates/coverage_search.html | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index 9ae2eaa9..4dfbc29c 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -745,7 +745,18 @@ def coverage_search(): ) query = ReleaseQuery.from_args(request.args) - coverage_stats = get_elastic_search_coverage(query) + try: + coverage_stats = get_elastic_search_coverage(query) + except FatcatSearchError as fse: + return render_template( + 'coverage_search.html', + query=query, + coverage_stats=None, + coverage_type_preservation=None, + year_histogram_svg=None, + date_histogram_svg=None, + es_error=fse, + ), fse.status_code year_histogram_svg = None date_histogram_svg = None coverage_type_preservation = None diff --git a/python/fatcat_web/templates/coverage_search.html b/python/fatcat_web/templates/coverage_search.html index 1e0f8327..b1db6a9a 100644 --- a/python/fatcat_web/templates/coverage_search.html +++ b/python/fatcat_web/templates/coverage_search.html @@ -1,4 +1,5 @@ {% import "entity_macros.html" as entity_macros %} +{% import "search_macros.html" as search_macros %} {% extends "base.html" %} {% block title %} @@ -32,6 +33,12 @@
+{% if es_error %} +
+ {{ search_macros.es_error_msg(es_error) }} +
+{% endif %} + {% if coverage_stats != None %}
-- cgit v1.2.3 From 078495ade3eb095d2f2ff5fb5dbd049c39ad9bfe Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 17 Sep 2020 19:40:09 -0700 Subject: web container view: hide preservation when no releases --- python/fatcat_web/templates/container_view.html | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 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 8b4ddeb9..9a71fe72 100644 --- a/python/fatcat_web/templates/container_view.html +++ b/python/fatcat_web/templates/container_view.html @@ -65,15 +65,12 @@
-
- Preservation Status
- {% if container._stats.total >= 1 %} - {{ entity_macros.preservation_bar(container._stats.preservation) }} - {{ entity_macros.preservation_small_table(container._stats.preservation) }} - {% endif %} -
{% if container._stats.total >= 1 %} -{% endif %} +
+ Preservation Status
+ {{ entity_macros.preservation_bar(container._stats.preservation) }} + {{ entity_macros.preservation_small_table(container._stats.preservation) }} +
Work Types
@@ -92,6 +89,7 @@
{% endif %} +{% endif %} {% if container.issnl != None or container.wikidata_qid != None %}
-- cgit v1.2.3 From 257f5b55e6d35893dfdf8c5306842db5bb076f3e Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 17 Sep 2020 19:41:52 -0700 Subject: container view: only show OA indicator when known The "is_oa:False" could be that we just don't know; aren't actually distinguishing between false and blank. --- python/fatcat_web/templates/container_view.html | 6 +----- 1 file changed, 1 insertion(+), 5 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 9a71fe72..91430715 100644 --- a/python/fatcat_web/templates/container_view.html +++ b/python/fatcat_web/templates/container_view.html @@ -48,11 +48,7 @@
{% if container._es and container._es.is_oa == True %} - Open Access Publisher - {% elif container._es and container._es.is_oa == False %} - Not Open Access - {% else %} - Unknown OA Status + Open Access Publication {% endif %}
-- cgit v1.2.3 From 8187720f503967ad68ab07fb25b36f554663e1c3 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 17 Sep 2020 20:56:23 -0700 Subject: web: update sub-resource integrity and pre-loading For security/integrity and performance --- python/fatcat_web/templates/base.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/base.html b/python/fatcat_web/templates/base.html index 2c18ec44..b858728d 100644 --- a/python/fatcat_web/templates/base.html +++ b/python/fatcat_web/templates/base.html @@ -17,7 +17,18 @@ + + + +