From 430d0a11c7470dc9a53df5db208de701b9f82110 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 26 Mar 2020 17:30:56 -0700 Subject: web: copy extra.subtitle to subtitle for release view The release view will display subtitles, but it needs to be in the correct "location". --- python/fatcat_web/entity_helpers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/fatcat_web/entity_helpers.py b/python/fatcat_web/entity_helpers.py index 591dda80..6dfac3df 100644 --- a/python/fatcat_web/entity_helpers.py +++ b/python/fatcat_web/entity_helpers.py @@ -72,6 +72,10 @@ def enrich_release_entity(entity): # November 1. if ref.extra and ref.extra.get('unstructured'): ref.extra['unstructured'] = strip_extlink_xml(ref.extra['unstructured']) + # for backwards compatability, copy extra['subtitle'] to subtitle + if not entity.subtitle and entity.extra and entity.extra.get('subtitle'): + if type(entity.extra['subtitle']) == str: + entity.subtitle = entity.extra['subtitle'] # author list to display; ensure it's sorted by index (any othors with # index=None go to end of list) authors = [c for c in entity.contribs if c.role in ('author', None)] -- cgit v1.2.3 From 91c6e7e638a0059549c0af638995e90fad81a2ed Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 26 Mar 2020 17:33:01 -0700 Subject: web: display container original titles --- python/fatcat_web/templates/entity_base.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/fatcat_web/templates/entity_base.html b/python/fatcat_web/templates/entity_base.html index 437bc071..189d52b0 100644 --- a/python/fatcat_web/templates/entity_base.html +++ b/python/fatcat_web/templates/entity_base.html @@ -26,6 +26,9 @@

{% if entity_type == "container" %} {{ entity.name }} + {% if entity.extra.original_title %} +
{{ entity.extra.original_title }} + {% endif %} {% elif entity_type == "creator" %} {{ entity.display_name }} {% elif entity_type == "file" %} -- cgit v1.2.3 From 49891b9b306fcab27b0e55c1979269aa88580323 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sat, 28 Mar 2020 22:19:50 -0700 Subject: web: use more idiomatic type check Thanks to Martin for suggestion --- python/fatcat_web/entity_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/fatcat_web/entity_helpers.py b/python/fatcat_web/entity_helpers.py index 6dfac3df..7a9830f9 100644 --- a/python/fatcat_web/entity_helpers.py +++ b/python/fatcat_web/entity_helpers.py @@ -74,7 +74,7 @@ def enrich_release_entity(entity): ref.extra['unstructured'] = strip_extlink_xml(ref.extra['unstructured']) # for backwards compatability, copy extra['subtitle'] to subtitle if not entity.subtitle and entity.extra and entity.extra.get('subtitle'): - if type(entity.extra['subtitle']) == str: + if isinstance(entity.extra['subtitle'], str): entity.subtitle = entity.extra['subtitle'] # author list to display; ensure it's sorted by index (any othors with # index=None go to end of list) -- cgit v1.2.3