From 9b47de41a5666b614db3fead897fab46784e9b02 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 4 Mar 2019 16:21:49 -0800 Subject: truncate long author lists --- python/fatcat_web/templates/release_search.html | 4 +++- python/fatcat_web/templates/release_view.html | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/python/fatcat_web/templates/release_search.html b/python/fatcat_web/templates/release_search.html index 273228a1..783f4dc4 100644 --- a/python/fatcat_web/templates/release_search.html +++ b/python/fatcat_web/templates/release_search.html @@ -27,7 +27,9 @@   fulltext {% endif %} -
{{ ", ".join(paper.contrib_names) }}
+
{{ ", ".join(paper.contrib_names[:12] }} + {% if paper.contrib_names|length > 12 %}(+{{ paper.contrib_names|length - 12 }} others){% endif %} +
{% if paper.doi %} DOI: {{ paper.doi }} - {{ paper.release_type }} diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html index 37d541ba..b2ee524f 100644 --- a/python/fatcat_web/templates/release_view.html +++ b/python/fatcat_web/templates/release_view.html @@ -11,13 +11,15 @@
release {{ release.ident }}

{% if authors != [] %} by {% endif %} - {% for contrib in authors %} + {% for contrib in authors[:12] %} {% if contrib.creator_id %} {{ contrib.raw_name }}{% if not loop.last %}, {% endif %} {% else %} {% if contrib.raw_name != None %}{{ contrib.raw_name }}{% else %}Unknown{% endif %}{% if not loop.last %}, {% endif %} {% endif %} {% endfor %} + {% if authors|count > 12 %} (+{{ authors|length - 12 }} others) + {% endif %} @@ -85,7 +87,7 @@ {% if release.contribs|length > 0 %}

- All Contributors + All Contributors ({{ release.contribs|length }})
-- cgit v1.2.3