{% macro fulltext_search_result_row(paper) -%}
{# ### TITLE ROW #}

{# "best URL" calculation #} {% if paper.pmcid %} {% 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 %} [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 %} [media?] {% else %} [{{ _(paper.release_type) }}] {% 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 %}
{{ paper.title[:512] }} {% if paper.title|length > 512 %}...{% endif %} {% elif paper.original_title and paper.title != paper.original_title %}
{{ paper.original_title[:512] }} {% if paper.original_title|length > 512 %}...{% endif %} {% endif %}

{#
  json
{% if paper.best_pdf_url %}
  fulltext
{% endif %} #} {# ### AUTHOR ROW #} {% if paper.contrib_names %}
{{ ", ".join(paper.contrib_names[:12]) }} {% if paper.contrib_names|length > 12 %}(+{{ paper.contrib_names|length - 12 }} others){% endif %}
{% endif %} {# ### JOURNAL ROW #} {% if paper.release_year %} {{ paper.release_year }} {% endif %} {% if paper.release_year and paper.container_name %} | {% endif %} {% if paper.container_name %} {% if paper.container_id %} {{ paper.container_name }} {% else %} {{ paper.container_name }} {% endif %} {% if paper.container_is_oa %}{% 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 %} [unpublished?] {% endif %} {# ### ABSTRACT / QUERY HIGHLIGHT #} {% if paper._highlights %}
{% for highlight in paper._highlights %} {{ highlight|safe }} ... {% endfor %}
{% elif paper.abstract %}
{% if paper.abstract[0]|length > 500 %} {{ paper.abstract[0][:500] }}... {% else %} {{ paper.abstract[0][:500] }}... {% endif %}
{% else %}
{% endif %} {# ### IDENTIFIERS #} {% if paper.doi %} doi:{{ paper.doi }}   {% endif %} {% if paper.pmid %} pmid:{{ paper.pmid }}   {% endif %} {% if paper.pmcid %} pmcid:{{ paper.pmcid }}   {% endif %} {% if paper.arxiv_id %} arXiv:{{ paper.arxiv_id }}   {% endif %} {% if paper.fatcat_ident %} fatcat:{{ paper.fatcat_ident}}   {% endif %} {# ### SOURCE TAGS #}
{% if paper.cord19_uid or 'cord19' in paper.source_tags %} CORD-19 {% endif %} {% if 'fatcat' in paper.source_tags %} fatcat {% endif %} {% if 'who' in paper.source_tags %} WHO {% endif %} {% if 'wanfang' in paper.source_tags %} Wanfang {% endif %} {% if 'cnki' in paper.source_tags %} CNKI {% endif %} {# olive, brown, grey, pink, red, etc #}
{% if paper.fulltext.thumbnail_url %}
{% else %} {# No Fulltext #} {% endif %}
{% endmacro %} {% macro top_results(found) -%} Showing {% if found.offset == 0 %} first {% else %} results {{ found.offset }} — {% endif %} {{ found.offset + found.count_returned }} out of {{ found.count_found }} results {%- endmacro %} {% macro bottom_results(found, endpoint='search.fulltext_search') -%} {% if found.offset > 0 %} {% if found.offset - found.limit < 0 %} « {{ _("Previous") }} {% else %} « {{ _("Previous") }} {% endif %} {% else %} « {{ _("Previous") }} {% endif %}   Showing results {{ found.offset }} — {{ found.offset + found.count_returned }} out of {{ found.count_found }} results   {% if found.offset + found.limit < found.count_found and found.offset + found.limit < found.deep_page_limit %} Next » {% else %} {{ _("Next") }} » {% endif %} {%- endmacro %}