From 37b6e99eec3cbc668d6b51ed9e57b93f9a114d2a Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 3 Aug 2021 18:15:10 -0700 Subject: refs: web UI tweaks for iterated CSL schema --- python/fatcat_web/templates/entity_macros.html | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 562b99d3..6b565f69 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -457,15 +457,31 @@ yellow {% if csl.title and csl.author %}
{% endif %} {% if csl.author %} {% for author in csl.author[:8] %} - {# TODO: other name variants? #} - {{ author.name }} + {% if author.literal %} + {{ author.literal }} + {% elif author.raw_name %} + {{ author.raw_name }} + {% elif author.family and author.given %} + {{ author.given }} {{ author.family }} + {% elif author.family %} + {{ author.family }} + {% elif author.name %} + {# DEPRECATED: was used by refs code path for a while. Delete in, eg, year 2022 #} + {{ author.name }} + {% endif %} {%- if not loop.last %}, {% endif %} {% endfor %} {% if csl.author | length > 8 %} (+ more) {%endif %} {% endif %} {% if csl.issued or csl["container-title"] %}
{% endif %} - {% if csl.issued and csl.issued.raw %}{{ csl.issued.raw }}  {% endif %} + {% if csl.issued and csl.issued is mapping %} + {% if csl.issued['date-parts'] %} + {{ csl.issued['date-parts'][0][0] }}   + {% elif csl.issued.raw %} + {{ csl.issued.raw }}   + {% endif %} + {% endif %} {% if csl["container-title"] %} {{ csl["container-title"] }} {% endif %} -- cgit v1.2.3