{#
    Copyright (C) 2020 Zenodo
    Copyright (C) 2020 TUGRAZ

    invenio-theme-iform is free software; you can redistribute it and/or
    modify it under the terms of the MIT License; see LICENSE file for more
    details.
  #}

{%- macro creators (authors_list) %}

    {%- for creators in authors_list %}

        {%- if creators.identifiers and creators.identifiers.orcid %}
            <a href="{{ creators.identifiers.orcid|pid_url('orcid') }}" target="_blank"
                ><img
                    class="inline-orcid"
                    src="{{ url_for('static', filename='extra/orcid.png') }}"
            /></a>
        {%- endif %}

        <span
            class="text-muted"
            {% if creators.affiliations %}{% for affiliation in creators.affiliations %}
                data-tooltip="{{ affiliation.name }}" data-inverted=""
            {%- endfor %}{% endif %}
            >{{ creators.person_or_org.name }}</span
        >
        {% if not loop.last %};{% endif %}
    {%- endfor %}
{%- endmacro %}

<!--TODO: contributers-->
{%- macro contributors(contributors_list) %}
    {%- for group in contributors_list|groupby('type') %}
        <h5>{{ group.grouper }}(s)</h5>
        {{ authors(group.list) }}
    {%- endfor %}
{%- endmacro %}
