diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2021-04-15 23:25:00 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2021-07-23 10:55:09 -0700 |
commit | 7186a379f335dd2731d5db79ab85abf3506cee88 (patch) | |
tree | 319ef6bd07a147e416b5de395e81845db631b9bf /python/fatcat_web | |
parent | d5b24df069fc96d396afbb302633a077e5dbfb39 (diff) | |
download | fatcat-7186a379f335dd2731d5db79ab85abf3506cee88.tar.gz fatcat-7186a379f335dd2731d5db79ab85abf3506cee88.zip |
web: template macro to display release entry summary
Diffstat (limited to 'python/fatcat_web')
-rw-r--r-- | python/fatcat_web/templates/entity_macros.html | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 50f45753..94770afb 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -387,3 +387,55 @@ yellow </table> {%- endmacro %} + +{# this is useful for things like showing lists of releases in tables #} +{% macro release_summary(release) %} +<b><a href="/release/{{ release.ident }}">{{ release.title }}</a></b> + {% if release.release_type not in ["article-journal", "conference-paper"] %} + <b>[{{ release.release_type or "unknown-type" }}]</b> + {% endif %} +<br> + {% for contrib in release.contribs[:5] %} + {% if contrib.creator %} + {{ contrib.creator.display_name }} + {% else %} + {{ contrib.raw_name }} + {% endif %} + {% if not loop.last %}, {% endif %} + {% endfor %} + {% if release.contribs | length > 5 %}(+ more) {%endif %} +<br> + {% if release.release_year %}{{ release.release_year }} {% endif %} + {% if release.container %} + <i>{{ release.container.name }}</i> + {% elif release.extra and release.extra.container_name %} + <i>{{ release.extra.container_name }}</i> + {% endif %} + {% if release.release_stage != "published" %} + <span style="color: brown; font-weight: bold;">{{ release.release_stage or "unpublished" }}</span> + {% endif %} +</small> +<br> + {% if release.version %} + <span style="color:green">version:{{ release.release_year }}</span> + {% endif %} + {% if release.number %} + <span style="color:green">number:{{ release.number }}</span> + {% endif %} + {% if release.ext_ids.doi %} + <a href="https://doi.org/{{ release.ext_ids.doi }}" style="color:green;">doi:{{ release.ext_ids.doi }}</a> + {% endif %} + {# TODO: links #} + {% if release.ext_ids.arxiv %} + <a href="#" style="color:green;">arXiv:{{ release.ext_ids.arxiv }}</a> + {% endif %} + {% if release.ext_ids.pmcid %} + <a href="#" style="color:green;">pmcid:{{ release.ext_ids.pmcid }}</a> + {% endif %} + {% if release.ext_ids.pmid %} + <a href="#" style="color:green;">pmid:{{ release.ext_ids.pmid }}</a> + {% endif %} + {% if release.ext_ids.dblp %} + <a href="#" style="color:green;">dblp:{{ release.ext_ids.dblp }}</a> + {% endif %} +{% endmacro %} |