{% macro tag_label(tag) -%} {% if tag == "oa" %} OA {% elif tag == "jstor" %} JSTOR {% elif tag == "scielo" %} SciELO {% elif tag == "ojs" %} OJS {% elif tag == "wordpress" %} Wordpress {% elif tag == "road" %} {# skip for now; no curration? #} {# ROAD #} {% elif tag == "szczepanski" %} Szczepanski {% elif tag == "doaj" %} DOAJ {% elif tag.startswith("lang:") %} {{ tag }} {% else %} {# disabling "other" tags for now #} {# {{ _(tag) }} #} {% 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 or biblio.ident %} fatcat:{{ biblio.release_ident or biblio.ident }}   {% endif %} {% endmacro %} {% macro journal_row(biblio, paper) -%} {# NOTE: should be able to call with paper.biblio or any paper.release[] #} {% if biblio.release_year %} {{ biblio.release_year }} {% endif %} {% if biblio.container_name %} {% if biblio.container_ident %} {{ biblio.container_name }} {% elif paper.doc_type == "sim_page" %} {{ biblio.container_name }} {% else %} {{ biblio.container_name }} {% endif %}   {% endif %} {% if biblio.release_stage == "submitted" %} pre-print {% elif biblio.release_stage and biblio.release_stage != "published" %} {{ biblio.release_stage }} {% elif not biblio.release_stage %} unpublished {% endif %} {% if biblio.withdrawn_status %} {{ biblio.withdrawn_status }} {% endif %} {% endmacro %} {% macro fulltext_search_result_row(paper, locale=None, debug_mode=False) -%}
{# ### TITLE ROW #}

{% if paper.doc_type == "work" %} {% if paper.biblio.title %} {{ paper.biblio.title[:512] }} {% if paper.biblio.title|length > 512 %}...{% endif %} {% else %} [blank] {% endif %} {# release type suffix #} {% if paper.biblio.release_type in ("article-journal", "paper-conference") or paper.doc_type == "sim_page" %} {# pass #} {% elif paper.biblio.release_type in ("book", "chapter", "dataset") %} [{{ _(paper.biblio.release_type) }}] {% elif not paper.biblio.release_type %} [{{ _("unknown") }}] {% else %} [{{ _(paper.biblio.release_type) }}] {% endif %} {# show inverse of title/original_title above #} {% if paper.biblio.original_title and paper.biblio.title != paper.biblio.original_title %}
{{ paper.biblio.original_title[:512] }} {% if paper.biblio.original_title|length > 512 %}...{% endif %} {% endif %} {% elif paper.doc_type == "sim_page" %} {% trans page_num = paper.ia_sim.first_page, journal_name = paper.biblio.container_name, volume = paper.biblio.volume, issue = paper.biblio.issue %}Page {{ page_num }} of {{ journal_name }} Vol. {{ volume }}, Issue {{ issue }}{% endtrans %} [{{ _("page") }}] {% endif %}

{# ### AUTHOR ROW #} {% if paper.biblio.contrib_names %}
{{ ", ".join(paper.biblio.contrib_names[:12]) }} {% if paper.biblio.contrib_names|length > 12 %}(+{{ paper.biblio.contrib_names|length - 12 }} others){% endif %}
{% endif %} {# ### JOURNAL ROW #} {{ journal_row(paper.biblio, paper) }} {# ### ABSTRACT / QUERY HIGHLIGHT #} {% if paper._highlights %}
{# this highlight HTML escape hacking should not be necessary in ES 7.x with highlight escaping #} {# but for now we manually escape, then de-escape the 'em' highlight tags #} {% autoescape false %} {% for highlight in paper._highlights[:3] %} {{ highlight|e|replace("<em>", "")|replace("</em>", "") }}  ...  {% endfor %} {% endautoescape %}
{% elif paper.abstracts %}
{% if paper.abstracts[0].body|length > 500 %} {{ paper.abstracts[0].body | truncate(500, False, '') }}
{% trans %}more »{% endtrans %} ... {{ paper.abstracts[0].body[480:] }}
{% else %} {{ paper.abstracts[0].body }} {% endif %}
{% else %}
{% endif %} {# ### IDENTIFIERS #} {{ external_identifiers(paper.biblio) }}
{# ### TAGS #} {# colors to use: olive, brown, grey, pink, red, etc #} {# TODO: remove doc for ES 7.x-style lack of type #} {# TODO: only show 'json' link if from cluster? #} {% if debug_mode %} json {% endif %} {% for tag in paper.tags|sort %} {# HACK: don't show "oa" tag if already obvious #} {% if tag != "oa" or ("doaj" not in paper.tags and "szczepanski" not in paper.tags) %} {{ tag_label(tag) }} {% endif %} {% endfor %} {% if paper.biblio.lang_code and paper.biblio.lang_code != (locale or 'en') %} {{ tag_label("lang:" + paper.biblio.lang_code) }} {% endif %}
{# ### ACCESS LINKS #} {# archive links (if available) #} {% if paper.fulltext and paper.fulltext.access_url %} {% if paper.fulltext.file_mimetype == "application/pdf" %} {% set access_alt = _('fulltext PDF download') %} {% elif paper.fulltext.access_type == "ia_sim" %} {% set access_alt = _('read fulltext microfilm') %} {% else %} {% set access_alt = _('fulltext access') %} {% endif %} {% endif %} {# publisher #} {% if paper.biblio.doi %} {% endif %} {# trusted platform fulltext links #} {# TODO: DOAJ, dblp #} {% if paper.biblio.arxiv_id %} {% elif paper.biblio.pmcid %} {% endif %} {# ### VERSIONS #} {% if (paper.access and paper.access|length > 1) or (paper.releases and paper.releases|length > 1) %}
{% trans %}Other Versions{% endtrans %}
{% endif %} {# ### COLLAPSED HITS #} {% if paper._collapsed_count > 0 %} {% endif %} {# ### OTHER ACTIONS #} {# ### CITATION MODAL #} {% if paper.doc_type == "work" %}

{% trans %}Cite Work{% endtrans %}

Generic {{ paper._obj.biblio.citation_str("default") }}
BibTeX
{{ paper._obj.biblio.citation_str("bibtex") }}
{% endif %} {# ### VERSIONS MODAL #}

{% trans %}Access Options{% endtrans %}

{% if paper.fulltext and paper.fulltext.thumbnail_url %} fulltext thumbnail {% endif %} {% for access in paper.access %} {% if access.access_type == "ia_sim" %}

There is a digitized microfilm copy at archive.org. {% elif access.access_type == "ia_file" %}

There is a {{ access.mimetype }} file at archive.org. {% elif access.access_type == "wayback" %}

There is a {{ access.mimetype }} file in The Wayback Machine. {% else %}

Some other access here. {% endif %} {% endfor %} {% if paper.biblio.doi %}

You can visit the publisher landing page. {% endif %} {% if paper.releases|length > 1 %}

All Versions

{% for release in paper.releases %}
{{ journal_row(release, paper) }}
{{ external_identifiers(release) }}

{% endfor %} {% endif %}
{% endmacro %} {% macro search_pagination(hits, top) %} {% if hits.offset > 0 %} {% else %} « {% trans %}Previous{% endtrans %} {% endif %} {% trans trimmed start=(hits.offset + 1), end=(hits.offset + hits.limit), total="{:,}".format(hits.count_found) %} Showing results {{ start }} — {{ end }} out of {{ total }} results {% endtrans %} {% if hits.offset + hits.limit < hits.count_found %} {% endmacro %} {% macro query_option(options, selected) -%}

{% endmacro %} {% macro query_hidden(options, selected) -%} {% if selected %} {% endif %} {% endmacro %}