diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-03-01 15:48:10 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-03-01 15:48:10 -0800 |
commit | ec0d7f3b50390c2b9140ea954787d365b8d225ae (patch) | |
tree | f95261e7ace1898abf9256d520b086f54e257bdc /python/fatcat_web/templates/release_view.html | |
parent | ddd5912a825ef42670cf164cf64989072bb57e5f (diff) | |
download | fatcat-ec0d7f3b50390c2b9140ea954787d365b8d225ae.tar.gz fatcat-ec0d7f3b50390c2b9140ea954787d365b8d225ae.zip |
make 'Fatcat Bits' a macro
Diffstat (limited to 'python/fatcat_web/templates/release_view.html')
-rw-r--r-- | python/fatcat_web/templates/release_view.html | 62 |
1 files changed, 26 insertions, 36 deletions
diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html index 6259f0e2..5b4236cf 100644 --- a/python/fatcat_web/templates/release_view.html +++ b/python/fatcat_web/templates/release_view.html @@ -1,4 +1,7 @@ +{% set entity = release %} +{% import "entity_macros.html" as entity_macros %} {% extends "base.html" %} + {% block fullbody %} <div class="ui stackable mobile reversed grid centered"> @@ -24,11 +27,10 @@ <div class="ui accordion"> <div class="title"> - <i class="dropdown icon"></i> {% if release.release_status == 'published' %} - Published in <a href="/container/{{ container.ident }}">{{ container.name }}</a> + <i class="dropdown icon"></i>Published in <a href="/container/{{ container.ident }}">{{ container.name }}</a> {% else %} - Released as a <i>{{ release.release_type }}</i> + <i class="dropdown icon"></i>Released as a <i>{{ release.release_type }}</i> {% if container %} in <a href="/container/{{ container.ident }}">{{ container.name }}</a> {% endif %} {% endif %} {% if release.publisher %} @@ -286,39 +288,29 @@ This release citing other releases. <div class="ui segment attached accordion"> <div class="title" style="padding: 0px;"><i class="dropdown icon"></i><b>Lookup Links</b></div> <div class="content"> -{% if container != None and container.issnl != None %} - <a href="http://www.sherpa.ac.uk/romeo/issn/{{ container.issnl }}/">SHERPA/RoMEO</a> (journal policies)<br/> -{% endif %} -{% if container != None and container.doi != None %} - <a href="https://oadoi.org/{{ release.doi }}">oaDOI/unpaywall</a><br/> -{% endif %} -{% if release.isbn13 != None %} - <a href="https://openlibrary.org/search?isbn={{ release.isbn13 }}">Open Library</a><br> - <a href="http://www.worldcat.org/search?q=bn%3A{{ release.isbn13 }}">Worldcat</a><br> -{% else %} - <a href="http://www.worldcat.org/search?qt=worldcat_org_art&q={{ release.title }}">Worldcat</a><br> -{% endif %} -{% if release.doi %} -<a href="https://api.crossref.org/v1/works/http://dx.doi.org/{{ release.doi }}">Crossref Metadata</a> (via API)<br> -{% endif %} -<a href="https://www.wikidata.org/w/index.php?search={{ release.title }}">wikidata.org</a><br> -<a href="https://core.ac.uk/search?q={{ release.title }}">CORE.ac.uk</a><br> -<a href="https://www.semanticscholar.org/search?q={{ release.title }}">Semantic Scholar</a> (CS, neuro)<br> -<a href="https://scholar.google.com/scholar?q={{ release.title }}">Google Scholar</a><br> + {% if container != None and container.issnl != None %} + <a href="http://www.sherpa.ac.uk/romeo/issn/{{ container.issnl }}/">SHERPA/RoMEO</a> (journal policies)<br/> + {% endif %} + {% if container != None and container.doi != None %} + <a href="https://oadoi.org/{{ release.doi }}">oaDOI/unpaywall</a><br/> + {% endif %} + {% if release.isbn13 != None %} + <a href="https://openlibrary.org/search?isbn={{ release.isbn13 }}">Open Library</a><br> + <a href="http://www.worldcat.org/search?q=bn%3A{{ release.isbn13 }}">Worldcat</a><br> + {% else %} + <a href="http://www.worldcat.org/search?qt=worldcat_org_art&q={{ release.title }}">Worldcat</a><br> + {% endif %} + {% if release.doi %} + <a href="https://api.crossref.org/v1/works/http://dx.doi.org/{{ release.doi }}">Crossref Metadata</a> (via API)<br> + {% endif %} + <a href="https://www.wikidata.org/w/index.php?search={{ release.title }}">wikidata.org</a><br> + <a href="https://core.ac.uk/search?q={{ release.title }}">CORE.ac.uk</a><br> + <a href="https://www.semanticscholar.org/search?q={{ release.title }}">Semantic Scholar</a> (CS, neuro)<br> + <a href="https://scholar.google.com/scholar?q={{ release.title }}">Google Scholar</a><br> </div> </div> -<div class="ui segment attached"> -<b>Fatcat Bits</b> -<p>State is "{{ release.state }}". Revision: -<br><small><code>{{ release.revision }}</code></small> -<br><a href="https://api.{{ config.FATCAT_DOMAIN }}/v0/release/{{ release.ident }}?expand=container,files,filesets,webcaptures">As JSON object via API</a> - -</div> -<div class="two ui buttons bottom attached"> - <a href="/release/{{ release.ident }}/edit" class="ui blue button">Edit Metadata</a> - <a href="/release/{{ release.ident }}/history" class="ui button">View History</a> -</div> +{{ entity_macros.fatcat_bits(entity, "release", "container,files,filesets,webcaptures") }} </div> </div> @@ -326,8 +318,6 @@ This release citing other releases. {% block postscript %} <script> -$('.ui.accordion') - .accordion() -; + $('.ui.accordion').accordion(); </script> {% endblock %} |