From 0cb1fd066e4bbefce6b9aba4ac29916c37ffd738 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 23 Apr 2020 18:26:52 -0700 Subject: web search: tweak release search result style This is also back-ported from covid19.fatcat.wiki, though with some more tweaks on top. The changes are: - show original title if available (usually non-English) - move release_type label to title line suffix, and only show if not a "paper" - show publication status and withdrawl as text after the journal title, not as a label --- python/fatcat_web/templates/entity_macros.html | 76 +++++++++++++++++--------- 1 file changed, 51 insertions(+), 25 deletions(-) (limited to 'python/fatcat_web/templates/entity_macros.html') diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 7c5436c6..61de2d13 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -156,17 +156,35 @@ [blank] {% endif %} + + {# release type suffix #} + {% if paper.release_type in ("article-journal", "paper-conference") %} + {# pass #} + {% elif paper.release_type in ("book", "chapter", "dataset") %} + [{{ paper.release_type }}] + {% elif not paper.release_type %} + [unknown-media] + {% else %} + [{{ paper.release_type }}] + {% endif %} + + {# show original_title #} + {% if paper.original_title and paper.title != paper.original_title %} +
+ + {{ paper.original_title[:512] }} {% if paper.original_title|length > 512 %}...{% endif %} + + {% endif %} + + {% if paper.best_pdf_url %}
  fulltext
{% endif %} - {# -
{{ ", ".join(paper.contrib_names[:12]) }} - {% if paper.contrib_names|length > 12 %}(+{{ paper.contrib_names|length - 12 }} others){% endif %} -
- #} + + {# ### AUTHOR ROW #} {% if paper.contrib_names %}
@@ -175,25 +193,14 @@
{% endif %} + + + {# ### JOURNAL ROW #} {% if paper.release_year %} {{ paper.release_year }} {% endif %} - {% if paper.release_type %} - {% if paper.release_type in ("article-journal", "paper-conference") %} - {{ paper.release_type }} - {% elif paper.release_type in ("book") %} - {{ paper.release_type }} - {% else %} - {{ paper.release_type }} - {% endif %} - {% endif %} - {% if paper.withdrawn_status %} - {{ paper.withdrawn_status }} - {% endif %} - {% if paper.release_stage and paper.release_stage != "published" %} - {{ paper.release_stage }} - {% elif not paper.release_stage %} - unknown + {% if paper.release_year and paper.container_name %} + | {% endif %} {% if paper.container_name %} {% if paper.container_id %} @@ -203,8 +210,22 @@ {% endif %} {% if paper.container_is_oa %}{% endif %} {% endif %} - {% if paper.doi or paper.pmid or paper.arxiv_id or paper.jstor_id %} -
+ {% if paper.withdrawn_status %} + [{{ paper.withdrawn_status }}] + {% endif %} + {% if paper.release_stage == "accepted" %} + [{{ paper.release_stage }} manuscript] + {% elif paper.release_stage == "submitted" %} + [pre-print] + {% elif paper.release_stage and paper.release_stage != "published" %} + [{{ paper.release_stage }}] + {% elif not paper.release_stage %} + [unpublished?] + {% endif %} + + {# ### IDENTIFIERS #} + {% if paper.doi or paper.pmid or paper.arxiv_id or paper.jstor_id or paper.pmcid %} +
{% endif %} {% if paper.doi %} doi:{{ paper.doi }}   @@ -212,13 +233,18 @@ {% if paper.pmid %} pmid:{{ paper.pmid }}   {% endif %} + {% if paper.pmcid %} + pmcid:{{ paper.pmcid }}   + {% endif %} {% if paper.arxiv_id %} arXiv:{{ paper.arxiv_id }}   {% endif %} - {% if False %} {# XXX: elastic release work grouping searches #} + +{# WIP: elastic release work grouping searches
and 5 other versions of the same work! - {% endif %} +#} + {% endmacro %} -- cgit v1.2.3