{% macro tag_label(tag) -%} {% if tag == "oa" %} {% trans %}Open Access{% endtrans %} {% 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 == "multiple-versions" %} {% trans %}Multiple Versions{% endtrans %} {% 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 ia_access_button(access, show_thumbnail=False, other_version=False) -%} {% if access.file_mimetype == "application/pdf" %} {% set access_alt = _('fulltext PDF download') %} {% elif access.access_type == "ia_sim" %} {% set access_alt = _('read fulltext microfilm') %} {% else %} {% set access_alt = _('fulltext access') %} {% endif %} {% if other_version %} {% set access_alt = access_alt + " [" + other_version + "]" %} {% endif %} {% endmacro %} {% macro doi_access_button(paper, is_oa=False) %} {% if paper.biblio and paper.biblio.doi %} {% endif %} {% endmacro %} {% macro platform_access_button(biblio) %} {# TODO: DOAJ #} {% if biblio.arxiv_id %} {% elif biblio.pmcid %} {% endif %} {% endmacro %} {% macro journal_row(biblio, paper) -%} {# NOTE: should be able to call with paper.biblio or any paper.release[] #} {% if biblio.release_year %} {% trans year=biblio.release_year %}{{ year }}{% endtrans %} {% 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, debug_mode=False, expand=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 %}
{% endif %} {# ### IDENTIFIERS #} {{ external_identifiers(paper.biblio) }}
{# ### ACCESS LINKS #} {# archive links (if available) #} {% if paper.fulltext and paper.fulltext.access_url %} {% if (paper.fulltext.release_ident and paper.fulltext.release_ident != paper.biblio.release_ident) %} {% set other_version = _("not primary version") %} {% else %} {% set other_version = "" %} {% endif %} {{ ia_access_button(paper.fulltext, show_thumbnail=True, other_version=other_version) }} {% endif %} {# publisher / repository #} {{ doi_access_button(paper, is_oa=("oa" in paper.tags)) }} {# trusted platform fulltext links #} {{ platform_access_button(paper.biblio) }} {# ### COLLAPSED HITS #} {% if paper._collapsed_count and paper._collapsed_count > 0 %} {% endif %} {# ### OTHER ACTIONS #}
{# final row close #} {% endmacro %} {% macro search_pagination(hits, locale) %} {% if hits.offset > 0 %} {% else %} {% trans %}« Previous{% endtrans %} {% endif %} {% if hits.offset + hits.limit < hits.count_found %} {% else %} {% trans %}Next »{% endtrans %} {% endif %} {% trans trimmed start=babel_numbers.format_decimal(hits.offset + 1, locale=locale), end=babel_numbers.format_decimal([hits.offset + hits.limit, hits.count_found]|min, locale=locale), total=babel_numbers.format_decimal(hits.count_found, locale=locale) %} Showing results {{ start }} — {{ end }} out of {{ total }} results {% endtrans %} {% endmacro %} {% macro query_option(options, selected) -%}


{% endmacro %} {% macro clear_query(query) -%} {% if query.filter_time or query.filter_type or query.filter_availability or query.sort_order %}
{% trans %}Clear Filters{% endtrans %}

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