From f1abe85e8c35a23122f65b47dd55d8135239cf93 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 13 Jun 2019 16:05:58 -0700 Subject: fixes after rebase --- python/fatcat_web/templates/release_view.html | 179 ++++++-------------------- 1 file changed, 38 insertions(+), 141 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 b5bba7b3..2212741a 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 %} {% set entity_view = "overview" %} {% import "entity_macros.html" as entity_macros %} {% extends "entity_base.html" %} @@ -20,7 +20,7 @@ {% endif %} - {% for author in authors %} + {% for author in release._authors %} {% endfor %} @@ -75,33 +75,7 @@ {% block main_extra_attr %}itemscope itemtype="http://schema.org/ScholarlyArticle" itemid="#release"{% endblock %} -{% block fullbody %} - -
-
-
-

- {{ release.title }} - {% if release.subtitle %} -
{{ release.subtitle }} - {% endif %} - - release {{ release.ident }} - -

-

- {% if authors != [] %} by {% endif %} - {% for contrib in 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) - {% endif %} -

-
+{% block entity_main %}
@@ -115,10 +89,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 }} @@ -134,9 +108,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 %} @@ -160,9 +134,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 @@ -179,6 +153,7 @@
+{% if entity.state == 'active' %}

Known Files and URLs

{% if entity.files != [] %} @@ -214,95 +189,15 @@

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

File Sets

-
- - {% for fileset in entity.filesets %} - -
{{ fileset.manifest|count }} files  {{ fileset.total_size|filesizeformat }} -
fileset:{{ fileset.ident }} -
- {% for url in fileset.urls[:5] %} - {% if url.rel == "dweb" %} - {{ url.url }} ({{ url.rel }})
- {% else %} - {{ url.url.split('/')[2] }} ({{ url.rel }})
- {% endif %} - {% endfor %} - {% if fileset.urls|length > 5 %} - + {{ file.urls|length - 5 }} more URLs - {% endif %} - {% endfor %} -
-{% endif %} - - -{% if entity.webcaptures != [] %} -

Web Captures

- - - {% for webcapture in entity.webcaptures %} - -
{{ webcapture.original_url }} -
{{ webcapture.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} | {{ webcapture.cdx|count }} resources -
webcapture:{{ webcapture.ident }} -
- {% for url in webcapture.archive_urls[:5] %} - {{ url.url.split('/')[2] }} ({{ url.rel }})
- {% endfor %} - {% if webcapture.urls|length > 5 %} - + {{ file.urls|length - 5 }} more URLs - {% endif %} - {% endfor %} -
-{% endif %} - -

Known Files and URLs

-{% if entity.files != [] %} - - - - {% for file in entity.files %} - -
{% if file.mimetype != None %}{{ file.mimetype }}  {% endif %} - {% if file.size != None %}{{ file.size|filesizeformat }}{% endif %} -
- {% if file.sha1 != None %}sha1:{{ file.sha1[:20] + "..." }} - {% elif file.sha256!= None %}sha256:{{ file.md5[:20] + "..." }} - {% elif file.md5 != None %}md5:{{ file.md5[:20] + "..." }} - {% endif %} - -
- {% for url in file.urls[:5] %} - {{ url.url.split('/')[2] }} ({{ url.rel }})
- {% endfor %} - {% if file.urls|length > 5 %} - + {{ file.urls|length - 5 }} more URLs - {% endif %} - {% endfor %} -
-{% else %} -

There are no known files associated with this release (you could try -other releases for this work?). {% endif %} - +{% if entity.state == '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] %} @@ -319,8 +214,9 @@
{% endif %} +{% endif %} - +{% if entity.state == 'active' %} {% if entity.webcaptures != [] %}

Web Captures

@@ -331,7 +227,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 @@ -340,15 +236,16 @@
{% endif %} +{% endif %}
-{% if entity.files != [] and entity.files[0].urls != [] %} +{% if entity.state == '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.state == '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 %} @@ -411,36 +308,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 %} @@ -467,8 +364,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
@@ -489,7 +386,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