From 743940ce6075c1a1b547915a33ad8874094ae762 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Thu, 6 Jun 2019 00:17:16 -0700 Subject: experiment with entity view tabs --- python/fatcat_web/templates/release_view.html | 134 +++++++++----------------- 1 file changed, 45 insertions(+), 89 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 5fdc2244..a5fb0962 100644 --- a/python/fatcat_web/templates/release_view.html +++ b/python/fatcat_web/templates/release_view.html @@ -1,6 +1,7 @@ -{% set release = entity %} +{% set entity = release %} +{% set entity_view = "overview" %} {% import "entity_macros.html" as entity_macros %} -{% extends "base.html" %} +{% extends "entity_base.html" %} {# HTML metadata embeddings #} {% if release and release.status == "active" %} @@ -19,7 +20,7 @@ {% endif %} - {% for author in release._authors %} + {% for author in authors %} {% endfor %} @@ -89,16 +90,15 @@

- {% if release._authors != [] %} by {% endif %} - {% for contrib in release._authors[:12] %} + {% 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 release._authors|count > 12 %} - (+{{ release._authors|length - 12 }} others) + {% if authors|count > 12 %} (+{{ authors|length - 12 }} others) {% endif %} @@ -107,13 +107,19 @@

+{% if release.abstracts != [] %} +

Abstract

+

{{ release.abstracts[0].content }} +
In {{ release.abstracts[0].mimetype }} format +{% endif %} +

{% if release.release_stage == 'published' %} - Published in {{ release.container.name }} + Published in {{ container.name }} {% else %} Released as a {{ release.release_type }} - {% if release.container %} in {{ release.container.name }} {% endif %} + {% if container %} in {{ container.name }} {% endif %} {% endif %} {% if release.publisher %} by {{ release.publisher }} @@ -129,9 +135,9 @@ Version {{ release.version }} {% endif %} - {% if release.container != None and release.container.issnl != None %} + {% if container != None and container.issnl != None %} ISSN-L - {{ release.container.issnl }} + {{ container.issnl }} {% endif %} {% if release.volume != None %} @@ -155,9 +161,9 @@ Release Year {{ release.release_year }} {% endif %} - {% if release.container != None and release.container.container_type != None %} + {% if container != None and container.container_type != None %} Container Type - {{ release.container.container_type }} + {{ container.container_type }} {% endif %} {% if release.publisher != None %} Publisher @@ -204,19 +210,6 @@

No known contributors (authors, translators, etc). {% endif %} -{% if release.abstracts != [] %} -

Abstract

-

{{ release.abstracts[0].content }} -
In {{ release.abstracts[0].mimetype }} format -{% endif %} - - -{% if entity.extra %} -

Extra Metadata (raw JSON)

- {{ entity_macros.extra_metadata(entity.extra) }} -{% endif %} - -{% if entity.status == 'active' %}

Known Files and URLs

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

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] %} @@ -277,9 +269,8 @@
{% endif %} -{% endif %} -{% if entity.status == 'active' %} + {% if entity.webcaptures != [] %}

Web Captures

@@ -290,7 +281,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 @@ -299,50 +290,15 @@
{% endif %} -{% endif %} - -{% if release.refs != None and release.refs.size != 0 %} -

References

-This release citing other releases -{# see https://github.com/Semantic-Org/Semantic-UI/issues/2639 #} -
    - {% for ref in release.refs %} -
  1. - {% if ref.title %} - {{ ref.title }} - {% if ref.container_name %}{{ ref.container_name }}.{% endif %} - {% if ref.year %}{{ ref.year }}{% endif %} - {% if ref.locator %}{{ ref.locator }}{% endif %} - {% 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 %} - {% if ref.extra.unstructured %}{{ ref.extra.unstructured }}{% endif %} - {% else %} - unknown - {% endif %} - {% if ref.target_release_id != None %} - (fatcat entry) - {% endif %} - {% if ref.extra != None and ref.extra.doi %} - (DOI: {{ ref.extra.doi }}) - {% endif %} -
  2. - {% endfor %} -
-{% else %} -

No reference list available. -{% endif %}

-{% if entity.status == 'active' and entity.files != [] and entity.files[0].urls != [] %} +{% if entity.files != [] and entity.files[0].urls != [] %} Download Full Text -{% 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 +{% elif 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 %} @@ -405,36 +361,36 @@
{% endif %} -{% if release.container != None and release.container._es %} +{% if container != None and container.es %}
Container Metadata
-{% if release.container._es.is_oa == True %} +{% if container.es.is_oa == True %} Open Access Publication
-{% elif release.container._es.is_oa == False %} +{% elif container.es.is_oa == False %} Not Open Access
{% else %} Unknown OA Status
{% endif %} -{% if (release.container._es != None) %} - {% if release.container._es.in_doaj == True %} - In DOAJ
- {% elif release.container._es.in_doaj == False %} +{% if (container.es != None) %} + {% if container.es.in_doaj == True %} + In DOAJ
+ {% elif container.es.in_doaj == False %} Not in DOAJ
{% endif %} - {% if release.container._es.in_road == True %} - In ISSN ROAD
- {% elif release.container._es.in_road == False %} + {% if container.es.in_road == True %} + In ISSN ROAD
+ {% elif container.es.in_road == False %} Not in ISSN ROAD
{% endif %} - {% if release.container._es.in_kbart == True %} - In Keepers Registery
- {% elif release.container._es.in_kbart == False %} Not in Keepers Registry
+ {% if container.es.in_kbart == True %} + In Keepers Registery
+ {% elif container.es.in_kbart == False %} Not in Keepers Registry
{% endif %} {% endif %} -{% if release.container.issnl != None %} - ISSN-L:  {{ release.container.issnl }}
+{% if container.issnl != None %} + ISSN-L:  {{ container.issnl }}
{% endif %} - Fatcat Entry + Fatcat Entry
{% endif %} @@ -461,8 +417,8 @@
Lookup Links
- {% if release.container != None and release.container.issnl != None %} - SHERPA/RoMEO (journal policies)
+ {% if container != None and container.issnl != None %} + SHERPA/RoMEO (journal policies)
{% endif %} {% if release != None and release.ext_ids.doi != None %} oaDOI/unpaywall
@@ -483,7 +439,7 @@
-{{ entity_macros.fatcat_bits(entity, "release", "container,files,filesets,webcaptures", editgroup) }} +{{ entity_macros.fatcat_bits(entity, "release", "container,files,filesets,webcaptures") }}
-- cgit v1.2.3