From 404f6ff6d542dc6dc61395cdb25646e3a69eb061 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 13 Jun 2019 14:24:16 -0700 Subject: implement major refactor for other entity types --- python/fatcat_web/templates/release_view.html | 80 ++++++++++++++------------- 1 file changed, 42 insertions(+), 38 deletions(-) (limited to 'python/fatcat_web/templates/release_view.html') diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html index a5977166..5fdc2244 100644 --- a/python/fatcat_web/templates/release_view.html +++ b/python/fatcat_web/templates/release_view.html @@ -1,4 +1,4 @@ -{% set entity = release %} +{% set release = entity %} {% import "entity_macros.html" as entity_macros %} {% extends "base.html" %} @@ -19,7 +19,7 @@ {% endif %} - {% for author in authors %} + {% for author in release._authors %} {% endfor %} @@ -89,15 +89,16 @@

- {% if authors != [] %} by {% endif %} - {% for contrib in authors[:12] %} + {% if release._authors != [] %} by {% endif %} + {% for contrib in release._authors[:12] %} {% if contrib.creator_id %} {{ contrib.raw_name }}{% if not loop.last %}, {% endif %} {% else %} {% if contrib.raw_name != None %}{{ contrib.raw_name }}{% else %}Unknown{% endif %}{% if not loop.last %}, {% endif %} {% endif %} {% endfor %} - {% if authors|count > 12 %} (+{{ authors|length - 12 }} others) + {% if release._authors|count > 12 %} + (+{{ release._authors|length - 12 }} others) {% endif %} @@ -109,10 +110,10 @@

{% if release.release_stage == 'published' %} - Published in {{ container.name }} + Published in {{ release.container.name }} {% else %} Released as a {{ release.release_type }} - {% if container %} in {{ container.name }} {% endif %} + {% if release.container %} in {{ release.container.name }} {% endif %} {% endif %} {% if release.publisher %} by {{ release.publisher }} @@ -128,9 +129,9 @@ Version {{ release.version }} {% endif %} - {% if container != None and container.issnl != None %} + {% if release.container != None and release.container.issnl != None %} ISSN-L - {{ container.issnl }} + {{ release.container.issnl }} {% endif %} {% if release.volume != None %} @@ -154,9 +155,9 @@ Release Year {{ release.release_year }} {% endif %} - {% if container != None and container.container_type != None %} + {% if release.container != None and release.container.container_type != None %} Container Type - {{ container.container_type }} + {{ release.container.container_type }} {% endif %} {% if release.publisher != None %} Publisher @@ -215,7 +216,7 @@ {{ entity_macros.extra_metadata(entity.extra) }} {% endif %} - +{% if entity.status == 'active' %}

Known Files and URLs

{% if entity.files != [] %} @@ -251,14 +252,15 @@

There are no known files associated with this release (you could try other releases for this work?). {% endif %} +{% endif %} - +{% if entity.status == 'active' %} {% if entity.filesets != [] %}

File Sets

{% for fileset in entity.filesets %} -
{{ fileset.manifest|count }} files  {{ fileset.total_size|filesizeformat }} +
{{ fileset.manifest|count }} files  {{ fileset._total_size|filesizeformat }}
fileset:{{ fileset.ident }}
{% for url in fileset.urls[:5] %} @@ -275,8 +277,9 @@
{% endif %} +{% endif %} - +{% if entity.status == 'active' %} {% if entity.webcaptures != [] %}

Web Captures

@@ -287,7 +290,7 @@
webcapture:{{ webcapture.ident }}
{% for url in webcapture.archive_urls[:5] %} - {{ url.url.split('/')[2] }} ({{ url.rel }})
+ {{ url.url.split('/')[2] }} ({{ url.rel }})
{% endfor %} {% if webcapture.urls|length > 5 %} + {{ file.urls|length - 5 }} more URLs @@ -296,6 +299,7 @@
{% endif %} +{% endif %} {% if release.refs != None and release.refs.size != 0 %} @@ -335,10 +339,10 @@
-{% if entity.files != [] and entity.files[0].urls != [] %} +{% if entity.status == 'active' and entity.files != [] and entity.files[0].urls != [] %} Download Full Text -{% elif entity.webcaptures != [] and entity.webcaptures[0].archive_urls != [] and entity.webcaptures[0].archive_urls[0].rel == "wayback" %} -View Web Archive +{% elif entity.status == 'active' and entity.webcaptures != [] and entity.webcaptures[0].archive_urls != [] and entity.webcaptures[0].archive_urls[0].rel == "wayback" %} +View Web Archive {% else %} No Full Text Available {% endif %} @@ -401,36 +405,36 @@
{% endif %} -{% if container != None and container.es %} +{% if release.container != None and release.container._es %}
Container Metadata
-{% if container.es.is_oa == True %} +{% if release.container._es.is_oa == True %} Open Access Publication
-{% elif container.es.is_oa == False %} +{% elif release.container._es.is_oa == False %} Not Open Access
{% else %} Unknown OA Status
{% endif %} -{% if (container.es != None) %} - {% if container.es.in_doaj == True %} - In DOAJ
- {% elif container.es.in_doaj == False %} +{% if (release.container._es != None) %} + {% if release.container._es.in_doaj == True %} + In DOAJ
+ {% elif release.container._es.in_doaj == False %} Not in DOAJ
{% endif %} - {% if container.es.in_road == True %} - In ISSN ROAD
- {% elif container.es.in_road == False %} + {% if release.container._es.in_road == True %} + In ISSN ROAD
+ {% elif release.container._es.in_road == False %} Not in ISSN ROAD
{% endif %} - {% if container.es.in_kbart == True %} - In Keepers Registery
- {% elif container.es.in_kbart == False %} Not in Keepers Registry
+ {% if release.container._es.in_kbart == True %} + In Keepers Registery
+ {% elif release.container._es.in_kbart == False %} Not in Keepers Registry
{% endif %} {% endif %} -{% if container.issnl != None %} - ISSN-L:  {{ container.issnl }}
+{% if release.container.issnl != None %} + ISSN-L:  {{ release.container.issnl }}
{% endif %} - Fatcat Entry + Fatcat Entry
{% endif %} @@ -457,8 +461,8 @@
Lookup Links
- {% if container != None and container.issnl != None %} - SHERPA/RoMEO (journal policies)
+ {% if release.container != None and release.container.issnl != None %} + SHERPA/RoMEO (journal policies)
{% endif %} {% if release != None and release.ext_ids.doi != None %} oaDOI/unpaywall
@@ -479,7 +483,7 @@
-{{ entity_macros.fatcat_bits(entity, "release", "container,files,filesets,webcaptures") }} +{{ entity_macros.fatcat_bits(entity, "release", "container,files,filesets,webcaptures", editgroup) }}
-- cgit v1.2.3