From fa1ad78cd0e00f524221f972889ee32373d7b94e Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 7 Feb 2022 19:51:56 -0800 Subject: container: scholars portal kbart link; unknown type display --- python/fatcat_web/templates/container_view.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'python/fatcat_web/templates/container_view.html') diff --git a/python/fatcat_web/templates/container_view.html b/python/fatcat_web/templates/container_view.html index c5f68367..d88b44ab 100644 --- a/python/fatcat_web/templates/container_view.html +++ b/python/fatcat_web/templates/container_view.html @@ -76,7 +76,7 @@ {% if type_row == "_unknown" %} - Unknown + unknown-type {% else %} {{ type_row }} {% endif %} @@ -158,6 +158,8 @@ HathiTrust: {% elif k == "portico" and container.issnl %} Portico: + {% elif k == "scholarsportal" and container.issnl %} + Scholars Portal: {% else %} {{ k }}: {% endif %} -- cgit v1.2.3 From 5bc77c47eed20676cd3db162c9675311f77c6cf9 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 9 Feb 2022 00:24:46 -0800 Subject: web: move search-in-container to dedicated tab --- python/fatcat_web/routes.py | 46 ++++++++++++++ python/fatcat_web/templates/container_view.html | 5 +- .../templates/container_view_search.html | 70 ++++++++++++++++++++++ python/fatcat_web/templates/entity_base.html | 1 + 4 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 python/fatcat_web/templates/container_view_search.html (limited to 'python/fatcat_web/templates/container_view.html') diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index 186166bd..b25cd37c 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -1079,6 +1079,52 @@ def coverage_search() -> AnyResponse: ) +@app.route("/container//search", methods=["GET", "POST"]) +def container_view_search(ident: str) -> AnyResponse: + entity = generic_get_entity("container", ident) + + if entity.state == "redirect": + return redirect(f"/container/{entity.redirect}") + elif entity.state == "deleted": + return render_template("deleted_entity.html", entity_type="container", entity=entity) + + if "q" not in request.args.keys(): + return render_template( + "container_view_search.html", + query=ReleaseQuery(), + found=None, + entity_type="container", + entity=entity, + editgroup_id=None, + ) + + query = ReleaseQuery.from_args(request.args) + query.container_id = ident + try: + found = do_release_search(query) + except FatcatSearchError as fse: + return ( + render_template( + "container_view_search.html", + query=query, + es_error=fse, + entity_type="container", + entity=entity, + editgroup_id=None, + ), + fse.status_code, + ) + + return render_template( + "container_view_search.html", + query=query, + found=found, + entity_type="container", + entity=entity, + editgroup_id=None, + ) + + def get_changelog_stats() -> Dict[str, Any]: stats = {} latest_changelog = api.get_changelog(limit=1)[0] diff --git a/python/fatcat_web/templates/container_view.html b/python/fatcat_web/templates/container_view.html index d88b44ab..abb31e06 100644 --- a/python/fatcat_web/templates/container_view.html +++ b/python/fatcat_web/templates/container_view.html @@ -24,12 +24,11 @@ {% endif %} {% if container.state == "active" %} -

Search Releases from this Container

-
+

Search Content

+
-
diff --git a/python/fatcat_web/templates/container_view_search.html b/python/fatcat_web/templates/container_view_search.html new file mode 100644 index 00000000..289c8dad --- /dev/null +++ b/python/fatcat_web/templates/container_view_search.html @@ -0,0 +1,70 @@ +{% set container = entity %} +{% set entity_view = "search" %} +{% set entity_type = "container" %} +{% import "entity_macros.html" as entity_macros %} +{% import "search_macros.html" as search_macros %} +{% extends "entity_base.html" %} + +{% block entity_main %} +
+ +
+

Search inside Container

+ +
+
+ + +
+
Can also search all releases. +
+ +
+ +
+{% if found %} + {% if found.results %} + + {{ search_macros.top_results(query, found) }} + + {% for paper in found.results %} + {{ entity_macros.release_search_result_row(paper) }} + {% endfor %} + + {% if found.results|length > 8 %} +
+
+ {{ search_macros.bottom_results(query, found, endpoint='release_search') }} +
+ {% endif %} + + {% else %} + + Raw query was: {{ query.q }} + +
+
+
+ confused paper man +
+
+

No results found!

+

You could try elsewhere:

