aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_covid19/templates/entity_macros.html
diff options
context:
space:
mode:
Diffstat (limited to 'fatcat_covid19/templates/entity_macros.html')
-rw-r--r--fatcat_covid19/templates/entity_macros.html82
1 files changed, 67 insertions, 15 deletions
diff --git a/fatcat_covid19/templates/entity_macros.html b/fatcat_covid19/templates/entity_macros.html
index cc3a8a6..1c4177c 100644
--- a/fatcat_covid19/templates/entity_macros.html
+++ b/fatcat_covid19/templates/entity_macros.html
@@ -14,7 +14,11 @@
<a href="https://fatcat.wiki/release/{{ paper.fatcat_ident }}"
{% endif %}
style="color: #2224c7;">
- {% if paper.title %}
+ {% if g.lang_code != 'en' and g.lang_code == paper.lang and paper.original_title %}
+ {# show original title first instead of title if UI is in that language #}
+ {{ paper.original_title[:512] }}
+ {% if paper.original_title|length > 512 %}...{% endif %}
+ {% elif paper.title %}
{{ paper.title[:512] }}
{% if paper.title|length > 512 %}...{% endif %}
{% else %}
@@ -22,15 +26,30 @@
{% endif %}
</a>
+ {# release type suffix #}
{% if paper.release_type in ("article-journal", "paper-conference") %}
{# pass #}
{% elif paper.release_type in ("book", "chapter", "dataset") %}
- <b style="text-transform: uppercase;">[{{ paper.release_type }}]</b>
+ <b style="text-transform: uppercase;">[{{ _(paper.release_type) }}]</b>
{% elif not paper.release_type %}
<b style="text-transform: uppercase; color: red;">[media?]</b>
{% else %}
- <b style="text-transform: uppercase;">[{{ paper.release_type }}]</b>
+ <b style="text-transform: uppercase;">[{{ _(paper.release_type) }}]</b>
{% endif %}
+
+ {# show inverse of title/original_title above #}
+ {% if g.lang_code != 'en' and g.lang_code == paper.lang and paper.title and paper.title != paper.original_title %}
+ <br>
+ <i style="font-weight: normal;">
+ {{ paper.title[:512] }} {% if paper.title|length > 512 %}...{% endif %}
+ </i>
+ {% elif paper.original_title and paper.title != paper.original_title %}
+ <br>
+ <i style="font-weight: normal;">
+ {{ paper.original_title[:512] }} {% if paper.original_title|length > 512 %}...{% endif %}
+ </i>
+ {% endif %}
+
</h4>
{#
@@ -83,44 +102,77 @@
{# ### ABSTRACT / QUERY HIGHLIGHT #}
{% if paper._highlights %}
- <div style="padding-top: 1em; padding-left: 0.5em;" class="search_highlights">
+ <div style="padding-top: 1em; padding-left: 0.5em; padding-bottom: 0.5em;" class="search_highlights">
{% for highlight in paper._highlights %}
{{ highlight|safe }} ...
{% endfor %}
</div>
{% elif paper.abstract %}
- <div style="padding-top: 1em; padding-left: 0.5em;">
+ <div style="padding-top: 1em; padding-left: 0.5em; padding-bottom: 0.5em;">
{% if paper.abstract[0]|length > 500 %}
{{ paper.abstract[0][:500] }}...
{% else %}
{{ paper.abstract[0][:500] }}...
{% endif %}
</div>
+ {% else %}
+ <br>
{% endif %}
{# ### IDENTIFIERS #}
- {% if paper.doi or paper.pmid or paper.arxiv_id or paper.jstor_id %}
- <br>
- {% endif %}
{% if paper.doi %}
<a href="https://doi.org/{{paper.doi }}" style="color: green;">doi:{{ paper.doi }}</a> &nbsp;
{% endif %}
{% if paper.pmid %}
<a href="https://www.ncbi.nlm.nih.gov/pubmed/{{paper.pmid }}" style="color: green;">pmid:{{ paper.pmid }}</a> &nbsp;
{% endif %}
+ {% if paper.pmcid %}
+ <a href="https://pubmed.ncbi.nlm.nih.gov/{{paper.pmcid }}/" style="color: green;">pmcid:{{ paper.pmcid }}</a> &nbsp;
+ {% endif %}
{% if paper.arxiv_id %}
<a href="https://arxiv.org/abs/{{paper.arxiv_id }}" style="color: green;">arXiv:{{ paper.arxiv_id }}</a> &nbsp;
{% endif %}
- {% if False %} {# XXX: elastic release work grouping searches #}
- <br>
- <a href="/work/{{ paper.work_id }}"><i class="sitemap icon"></i> and 5 other versions of the same work!</a>
+ {% if paper.fatcat_ident %}
+ <a href="https://fatcat.wiki/release/{{paper.fatcat_ident}}" style="color: green;">fatcat:{{ paper.fatcat_ident}}</a> &nbsp;
{% endif %}
+
+ {# ### SOURCE TAGS #}
+ <div style="margin-top: 0.2em;">
+ {% if paper.cord19_uid or 'cord19' in paper.source_tags %}
+ <a href="https://pages.semanticscholar.org/coronavirus-research">
+ <span class="ui label small">CORD-19</span>
+ </a>
+ {% endif %}
+ {% if 'fatcat' in paper.source_tags %}
+ <a href="https://fatcat.wiki">
+ <span class="ui label small">fatcat</span>
+ </a>
+ {% endif %}
+ {% if 'who' in paper.source_tags %}
+ <a href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019/global-research-on-novel-coronavirus-2019-ncov">
+ <span class="ui blue label small">WHO</span>
+ </a>
+ {% endif %}
+ {% if 'wanfang' in paper.source_tags %}
+ <a href="http://subject.med.wanfangdata.com.cn/Channel/7">
+ <span class="ui olive label small">Wanfang</span>
+ </a>
+ {% endif %}
+ {% if 'cnki' in paper.source_tags %}
+ <a href="http://en.gzbd.cnki.net/GZBT/brief/Default.aspx">
+ <span class="ui brown label small">CNKI</span>
+ </a>
+ {% endif %}
+ {# olive, brown, grey, pink, red, etc #}
+ </div>
+
</div>
<div class="three wide left aligned column" style="padding: 1em;">
{% if paper.fulltext.thumbnail_url %}
<a href="{{ config.COVID19_FULLTEXT_HOST }}{{ paper.fulltext.pdf_url.replace('//', '/') }}">
<img src="{{ config.COVID19_FULLTEXT_HOST }}{{ paper.fulltext.thumbnail_url.replace('//', '/') }}" style="border: 1px solid grey; max-height: 12em; max-width: 100%;">
</a>
+ <br>
{% else %}
{# No Fulltext #}
{% endif %}
@@ -149,12 +201,12 @@
{% if found.offset > 0 %}
{% if found.offset - found.limit < 0 %}
- <a href="{{ url_for(endpoint, q=found.query.q, offset=0) }}">&#xab; Previous</a>
+ <a href="{{ url_for(endpoint, q=found.query.q, offset=0) }}">&#xab; {{ _("Previous") }}</a>
{% else %}
- <a href="{{ url_for(endpoint, q=found.query.q, offset=found.offset - found.limit) }}">&#xab; Previous</a>
+ <a href="{{ url_for(endpoint, q=found.query.q, offset=found.offset - found.limit) }}">&#xab; {{ _("Previous") }}</a>
{% endif %}
{% else %}
- <span style="color:gray">&#xab; Previous</span>
+ <span style="color:gray">&#xab; {{ _("Previous") }}</span>
{% endif %}
&nbsp;&nbsp;<i>Showing results {{ found.offset }} &mdash; {{ found.offset +
@@ -163,7 +215,7 @@ found.count_returned }} out of {{ found.count_found }} results</i>&nbsp;&nbsp;
{% if found.offset + found.limit < found.count_found and found.offset + found.limit < found.deep_page_limit %}
<a href="{{ url_for(endpoint, q=found.query.q, offset=found.offset + found.limit) }}">Next &#xbb;</a>
{% else %}
- <span style="color:gray">Next &#xbb;</span>
+ <span style="color:gray">{{ _("Next") }} &#xbb;</span>
{% endif %}
{%- endmacro %}