summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-08-03 18:15:10 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-08-03 18:15:10 -0700
commit37b6e99eec3cbc668d6b51ed9e57b93f9a114d2a (patch)
tree0427f85e094d9cb9c736d496d5a087f83b92e2d1
parentbfdbbdd50ab06d28a2099e408ff154b0ce1cbc4b (diff)
downloadfatcat-37b6e99eec3cbc668d6b51ed9e57b93f9a114d2a.tar.gz
fatcat-37b6e99eec3cbc668d6b51ed9e57b93f9a114d2a.zip
refs: web UI tweaks for iterated CSL schema
-rw-r--r--python/fatcat_web/templates/entity_macros.html22
-rw-r--r--python/tests/files/elastic_refs_out_release.json10
2 files changed, 26 insertions, 6 deletions
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 %}<br>{% 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 %} <i>(+ more)</i> {%endif %}
{% endif %}
{% if csl.issued or csl["container-title"] %}<br>{% endif %}
- {% if csl.issued and csl.issued.raw %}{{ csl.issued.raw }} &nbsp;{% endif %}
+ {% if csl.issued and csl.issued is mapping %}
+ {% if csl.issued['date-parts'] %}
+ {{ csl.issued['date-parts'][0][0] }} &nbsp;
+ {% elif csl.issued.raw %}
+ {{ csl.issued.raw }} &nbsp;
+ {% endif %}
+ {% endif %}
{% if csl["container-title"] %}
<i>{{ csl["container-title"] }}</i>
{% endif %}
diff --git a/python/tests/files/elastic_refs_out_release.json b/python/tests/files/elastic_refs_out_release.json
index 5e25d80f..5a45acee 100644
--- a/python/tests/files/elastic_refs_out_release.json
+++ b/python/tests/files/elastic_refs_out_release.json
@@ -152,11 +152,13 @@
"accessed": {},
"author": [
{
- "name": "Alatawi Eman"
+ "raw_name": "Alatawi Eman"
}
],
"container-title": "Symbolic Execution with Invariant Inlay: Evaluating the Potential. In 2018 25th Australasian Software Engineering Conference, ASWEC 2018.",
- "issued": {}
+ "issued": {
+ "date-parts": [[2019]]
+ }
}
},
"sort": [
@@ -185,7 +187,9 @@
}
],
"container-title": "Symbolic Path-Oriented Test Data Generation for Floating-Point Programs. In Sixth IEEE International Conference on Software Testing, Verification and Validation, ICST",
- "issued": {}
+ "issued": {
+ "raw": "2000"
+ }
}
},
"sort": [