+ +
+
+
+ + {% endif %} + +{% elif es_error %} + {{ search_macros.es_error_msg(es_error) }} +{% endif %} + +
+{% endblock %} + diff --git a/python/fatcat_web/templates/entity_base.html b/python/fatcat_web/templates/entity_base.html index c3d6096b..2782edd5 100644 --- a/python/fatcat_web/templates/entity_base.html +++ b/python/fatcat_web/templates/entity_base.html @@ -83,6 +83,7 @@ {{ entity_tab("overview", "Overview", "") }} {% if entity_type == "container" and entity.state == 'active' and not editgroup %} {{ entity_tab("coverage", "Preservation", "/coverage") }} + {{ entity_tab("search", "Search", "/search") }} {% elif entity_type == "release" and entity.state != 'deleted' %} {{ entity_tab("contribs", "Authors", "/contribs", entity._authors|count ) }} {% if entity.state == 'active' %} -- cgit v1.2.3 From 3375483dbfa09d3621d423a47d2fdf3193487ab4 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 15 Feb 2022 19:55:12 -0800 Subject: web: update container landing page --- python/fatcat_web/templates/container_view.html | 107 ++++++++++++++---------- python/fatcat_web/templates/entity_base.html | 4 + 2 files changed, 65 insertions(+), 46 deletions(-) (limited to 'python/fatcat_web/templates/container_view.html') diff --git a/python/fatcat_web/templates/container_view.html b/python/fatcat_web/templates/container_view.html index abb31e06..db458589 100644 --- a/python/fatcat_web/templates/container_view.html +++ b/python/fatcat_web/templates/container_view.html @@ -8,23 +8,13 @@
-{% if (container.extra != None) and (container.extra['urls'] != None) and (container.extra['urls']|length > 0) %} - -{% elif (container.extra != None) and (container.extra['webarchive_urls'] != None) and (container.extra['webarchive_urls']|length > 0) %} -{# fallback to a webarchive URL if no valid/live homepage URL #} - -{% endif %} -

-{% if container.publisher != None %} - Published by {{ container.publisher }} +{% if container.container_type %} + {% set pub_type_phrase = container.container_type %} +{% else %} + {% set pub_type_phrase = '"container" (a publication venue)' %} {% endif %} -{% if container.state == "active" %} -

Search Content

+{% if container.state == 'active' %}
@@ -35,14 +25,30 @@ {% endif %} +{% if (container.extra != None) and (container.extra['urls'] or container.extra['webarchive_urls']) %} +

Homepage URLs

+ + + {% for url in container.extra['urls'] or [] %} + + {% endfor %} + {% for url in container.extra['webarchive_urls'] or [] %} + + {% endfor %} + +
{{ url }}
{{ url }}
+{% endif %} + {% if container._random_releases %} -

Example Publications

+

Example Publications

{% for random_release in container._random_releases %} {{ entity_macros.release_search_result_row(random_release) }} {% endfor %} {% endif %}
+ +{# start right-hand entity column #}
{% if container._stats %} @@ -54,37 +60,45 @@
+{% endif %} {% if container._es and container._es.is_oa == True %}
Open Access Publication
+{% endif %} +{% if container._stats and container._stats.total >= 1 %} +
+ Preservation Summary [more]
+ {{ entity_macros.preservation_bar(container._stats.preservation) }} + {{ entity_macros.preservation_small_table(container._stats.preservation) }} +
{% endif %} -{% if container._stats.total >= 1 %} -
- Preservation Status
- {{ entity_macros.preservation_bar(container._stats.preservation) }} - {{ entity_macros.preservation_small_table(container._stats.preservation) }} -
-
- Work Types
- + +{% if container._stats and container._stats.total >= 1 %} +
+ Release Types
+ {% if container._stats.total >= 1 %} +
{% for type_row in container._stats.release_type %}
+ {% if type_row == "_unknown" %}unknown-type{% else %}{{ type_row }}{% endif %} + {% if type_row == "_unknown" %} - unknown-type + {% else %} - {{ type_row }} + {% endif %} - {{ "{:,}".format(container._stats.release_type[type_row]) }} + {{ "{:,}".format(container._stats.release_type[type_row]) }} + {% endfor %}
-
-{% endif %} + {% endif %} +
{% endif %} {% if container.container_type != None or container.publication_status != None %} @@ -95,6 +109,9 @@ {% if container.publication_status != None %} Publication Status  {{ container.publication_status or 'unknown' }}
{% endif %} + {% if container.extra and container.extra.country %} + Country Code  {{ container.extra.country }}
+ {% endif %} {% endif %} @@ -102,17 +119,22 @@
{% if container.issnl != None %} ISSN-L? -  {{ container.issnl }} +  {{ container.issnl }}
{% endif %} {% if container.issnp or (container.extra != None and container.extra.issnp != None and (container.extra.issnp|length > 0)) %} -
Print:  {{ container.issnp or container.extra.issnp }} +     Print:  {{ container.issnp or container.extra.issnp }}
{% endif %} {% if container.issne or (container.extra != None and container.extra.issne != None and (container.extra.issne|length > 0)) %} -
Electronic:  {{ container.issne or container.extra.issne }} +     Electronic:  {{ container.issne or container.extra.issne }}
{% endif %} -
{% if container.wikidata_qid != None %} - Wikidata  {{ container.wikidata_qid }} + Wikidata  {{ container.wikidata_qid }}
+ {% endif %} + {% if container.extra and container.extra.dblp %} + dblp  {{ container.extra.dblp.prefix }}
+ {% endif %} + {% if container.extra and container.extra.ia and container.extra.ia.sim %} + archive.org  sim_pubid:{{ container.extra.ia.sim.sim_pubid }}
{% endif %}
{% endif %} @@ -128,23 +150,15 @@ {% if container._es.in_road == True %} In ISSN ROAD
- {% elif container._es.in_road == False %} - Not in ISSN ROAD
- {% endif %} - - {% if container._es.any_kbart == True %} - In Keepers Registery -
- {% elif container._es.any_kbart == False %} - Not in Keepers Registry
{% endif %} - {% if container.extra and container.extra.sherpa_romeo and container.extra.sherpa_romeo.color %} - SHERPA/RoMEO color: {{ container.extra.sherpa_romeo.color }} + {% if container.extra and container.extra.szczepanski %} + In Szczepanski List
{% endif %} {% endif %} +{# {%- if container.extra and container.extra.kbart %}
Preservation Holdings
@@ -175,6 +189,7 @@ {% endfor %}
{% endif %} +#}
Lookup Links
diff --git a/python/fatcat_web/templates/entity_base.html b/python/fatcat_web/templates/entity_base.html index 633f3aee..626c102a 100644 --- a/python/fatcat_web/templates/entity_base.html +++ b/python/fatcat_web/templates/entity_base.html @@ -75,6 +75,10 @@ {% endif %}
{% endif %} + {% elif entity_type == "container" %} + {% if entity.publisher %} +

{{ entity.publisher }} + {% endif %} {% endif %}

-- cgit v1.2.3 From ae97f4d8d4446d32b07efba587b57b741a16cfec Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 15 Feb 2022 20:51:01 -0800 Subject: containers: update preservation page Mostly adding copy and a KBART holdings page. --- python/fatcat_web/templates/container_view.html | 33 ----- .../templates/container_view_coverage.html | 134 ++++++++++++++------- python/fatcat_web/templates/entity_macros.html | 15 ++- 3 files changed, 101 insertions(+), 81 deletions(-) (limited to 'python/fatcat_web/templates/container_view.html') diff --git a/python/fatcat_web/templates/container_view.html b/python/fatcat_web/templates/container_view.html index db458589..0432a12d 100644 --- a/python/fatcat_web/templates/container_view.html +++ b/python/fatcat_web/templates/container_view.html @@ -158,39 +158,6 @@
{% endif %} -{# -{%- if container.extra and container.extra.kbart %} -
-Preservation Holdings
- {% for k, v in container.extra.kbart.items() %} - {% if k == "lockss" %} - LOCKSS: - {% elif k == "clockss" %} - CLOCKSS: - {% elif k == "hathitrust" and container.issnl %} - HathiTrust: - {% elif k == "portico" and container.issnl %} - Portico: - {% elif k == "scholarsportal" and container.issnl %} - Scholars Portal: - {% else %} - {{ k }}: - {% endif %} - years - {% for span in v.year_spans %} - {% if span|length >= 2 -%} - {{ span[0] }}-{{ span[1] -}} - {% elif span|length == 1 -%} - {{ span[0] -}} - {% endif -%} - {{- ", " if not loop.last }} - {% endfor %} -
- {% endfor %} -
-{% endif %} -#} -
Lookup Links
diff --git a/python/fatcat_web/templates/container_view_coverage.html b/python/fatcat_web/templates/container_view_coverage.html index 3022c0d9..865723d5 100644 --- a/python/fatcat_web/templates/container_view_coverage.html +++ b/python/fatcat_web/templates/container_view_coverage.html @@ -6,35 +6,79 @@ {% block entity_main %} -
-
-
-
-
{{ "{:,}".format(container._stats.total) }}
-
Known Releases
-
- {% if container._stats.total >= 1 %} - {{ entity_macros.preservation_bar(container._stats.preservation, extra_class="large") }} - {{ entity_macros.preservation_table(container._stats.preservation) }} - {% endif %} -

- {% if container.extra and container.extra.kbart %} - There seem to be at least some "dark" preservation holdings in: - {% for k, v in container.extra.kbart.items() %} - {{ k }}{{ ", " if not loop.last }} - {% endfor %} - . - {% endif %} - {% if container.issnl %} - Our metadata may not be up to date, but you can verify preservation holdings in Keepers Registery (click "Archival Status"). - {% endif %} -

+
+
+

This page summarizes and visualizes the article-level (or output-level) preservation status for a single publication venue ({{ container.name }}). Fatcat is a preservation-oriented catalog, and metadata is aggregated from many sources. +

However, metadata quality and consistency is difficult at scale and there may be preservation coverage not recorded here, or in some rare cases we may have content incorrectly matched and marked as preserved. Please contact us or submit corrections directly if you find any mistakes or inaccuracies.

{% if container._stats.total >= 1 %} -

-

Preservation Coverage by Year

+
+

Overall Preservation Coverage

+ {{ entity_macros.preservation_bar(container._stats.preservation, extra_class="large") }} +
+
+ {{ entity_macros.preservation_table(container._stats.preservation) }} +
+
+{% endif %} + +
+

Known Holdings Elsewhere

+

This table is based on KBART reports from large, independent, long-term digital preservation projects. We use the start and stop years of fulltext coverage, then count individuals works as included or not on the basis of year alone (not considering volume or issue metadata). These are mostly "dark" archives, with no direct public access to holdings. +

The Keeper's Registry project, currently run by issn.org, is a more authoritative source for aggregated KBART reports, and includes more archives. + {% if container.issnl %} + You can double check the Keeper's entry for this ISSN on portal.issn.org; click through to the "Archival Status" link to see holdings information. + {% endif %} + + {% if container.extra and container.extra.kbart %} + + + + + + + + {% for k, v in container.extra.kbart.items() %} + + + +
ArchiveYear Span(s)
+ {% if k == "lockss" %} + LOCKSS + {% elif k == "clockss" %} + CLOCKSS + {% elif k == "hathitrust" and container.issnl %} + HathiTrust + {% elif k == "portico" and container.issnl %} + Portico + {% elif k == "scholarsportal" and container.issnl %} + Scholars Portal + {% else %} + {{ k }} + {% endif %} + + {% for span in v.year_spans %} + {% if span|length >= 2 -%} + {{ span[0] }} to {{ span[1] -}} + {% elif span|length == 1 -%} + {{ span[0] -}} + {% endif -%} +
+ {% endfor %} + {% if not v.year_spans %}-{% endif %} + {% endfor %} +
+ {% else %} +

No holdings at any other locations recorded. + {% endif %} +

+ +{% if container._stats.total >= 1 %} +
+

Preservation Coverage by Year

+
@@ -45,7 +89,9 @@


-

Preservation Coverage by Volume

+
+

Preservation Coverage by Volume Number

+
@@ -56,23 +102,25 @@


-

Preservation Coverage by Release Type

- - - - - - {% for type_row in container._type_preservation %} - - -
Release Type - Total Count - Coverage -
{{ type_row.release_type }} - {{ "{:,}".format(type_row.total) }} - {{ entity_macros.preservation_bar(type_row) }} - {% endfor %} -
+
+

Preservation Coverage by Release Type

+ + + + + + {% for type_row in container._type_preservation %} + + +
Release Type + Total Count + Coverage +
{{ type_row.release_type }} + {{ "{:,}".format(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 c510a8b9..5f8f6e0a 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -388,31 +388,36 @@ yellow {% set frac_dark = stats.dark/stats.total %} {% set frac_none = stats.none/stats.total %} - +
+
- {{ "{:,}".format(stats.bright) }} + {{ "{:,}".format(stats.bright) }} {{ (frac_bright*100)|round(2,method='ceil') }}% preserved and publicly accessible (bright)
- {{ "{:,}".format(stats.dark) }} + {{ "{:,}".format(stats.dark) }} {{ (frac_dark*100)|round(2,method='ceil') }}% preserved but not publicly accessible (dark) {% if stats.shadows_only %} {% set frac_shadows_only = stats.shadows_only/stats.total %}
- {{ "{:,}".format(stats.shadows_only) }} + {{ "{:,}".format(stats.shadows_only) }} {{ (frac_shadows_only*100)|round(2,method='ceil') }}% only independently preserved in "shadow" libraries {% endif %}
- {{ "{:,}".format(stats.none) }} + {{ "{:,}".format(stats.none) }} {{ (frac_none*100)|round(2,method='ceil') }}% no known independent preservation +
+ {{ "{:,}".format(stats.total) }} + + total
-- cgit v1.2.3