diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/fatcat/templates/container_view.html | 20 | ||||
| -rw-r--r-- | python/fatcat/templates/creator_view.html | 71 | ||||
| -rw-r--r-- | python/fatcat/templates/file_view.html | 85 | ||||
| -rw-r--r-- | python/fatcat/templates/release_view.html | 146 | ||||
| -rw-r--r-- | python/fatcat/templates/work_view.html | 47 | 
5 files changed, 276 insertions, 93 deletions
diff --git a/python/fatcat/templates/container_view.html b/python/fatcat/templates/container_view.html index 47a6dcbf..4aae2f0d 100644 --- a/python/fatcat/templates/container_view.html +++ b/python/fatcat/templates/container_view.html @@ -16,22 +16,22 @@  <p><b>Publisher:</b>  {% if container.publisher != None %}{{ container.publisher }}{% else %}<i>Unknown</i>{% endif %}  {% if container.coden != None %} -<p><b>CODEN<sup><a href="https://en.wikipedia.org/wiki/CODEN">?</a></sup>:</b> <code>{{ container.coden }}</code> +<p><b>CODEN<sup><a href="https://en.wikipedia.org/wiki/CODEN">?</a></sup>:</b>  <code>{{ container.coden }}</code>  {% endif %}  {% if container.abbrev != None %} -<p><b>Abbrev.:</b> <code>{{ container.abbrev }}</code> +<p><b>Abbrev.:</b>  <code>{{ container.abbrev }}</code>  {% endif %}  {% if (container.extra != None) and (container.extra.url != None) %} -<p><b>Homepage:</b> <a href="{{ container.extra.url }}"><code>{{ container.extra.url }}</code></a> +<p><b>Homepage:</b> <a href="{{ container.extra.url }}"> <code>{{ container.extra.url }}</code></a>  {% endif %}  {% if container.extra != None %}  <p><b>Additional Metadata (raw JSON):</b> -<code>{{ container.extra }}</code> + <code>{{ container.extra }}</code>  {% endif %}  <!-- -Raw JSON Object: -{{ container }} +Raw Object: +{{ container|safe }}  -->  </div> @@ -49,12 +49,12 @@ Raw JSON Object:  {% if container.issnl != None %}    <b>ISSN-L<sup><a href="https://en.wikipedia.org/wiki/International_Standard_Serial_Number#Linking_ISSN">?</a></sup></b>  -  <code>{{ container.issnl }}</code> +   <code>{{ container.issnl }}</code>    {% if container.extra != None and container.extra.ISSNp != None %} -    <br><i class="icon paperclip"></i>Print: <code>{{ container.extra.ISSNp }}</code> +    <br><i class="icon paperclip"></i>Print:  <code>{{ container.extra.ISSNp }}</code>    {% endif %}    {% if container.extra != None and container.extra.ISSNe != None %} -    <br><i class="icon plug"></i>Electronic: <code>{{ container.extra.ISSNe }}</code> +    <br><i class="icon plug"></i>Electronic:  <code>{{ container.extra.ISSNe }}</code>    {% endif %}    </div><div class="ui segment attached">  {% endif %} @@ -82,7 +82,7 @@ Raw JSON Object:  <b>Lookup Links</b>  <br><a href="http://www.sherpa.ac.uk/romeo/issn/{{ container.issnl }}/">SHERPA/RoMEO</a> (access policies) -<br><a href="https://www.wikidata.org/w/index.php?search=&search={{ container.name }}">wikidata.org</a> +<br><a href="https://www.wikidata.org/w/index.php?search={{ container.name }}">wikidata.org</a>  </div><div class="ui segment attached">  <b>Fatcat Bits</b> diff --git a/python/fatcat/templates/creator_view.html b/python/fatcat/templates/creator_view.html index 24dfdc56..97708863 100644 --- a/python/fatcat/templates/creator_view.html +++ b/python/fatcat/templates/creator_view.html @@ -1,37 +1,72 @@  {% extends "base.html" %} -{% block body %} +{% block fullbody %} -<h1>{{ creator.display_name }}</h1> +<div class="ui stackable mobile reversed grid centered"> +<div class="one wide column"></div> +<div class="fifteen wide column"> +  <h1 class="ui header">{{ creator.display_name }} +  <div class="sub header"><code>creator {{ creator.ident }}</code></div></h1> +</div> +</div> + +<div class="ui stackable mobile reversed grid centered"> +<div class="one wide column"></div> +<div class="ten wide column">  <p><b>Given ("first") name:</b> {{ creator.given_name}}  <p><b>Sur ("family"/"last") name:</b> {{ creator.surname }} -<p><b>ORCID<sup><a href="https://en.wikipedia.org/wiki/Orcid">?</a></sup></b>: -{% if creator.orcid != None %} -    <a href="https://orcid.org/{{creator.orcid}}"><code>{{ creator.orcid }}</code></a> -{% else %} -    unknown -{% endif %} -<p><b>fatcat Creator Identifier:</b> <code>{{ creator.ident }}</code> (revision #{{ creator.revision }}, {{ creator.state }})  {% if creator.extra != None %}  <p><b>Additional Metadata (raw JSON):</b> -<pre>{{ creator.extra }}</pre> + <code>{{ creator.extra }}</code>  {% endif %} -<!-- -Raw JSON Object: -{{ creator }} ---> - +<br> +<h3>Releases</h3>  {% if releases != [] %} -Releases this creator has contributed to: +<p>This creator has contributed to:  <ul>    {% for release in releases %} -  <li>"{{ release.title }}", a {{ release.release_type }} published {{ release.release_date }} as <code>{{ release.release_status }}</code>. -    <br><a href="/release/{{ release.ident }}"><code>{{ release.ident }}</code></a> +  <li>"{{ release.title }}", a {{ release.release_type }} published {{ release.release_date }} (status: <code>{{ release.release_status }})</code>. +    <br>Fatcat ID: <a href="/release/{{ release.ident }}"><code>{{ release.ident }}</code></a>    {% endfor %}  </ul>  {% else %}  This creator has not contributed to any releases.  {% endif %} +<!-- +Raw Object: +{{ creator|safe }} +--> + +</div> +<div class="five wide column"> +<div class="ui segment top attached"> + +{% if creator.orcid != None %} +  <b>ORCID<sup><a href="https://en.wikipedia.org/wiki/Orcid">?</a></sup></b>: +     <a href="https://orcid.org/{{creator.orcid}}"><code>{{ creator.orcid }}</code></a> +  </div><div class="ui segment attached"> +{% endif %} + +<b>Lookup Links</b> +<br><a href="https://www.wikidata.org/w/index.php?search=&search={{ creator.display_name }}">wikidata.org</a> +<br><a href="https://viaf.org/viaf/search?query=local.personalNames%20all%20%22{{ creator.display_name }}">VIAF</a> +<br><a href="http://dblp.uni-trier.de/search?q={{ creator.display_name }}">dblp</a> (CS) +<br><a href="https://scholar.google.com/scholar?q={{ creator.display_name }}">Google Scholar</a> +</div><div class="ui segment attached"> + +<b>Fatcat Bits</b> +<p>Revision #{{ creator.revision }}. State is "{{ creator.state }}" +<br><a href="https://api.qa.fatcat.wiki/v0/creator/{{ creator.ident }}">As JSON object via API</a> + +</div> +<div class="two ui buttons bottom attached"> +  <a href="/creator/{{ creator.ident }}/edit" class="ui blue button">Edit Metadata</a> +  <a href="/creator/{{ creator.ident }}/history" class="ui button">View History</a> +</div> + +</div> +</div> +  {% endblock %} diff --git a/python/fatcat/templates/file_view.html b/python/fatcat/templates/file_view.html index f45c9238..6a53b6c6 100644 --- a/python/fatcat/templates/file_view.html +++ b/python/fatcat/templates/file_view.html @@ -1,27 +1,30 @@  {% extends "base.html" %} -{% block body %} +{% block fullbody %} -<h1>File {{ file.ident }}</h1> +<div class="ui stackable mobile reversed grid centered"> +<div class="one wide column"></div> +<div class="fifteen wide column"> +  <h1 class="ui header"> +  <div class="sub header"><code>file {{ file.ident }}</code></div></h1> +</div> +</div> + +<div class="ui stackable mobile reversed grid centered"> +<div class="one wide column"></div> +<div class="ten wide column">  <p><b>Size:</b> {{ file.size }} (bytes) -<p><b>SHA-1 checksum:</b> <code>{{ file.sha1 }}</code> -{% if file.sha256 != None %} -<p><b>SHA-256 checksum:</b> <code>{{ file.sha256 }}</code> -{% endif %} -{% if file.md5 != None %} -<p><b>MD5 checksum:</b> <code>{{ file.md5 }}</code> + +{% if file.mimetype %} +<p><b>File Type:</b> <code>{{ file.mimetype }}</code>  {% endif %} -<p><b>fatcat File Identifier:</b> <code>{{ file.ident }}</code> (revision #{{ file.revision }}, {{ file.state }}) +  {% if file.extra != None %}  <p><b>Additional Metadata (raw JSON):</b>  <pre>{{ file.extra }}</pre>  {% endif %} -<!-- -Raw JSON Object: -{{ file }} ---> - +<h3>Releases</h3>  {% if file.releases != None %}  <p>Releases associated with this file:  <ul> @@ -33,13 +36,65 @@ Raw JSON Object:  This file is not associated with any fatcat release.  {% endif %} +<h3>URLs</h3>  {% if file.url != None %}  <p>Known locations of this file:  <ul> -  <li><a href="{{ file.url }}"><code>{{ file.url }}</code></a> +  <li><a href="{{ file.url }}">{{ file.url.split('/')[2] }}</a> +      (<a href="https://web.archive.org/web/2/{{ file.url }}">Wayback mirror</a>)  </ul>  {% else %}  No known public URL, mirror, or archive for this file.  {% endif %} +<h3>Checksums</h3> +<table class="ui table"> +  <thead> +    <tr><th>Algorithm +        <th>Value +  <tbody> +    {% if file.sha1 != None %} +    <tr><td>SHA-1 +        <td><code>{{ file.sha1 }} +    {% endif %} +    {% if file.sha1 != None %} +    <tr><td>SHA-256 +        <td><code>{{ file.sha256 }} +    {% endif %} +    {% if file.md5!= None %} +    <tr><td>MD5 +        <td><code>{{ file.md5 }} +    {% endif %} +</table> + +<!-- +Raw Object: +{{ file|safe }} +--> + +</div> +<div class="five wide column"> + +{% if file.url != None %} +<a href="https://web.archive.org/web/2/{{ file.url }}" class="ui top attached fluid huge green button"><i class="file icon"></i>Download File</a> +{% else %} +<span class="ui top attached fluid huge grey button"><i class="file cross icon"></i>No Download Available</span> +{% endif %} + +<div class="ui segment attached"> + +<b>Fatcat Bits</b> +<p>Revision #{{ file.revision }}. State is "{{ file.state }}" +<br><a href="https://api.qa.fatcat.wiki/v0/file/{{ file.ident }}">As JSON object via API</a> + +</div> +<div class="two ui buttons bottom attached"> +  <a href="/file/{{ file.ident }}/edit" class="ui blue button">Edit Metadata</a> +  <a href="/file/{{ file.ident }}/history" class="ui button">View History</a> +</div> + +</div> +</div> + +  {% endblock %} diff --git a/python/fatcat/templates/release_view.html b/python/fatcat/templates/release_view.html index 4d67644d..8c414088 100644 --- a/python/fatcat/templates/release_view.html +++ b/python/fatcat/templates/release_view.html @@ -3,49 +3,57 @@  <div class="ui stackable mobile reversed grid centered">  <div class="one wide column"></div> -<div class="ten wide column"> +<div class="fifteen wide column"> +  <h1 class="ui header">{{ release.title }} +  <div class="sub header"><code>release {{ release.ident }}</code></div></h1> +  {% if authors != [] %} by {% endif %} +  {% for contrib in authors %} +    {% if contrib.creator_id %} +      <b><a href="/creator/{{contrib.creator_id}}">{{ contrib.raw }}</a></b>{% if not loop.last %}, {% endif %} +    {% else %} +      {% if contrib.raw != None %}{{ contrib.raw }}{% else %}<i>Unknown</i>{% endif %}{% if not loop.last %}, {% endif %} +    {% endif %} +  {% endfor %} +</div> +</div> -<h1 class="ui header">{{ release.title }} -<div class="sub header"><code>release {{ release.ident }}</code></div></h1> -{% for contrib in authors %} -  {% if contrib.creator_id %} -    <b><a href="/creator/{{contrib.creator_id}}">{{ contrib.raw }}</a></b> -  {% else %} -    {{ contrib.raw }} -  {% endif %} -{% endfor %} +<div class="ui stackable mobile reversed grid centered"> +<div class="one wide column"></div> +<div class="ten wide column"> -<br><br>  {% if release.release_date != None %}<p><b>Date (published):</b> {{ release.release_date }}{% endif %}  {% if release.doi != None %} -<br><b>DOI:</b> <a href="https://doi.org/{{ release.doi }}"><code>{{ release.doi }}</code></a> +<br><b>DOI:</b> <a href="https://doi.org/{{ release.doi }}"> <code>{{ release.doi }}</code></a> +{% endif %} +{% if release.isbn13 != None %} +<p><b>ISBN-13:</b>  <code>{{ release.isbn13 }}</code>  {% endif %}  {% if release.language != None %} -<br><b>Primary Language:</b> <code>{{ release.language }}</code> (<a href="https://www.loc.gov/standards/iso639-2/php/langcodes_name.php?iso_639_1={{ release.language }}">lookup ISO-639 code</a>) +<br><b>Primary Language:</b>  <code>{{ release.language }}</code> (<a href="https://www.loc.gov/standards/iso639-2/php/langcodes_name.php?iso_639_1={{ release.language }}">lookup ISO-639 code</a>)  {% endif %} +<br><b>Fatcat Work:</b> <a href="/work/{{ release.work_id }}"> <code>{{ release.work_id }}</code></a> +<br>There may be other versions or releases (pre-prints, publications, etc) +linked to the same work.  <div class="ui segment"> -{% if container and release.release_status == 'published' %} -<div class="ui top attached label"> -Published as a <i>{{ release.release_type }}</i> in <a href="/container/{{ container.ident }}">{{ container.name }}</a> -{% if container.extra.is_oa %} (open access!){% endif %} -</div> +{% if container != None %} +  <div class="ui top attached label"> +  {% if release.release_status == 'published' %} +    Published as a <i>{{ release.release_type }}</i> in <a href="/container/{{ container.ident }}">{{ container.name }}</a> +  {% else %} +    A <i>{{ release.release_type }}</i> in <a href="/container/{{ container.ident }}">{{ container.name }}</a> +  {% endif %} +  </div><br>  {% endif %} -{% if container.issnl != None %}<br><b>ISSN-L:</b> {{ container.issnl }}{% endif %} -{% if release.volume != None %}<br><b>Volume:</b> {{ release.volume }}{% endif %} -{% if release.issue != None %}<br><b>Issue:</b> {{ release.issue }}{% endif %} -{% if release.pages != None %}<br><b>Page(s):</b> {{ release.pages }}{% endif %} -{% if release.publisher != None %}<br><b>Publisher:</b> {{ release.publisher }}{% endif %} -{% if release.release_status != None %}<br><b>Release Status:</b> {{ release.release_status }}{% endif %} -{% if release.release_type != None %}<br><b>Release Type:</b> {{ release.release_type}}{% endif %} +{% if container != None and container.issnl != None %}<b>ISSN-L:</b> {{ container.issnl }}<br>{% endif %} +{% if release.volume != None %}<b>Volume:</b> {{ release.volume }}<br>{% endif %} +{% if release.issue != None %}<b>Issue:</b> {{ release.issue }}<br>{% endif %} +{% if release.pages != None %}<b>Page(s):</b> {{ release.pages }}<br>{% endif %} +{% if release.publisher != None %}<b>Publisher:</b> {{ release.publisher }}<br>{% endif %} +{% if release.release_status != None %}<b>Release Status:</b> {{ release.release_status }}<br>{% endif %} +{% if release.release_type != None %}<b>Release Type:</b> {{ release.release_type}}<br>{% endif %}  </div> -There may be other versions or releases (pre-prints, publications, etc) linked -to the same work: -<a href="/work/{{ release.work_id }}"><code>{{ release.work_id }}</code></a> -{% if release.isbn13 != None %} -<p><b>ISBN-13:</b> <code>{{ release.isbn13 }}</code> (<a href="https://openlibrary.org/search?isbn={{ release.isbn13 }}">openlibrary.org</a>) -{% endif %}  {% if release.extra != None %}  <p><b>Additional Metadata (raw JSON):</b> @@ -53,8 +61,8 @@ to the same work:  {% endif %}  <!-- -Raw JSON Object: -<pre>{{ release }}</pre> +Raw Object: +{{ release|safe }}  -->  <br> @@ -128,29 +136,79 @@ This release citing other releases.  </div>  <div class="five wide column"> -<a href="#" class="ui top attached fluid huge green button"><i class="file pdf outline icon"></i>Download Full Text</a> +{% if files != [] and files[0].url != None %} +<a href="https://web.archive.org/web/2/{{ files[0].url }}" class="ui top attached fluid huge green button"><i class="file pdf outline icon"></i>Download Full Text</a> +{% else %} +<span class="ui top attached fluid huge grey button"><i class="file cross icon"></i>No Full Text Available</span> +{% endif %}  <div class="ui segment attached"> -A Bunch Of Other Content... +{% if release.doi %} +<b>DOI </b> <a href="https://doi.org/{{ release.doi }}">{{ release.doi }}</a> +</div><div class="ui segment attached"> +{% endif %} -<ul> -  <li><a>and links!</a> -  <li><a>and links!</a> -  <li><a>and links!</a> -</ul> +{% if release.extra.is_oa == True %} +<b><i class="ui icon unlock alternate green"></i> Open Access</b> +</div><div class="ui segment attached"> +{% elif release.extra.is_oa == False %} +<b><i class="ui icon lock red"></i> Not Open Access</b> +</div><div class="ui segment attached"> +{% endif %} -Over here +<b>Container Metadata</b><br> +{% if container.extra.is_oa == True %} +<i class="icon unlock orange"></i>Open Access Publication<br> +{% elif container.extra.is_oa == False  %} +<i class="icon lock black"></i>Not Open Access<br> +{% else %} +<i class="icon question grey"></i>Unknown OA Status<br> +{% endif %} +{% if (container.extra != None) %} +  {% if container.extra.in_doaj == True %} +    <i class="icon check green"></i> In <a href="https://doaj.org/toc/{{ container.issnl }}">DOAJ</a><br> +  {% elif container.extra.in_doaj == False %} +    <i class="icon times grey"></i> Not in <a href="https://doaj.org">DOAJ</a><br> +  {% endif %} +  {% if container.extra.in_road == True %} +    <i class="icon check green"></i> In <a href="http://road.issn.org/issn/{{ container.issnl }}">ISSN ROAD</a><br> +  {% elif container.extra.in_road == False %} +    <i class="icon times grey"></i> Not in <a href="https://road.issn.org">ISSN ROAD</a><br> +  {% endif %} +  {% if container.extra.is_kept == True %} +    <i class="icon check green"></i> In <a href="https://thekeepers.org/journals?query={{ container.issnl }}">Keepers Registery</a><br> +  {% elif container.extra.is_kept == False %} +    <i class="icon times grey"></i> Not in <a href="https://thekeepers.org/journals?query={{ container.issnl }}">Keepers Registry</a><br> +  {% endif %} +{% endif %} +{% if container.issnl != None %} +  <i class="icon hashtag"></i>ISSN-L:  <code>{{ container.issnl }}</code><br> +{% endif %}  </div><div class="ui segment attached"> -<b>DOI </b> <a href="https://doi.org/{{ release.doi }}">{{ release.doi }}</a> +<!-- (<a href="https://openlibrary.org/search?isbn={{ release.isbn13 }}">openlibrary.org</a>) --> + +<b>Lookup Links</b> +{% if container != None and container.issnl != None %} +  <br><a href="http://www.sherpa.ac.uk/romeo/issn/{{ container.issnl }}/">SHERPA/RoMEO</a> (journal policies) +{% endif %} +{% if container.doi != None %} +  <br><a href="https://oadoi.org/{{ release.doi }}">oaDOI/unpaywall</a> +{% endif %} +<br><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>  </div><div class="ui segment attached"> +  <b>Fatcat Bits</b>  <p>Revision #{{ release.revision }}. State is "{{ release.state }}" +<br><a href="https://api.qa.fatcat.wiki/v0/release/{{ release.ident }}">As JSON object via API</a>  </div>  <div class="two ui buttons bottom attached"> -  <a href="#" class="ui blue button">Edit Metadata</a> -  <a href="#" class="ui button">View History</a> +  <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>  </div> diff --git a/python/fatcat/templates/work_view.html b/python/fatcat/templates/work_view.html index 8fd384d6..6fe900bf 100644 --- a/python/fatcat/templates/work_view.html +++ b/python/fatcat/templates/work_view.html @@ -1,17 +1,26 @@  {% extends "base.html" %} -{% block body %} +{% block fullbody %} -<h1>Work {{ work.ident }}</h1> +<div class="ui stackable mobile reversed grid centered"> +<div class="one wide column"></div> +<div class="fifteen wide column"> +  <h1 class="ui header"> +  <div class="sub header"><code>work {{ work.ident }}</code></div></h1> +</div> +</div> + +<div class="ui stackable mobile reversed grid centered"> +<div class="one wide column"></div> +<div class="ten wide column"> -<p><b>fatcat Work Identifier:</b> <code>{{ work.ident }}</code> (revision #{{ work.revision }}, {{ work.state }})  {% if work.extra != None %}  <p><b>Additional Metadata (raw JSON):</b> -<pre>{{ work.extra }}</pre> + <code>{{ work.extra }}</code>  {% endif %}  <!-- -Raw JSON Object: -{{ work }} +Raw Object: +{{ work|safe }}  -->  <p>A "work" is just a linking identifier between a set of releases. For @@ -31,4 +40,30 @@ still reference the same underlying "work".  <p>There are no known releases associated with this work.  {% endif %} + +</div> +<div class="five wide column"> +<div class="ui segment top attached"> + +<b>Work Type:</b> +{% if work.work_type != None %} + <code>{{ work.work_type }}</code> +{% else %} +<i>unkonwn</i> +{% endif %} +</div><div class="ui segment attached"> + +<b>Fatcat Bits</b> +<p>Revision #{{ work.revision }}. State is "{{ work.state }}" +<br><a href="https://api.qa.fatcat.wiki/v0/work/{{ work.ident }}">As JSON object via API</a> + +</div> +<div class="two ui buttons bottom attached"> +  <a href="/work/{{ work.ident }}/edit" class="ui blue button">Edit Metadata</a> +  <a href="/work/{{ work.ident }}/history" class="ui button">View History</a> +</div> + +</div> +</div> +  {% endblock %}  | 
