aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_covid19/templates/entity_macros.html
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-04-02 16:14:22 -0700
committerBryan Newbold <bnewbold@archive.org>2020-04-02 16:14:22 -0700
commitcbfa0d9e1ed1dca6fa34f134cf81d4dd8a0a99f8 (patch)
tree79da5f6715b1f3b2bdf46ffe7fe3b7cff74b84ca /fatcat_covid19/templates/entity_macros.html
parentd87b5392ede1e191448cf053ca27ad7cac5c2297 (diff)
downloadfatcat-covid19-cbfa0d9e1ed1dca6fa34f134cf81d4dd8a0a99f8.tar.gz
fatcat-covid19-cbfa0d9e1ed1dca6fa34f134cf81d4dd8a0a99f8.zip
webface: refactoring of style
Diffstat (limited to 'fatcat_covid19/templates/entity_macros.html')
-rw-r--r--fatcat_covid19/templates/entity_macros.html92
1 files changed, 67 insertions, 25 deletions
diff --git a/fatcat_covid19/templates/entity_macros.html b/fatcat_covid19/templates/entity_macros.html
index 9cded8a..66f0eb2 100644
--- a/fatcat_covid19/templates/entity_macros.html
+++ b/fatcat_covid19/templates/entity_macros.html
@@ -1,8 +1,28 @@
{% macro fulltext_search_result_row(paper) -%}
-<div>
- <h4 style="margin-top: 1em; margin-bottom: 0px; font-size: 1.1em;">
- <a href="/release/{{ paper.ident }}" style="color: #2224c7;">
+<div class="row">
+<div class="four wide right aligned column" style="padding: 1em;">
+ {% if paper.fulltext.t_thumbnail_url %}
+ <a href="{{ config.COVID19_FULLTEXT_HOST }}{{ paper.fulltext.pdf_url.replace('//', '/') }}">
+ <img src="{{ config.COVID19_FULLTEXT_HOST }}{{ paper.fulltext.t_thumbnail_url.replace('//', '/') }}" style="border: 1px solid grey; max-height: 12em;">
+ </a>
+ {% else %}
+ No Fulltext
+ {% endif %}
+</div>
+<div class="twelve wide column">
+ {# ### TITLE ROW #}
+ <h4 style="margin-top: 1em; margin-bottom: 0px; font-size: 1.2em;">
+
+ {# "best URL" calculation #}
+ {% if paper.pmcid %}
+ <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/{{ paper.pmcid }}/"
+ {% elif paper.pmid %}
+ <a href="https://pubmed.ncbi.nlm.nih.gov/{{ paper.pmid }}/"
+ {% else %}
+ <a href="https://fatcat.wiki/release/{{ paper.fatcat_ident }}"
+ {% endif %}
+ style="color: #2224c7;">
{% if paper.title %}
{{ paper.title[:512] }}
{% if paper.title|length > 512 %}...{% endif %}
@@ -10,53 +30,74 @@
[blank]
{% endif %}
</a>
+
+ {% 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>
+ {% elif not paper.release_type %}
+ <b style="text-transform: uppercase; color: red;">[media?]</b>
+ {% else %}
+ <b style="text-transform: uppercase;">[{{ paper.release_type }}]</b>
+ {% endif %}
</h4>
+ <div style="float: right; padding: 4px;">
+ &nbsp;&nbsp;<a href="{{ config.ELASTICSEARCH_BACKEND }}/{{ config.ELASTICSEARCH_FULLTEXT_INDEX }}/release/{{ paper.fatcat_ident }}" class="ui grey tag label"><i class="file icon"></i>json</a>
+ </div>
{% if paper.best_pdf_url %}
<div style="float: right; padding: 4px;">
&nbsp;&nbsp;<a href="{{ paper.best_pdf_url }}" class="ui violet tag label"><i class="file icon"></i>fulltext</a>
</div>
{% endif %}
- {#
- <h5 style="margin-top: 4px; margin-bottom: 4px; font-size: 1em;">{{ ", ".join(paper.contrib_names[:12]) }}
- {% if paper.contrib_names|length > 12 %}<i>(+{{ paper.contrib_names|length - 12 }} others)</i>{% endif %}
- </h5>
- #}
+
+
+ {# ### AUTHOR ROW #}
{% if paper.contrib_names %}
- <div style="margin-top: 0px; margin-bottom: 0px; font-size: 1em;">
+ <div style="margin-top: 0.1em; margin-bottom: 0.1em; font-size: 1.1em;">
<b>
{{ ", ".join(paper.contrib_names[:12]) }}
{% if paper.contrib_names|length > 12 %}<i>(+{{ paper.contrib_names|length - 12 }} others)</i>{% endif %}
</b>
</div>
{% endif %}
+
+
+ {# ### JOURNAL ROW #}
{% if paper.release_year %}
{{ paper.release_year }}
{% endif %}
- {% if paper.release_type %}
- {% if paper.release_type in ("article-journal", "paper-conference") %}
- <span class="ui black basic label small">{{ paper.release_type }}</span>
- {% elif paper.release_type in ("book") %}
- <span class="ui brown basic label small">{{ paper.release_type }}</span>
+ {% if paper.release_year and paper.container_name %}
+ |
+ {% endif %}
+ {% if paper.container_name %}
+ {% if paper.container_id %}
+ <a href="https://fatcat.wiki/container/{{ paper.container_id }}" style="color: black;">{{ paper.container_name }}</a>
{% else %}
- <span class="ui grey basic label small">{{ paper.release_type }}</span>
+ {{ paper.container_name }}
{% endif %}
+ {% if paper.container_is_oa %}<i class="icon unlock orange small"></i>{% endif %}
{% endif %}
{% if paper.withdrawn_status %}
- <span class="ui red label small">{{ paper.withdrawn_status }}</span>
+ <b style="color: red;"><code>[{{ paper.withdrawn_status }}]</code></b>
{% endif %}
{% if paper.release_stage and paper.release_stage != "published" %}
- <span class="ui pink basic label small">{{ paper.release_stage }}</span>
+ <b style="color: pink;"><code>[{{ paper.release_stage }}]</code></b>
{% elif not paper.release_stage %}
- <span class="ui red basic label small">unknown</span>
+ <b style="color: red;"><code>[unpublished?]</code></b>
{% endif %}
- {% if paper.container_name %}
- {% if paper.container_id %}
- <a href="/container/{{ paper.container_id }}" style="color: black;">{{ paper.container_name }}</a>
- {% else %}
- {{ paper.container_name }}
- {% endif %}
- {% if paper.container_is_oa %}<i class="icon unlock orange small"></i>{% endif %}
+
+ {# ### ABSTRACT / QUERY HIGHLIGHT #}
+ {% if paper.abstract %}
+ <div style="padding: 1em;">
+ {% if paper.abstract[0]|length > 500 %}
+ {{ paper.abstract[0][:500] }}...
+ {% else %}
+ {{ paper.abstract[0][:500] }}...
+ {% endif %}
+ </div>
{% endif %}
+
+ {# ### IDENTIFIERS #}
{% if paper.doi or paper.pmid or paper.arxiv_id or paper.jstor_id %}
<br>
{% endif %}
@@ -74,6 +115,7 @@
<a href="/work/{{ paper.work_id }}"><i class="sitemap icon"></i> and 5 other versions of the same work!</a>
{% endif %}
</div>
+</div>
{% endmacro %}