{% macro fatcat_bits(entity, entity_type, expand="", editgroup=None) -%} {% if entity.state == None and editgroup %}
{% if editgroup.changelog_index %} Accepted Edit Version

This is the version of the entity as of a specific merged editgroup: {% elif editgroup.submitted %} Submitted Edit Version

This is a version of the entity that has been submitted for approval as part of an editgroup: {% else %} Edit In Progress

This is a version of the entity that has not yet been submitted for approval, part of an editgroup: {% endif %} {{ editgroup.editgroup_id }}

{% elif entity.state == None and entity.ident == None %}
Revision

This is a specific, static metadata record, not necessarily linked to any current entity in the catalog.

{% elif entity.state == "wip" %}
Work In Progress

This entity has not been "accepted" into the official database yet.

{% endif %}
Fatcat Bits

{% if entity.state %} State is "{{ entity.state }}". {% endif %} {% if entity.state != "deleted" %} Revision:
{{ entity.revision }} {% endif %}
As JSON object via API

Edit Metadata View History
{%- endmacro %} {% macro extra_metadata(extra) -%} {% for (key, value) in extra.items()|sort %} {% if key in ("ia", "crossref", "kbart", "arxiv", "jstor", "pubmed") and value is mapping and value %} {% for (inner_key, inner_value) in value.items()|sort %}
{{ key }}.{{ inner_key }} {{ inner_value }} {% endfor %} {% elif key in ("urls", "webarchive_urls") and value and value is iterable and value is not string and value[0] is string %}
{{ key }} {% for u in value %} {{ u }}
{% endfor %}
{% else %}
{{ key }} {% if value != None %}{{ value }}{% endif %} {% endif %} {% endfor %}
{%- endmacro %} {% macro release_list(releases) -%} {% for release in releases %}
{% if release.release_date %}{{ release.release_date }}{% elif release.release_year %}{{ release.release_year }}{% else %}unknown{% endif %} {{ release.title }}
{{ release.release_stage or "unknown status" }} | {{ release.release_type or "unknown type" }} {% if release.version %} | {{ release.version }}{% endif %} {% if release.license_slug %} | {{ release.license_slug }}{% endif %} {% if release.ext_ids.doi %}
doi:{{ release.ext_ids.doi }} {% endif %} {% endfor %}
{%- endmacro %} {% macro url_list(urls) -%} {% for url in urls %}
{{ url.rel }} {% if url.url.count('/') >= 3 and url.rel != "dweb" %} {{ '/'.join(url.url.split('/')[0:2]) }}/{{ ''.join(url.url.split('/')[2]) }}/{{ '/'.join(url.url.split('/')[3:]) }} {% else %} {{ url.url }} {% endif %} {% endfor %}
{%- endmacro %} {% macro lookup_form(entity_type, key, example, lookup_key, lookup_value, lookup_error) -%} {%- endmacro %} {% macro release_search_result_row(paper) -%}

{% if paper.title %} {{ paper.title[:512] }} {% if paper.title|length > 512 %}...{% endif %} {% else %} [blank] {% endif %}

{% if paper.best_pdf_url %}
  fulltext
{% endif %} {#
{{ ", ".join(paper.contrib_names[:12]) }} {% if paper.contrib_names|length > 12 %}(+{{ paper.contrib_names|length - 12 }} others){% endif %}
#} {% if paper.contrib_names %}
{{ ", ".join(paper.contrib_names[:12]) }} {% if paper.contrib_names|length > 12 %}(+{{ paper.contrib_names|length - 12 }} others){% endif %}
{% endif %} {% if paper.release_year %} {{ paper.release_year }} {% endif %} {% if paper.release_type %} {% if paper.release_type in ("article-journal", "paper-conference") %} {{ paper.release_type }} {% elif paper.release_type in ("book") %} {{ paper.release_type }} {% else %} {{ paper.release_type }} {% 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 %} unknown {% 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.doi or paper.pmid or paper.arxiv_id or paper.jstor_id %}
{% endif %} {% if paper.doi %} doi:{{ paper.doi }}   {% endif %} {% if paper.pmid %} pmid:{{ paper.pmid }}   {% endif %} {% if paper.arxiv_id %} arXiv:{{ paper.arxiv_id }}   {% endif %} {% if False %} {# XXX: elastic release work grouping searches #}
and 5 other versions of the same work! {% endif %}
{% endmacro %} {% macro progress_color(frac) -%} {% if frac >= 1 %} green {% elif frac > 0.95 %} olive {% elif frac < 0.5 %} red {% else %} yellow {% endif %} {%- endmacro %}