{% macro tag_label(tag) -%} {% if tag == "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 == "multiple-versions" %} {% 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 %} {% 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" %} [{{ ("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 > 550 %} {{ paper.abstracts[0].body | truncate(500, False, '') }}
... {{ paper.abstracts[0].body[500:] }}
{% 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 %} « {% endif %} {% if hits.offset + hits.limit < hits.count_found %} {% else %} » {% endif %} {% 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 %}

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