From 9d000e111198b43e42e09c142fcccaf96a60224e Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 14 Jan 2021 20:15:12 -0800 Subject: serp: refactor ext id display into macro; add dblp,doaj --- fatcat_scholar/templates/search_macros.html | 41 ++++++++++++++++++----------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/fatcat_scholar/templates/search_macros.html b/fatcat_scholar/templates/search_macros.html index 251de81..443645c 100644 --- a/fatcat_scholar/templates/search_macros.html +++ b/fatcat_scholar/templates/search_macros.html @@ -25,6 +25,31 @@ {% endif %} {% endmacro %} +{% macro external_identifiers(biblio) -%} + {# NOTE: should be able to call with paper.biblio or any paper.release[] #} + {% if biblio.doi %} + doi:{{ biblio.doi }}   + {% endif %} + {% if biblio.pmid %} + pmid:{{ biblio.pmid }}   + {% endif %} + {% if biblio.pmcid %} + pmcid:{{ biblio.pmcid }}   + {% endif %} + {% if biblio.arxiv_id %} + arXiv:{{ biblio.arxiv_id }}   + {% endif %} + {% if biblio.dblp_id %} + dblp:{{ biblio.dblp_id }}   + {% endif %} + {% if biblio.doaj_id %} + doaj:{{ biblio.doaj_id }}   + {% endif %} + {% if biblio.release_ident %} + fatcat:{{ biblio.release_ident}}   + {% endif %} +{% endmacro %} + {% macro fulltext_search_result_row(paper, locale=None, debug_mode=False) -%}
@@ -136,21 +161,7 @@ {% endif %} {# ### IDENTIFIERS #} - {% if paper.biblio.doi %} - doi:{{ paper.biblio.doi }}   - {% endif %} - {% if paper.biblio.pmid %} - pmid:{{ paper.biblio.pmid }}   - {% endif %} - {% if paper.biblio.pmcid %} - pmcid:{{ paper.biblio.pmcid }}   - {% endif %} - {% if paper.biblio.arxiv_id %} - arXiv:{{ paper.biblio.arxiv_id }}   - {% endif %} - {% if paper.biblio.release_ident %} - fatcat:{{ paper.biblio.release_ident}}   - {% endif %} + {{ external_identifiers(paper.biblio) }}
{# ### TAGS #} -- cgit v1.2.3