From a24e3a67987e7a070eca562ce1cf30a59c206e06 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 31 Jan 2019 17:10:33 -0800 Subject: tweaks and fixes for new container extra schema --- python/fatcat_web/templates/container_view.html | 44 +++++++++++++++---------- python/fatcat_web/templates/release_view.html | 42 +++++++++++------------ 2 files changed, 48 insertions(+), 38 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 4a175a5d..ffe01185 100644 --- a/python/fatcat_web/templates/container_view.html +++ b/python/fatcat_web/templates/container_view.html @@ -15,14 +15,11 @@

Publisher: {% if container.publisher != None %}{{ container.publisher }}{% else %}Unknown{% endif %} -{% if (container.extra != None) and (container.extra['url'] != None) and (container.extra['url']|length > 0) %} -
Homepage:  {{ container.extra['url'] }} -{% endif %} -{% if container.wikidata_qid != None %} -
Wikidata Entity:  {{ container.wikidata_qid }} +{% if (container.extra != None) and (container.extra['urls'] != None) and (container.extra['urls']|length > 0) %} +
Homepage:  {{ container.extra['urls'][0] }} {% endif %} -{% if container.extra != None %} +{% if container.extra %}

Extra Metadata (raw JSON)

{% for (key, value) in container.extra.items() %} {{ key }}: {{ value }}
@@ -38,15 +35,16 @@ Raw Object:
-{% if container.extra.is_oa == True %} +{% if container.es and container.es.is_oa == True %} Open Access Publisher -{% elif container.extra.is_oa == False %} +{% elif container.es and container.es.is_oa == False %} Not Open Access {% else %} Unknown OA Status {% endif %}
+{% if container.issnl != None or container.wikidata_qid != None %} {% if container.issnl != None %} ISSN-L?  {{ container.issnl }} @@ -56,33 +54,45 @@ Raw Object: {% if container.extra != None and container.extra.ISSNe != None and (container.extra.ISSNe|length > 0) %}
Electronic:  {{ container.extra.ISSNe }} {% endif %} +{% endif %} +{% if container.wikidata_qid != None %} +
Wikidata:  {{ container.wikidata_qid }} +{% endif %}
{% endif %} +{% if (container.es and container.es != None) %} Directory Listings
-{% if (container.extra != None) %} - {% if container.extra.in_doaj == True %} + {% if container.es.in_doaj == True %} In DOAJ
- {% elif container.extra.in_doaj == False %} + {% elif container.es.in_doaj == False %} Not in DOAJ
{% endif %} - {% if container.extra.in_road == True %} + + {% if container.es.in_road == True %} In ISSN ROAD
- {% elif container.extra.in_road == False %} + {% elif container.es.in_road == False %} Not in ISSN ROAD
{% endif %} - {% if container.extra.is_kept == True %} + + {% if container.es.in_kbart == True %} In Keepers Registery
- {% elif container.extra.is_kept == False %} + {% elif container.es.in_kbart == False %} Not in Keepers Registry
{% endif %} -{% endif %} + + {% if container.extra and container.extra.sherpa_romeo and container.extra.sherpa_romeo.color %} + SHERPA/RoMEO color: {{ container.extra.sherpa_romeo.color }} + {% endif %}
+{% endif %} Lookup Links
SHERPA/RoMEO (access policies) -
wikidata.org +{% if not container.wikidata_qid %} +
wikidata.org +{% endif %}
Fatcat Bits diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html index c81bf478..3716f0cb 100644 --- a/python/fatcat_web/templates/release_view.html +++ b/python/fatcat_web/templates/release_view.html @@ -154,20 +154,20 @@ This release citing other releases. {% if ref.container_name %}{{ ref.container_name }}.{% endif %} {% if ref.year %}{{ ref.year }}{% endif %} {% if ref.locator %}{{ ref.locator }}{% endif %} - {% elif ref.extra %} + {% elif ref.extra != None %} {% if ref.extra.get('author') %}{{ ref.extra['author'] }}.{% endif %} {% if ref.extra.get('article-title') %}{{ ref.extra['article-title'] }}.{% endif %} {% if ref.container_name %}{{ ref.container_name }}.{% endif %} {% if ref.year %}{{ ref.year }}.{% endif %} - {% elif ref.extra and ref.extra.unstructured %} - {{ ref.extra.unstructured }} + {% if ref.extra.unstructured %}{{ ref.extra.unstructured }}{% endif %} {% else %} unknown {% endif %} {% if ref.target_release_id != None %} - (fatcat release) -{# {% elif ref.extra != None and ref.extra.doi != None %} - (DOI: {{ ref.extra.get('doi') }}) #} + (fatcat entry) + {% endif %} + {% if ref.extra != None and ref.extra.doi %} + (DOI: {{ ref.extra.doi }}) {% endif %} {% endfor %} @@ -186,13 +186,13 @@ This release citing other releases. {% if release.release_type != None %}
-Release Type {{ release.release_type }} +Release Type  {{ release.release_type }}
{% endif %} {% if release.doi %} {% endif %} {% if release.isbn13 != None %} @@ -210,37 +210,37 @@ This release citing other releases.
{% endif %} -{% if container != None %} +{% if container != None and container.es != None %}
Container Metadata
-{% if container.extra.is_oa == True %} +{% if container.es.is_oa == True %} Open Access Publication
-{% elif container.extra.is_oa == False %} +{% elif container.es.is_oa == False %} Not Open Access
{% else %} Unknown OA Status
{% endif %} -{% if (container.extra != None) %} - {% if container.extra.in_doaj == True %} +{% if (container.es != None) %} + {% if container.es.in_doaj == True %} In DOAJ
- {% elif container.extra.in_doaj == False %} + {% elif container.es.in_doaj == False %} Not in DOAJ
{% endif %} - {% if container.extra.in_road == True %} + {% if container.es.in_road == True %} In ISSN ROAD
- {% elif container.extra.in_road == False %} + {% elif container.es.in_road == False %} Not in ISSN ROAD
{% endif %} - {% if container.extra.is_kept == True %} + {% if container.es.in_kbart == True %} In Keepers Registery
- {% elif container.extra.is_kept == False %} + {% elif container.es.in_kbart == False %} Not in Keepers Registry
{% endif %} {% endif %} {% if container.issnl != None %} - ISSN-L:  {{ container.issnl }}
+ ISSN-L:  {{ container.issnl }}
{% endif %} - Fatcat:  {{ container.ident }}
+ Fatcat Entry
{% endif %} @@ -273,7 +273,7 @@ This release citing other releases. Fatcat Bits

State is "{{ release.state }}". Revision:
{{ release.revision }} -
As JSON object via API +
As JSON object via API

-- cgit v1.2.3