diff options
Diffstat (limited to 'python')
-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 %} |