{% extends admin.getTemplate('base_list_field') %}
{% block field %}
    {%- spaceless %}
    {% if object.prestataire is not null %}
        <a class="sonata-link-identifier" href="{{ path('prestataire_edit', {'id': object.prestataire.id}) }}">
            <span>Presta : {{ object.prestataire }}</span>
        </a>
    {% elseif object.adherent is not null %}
        <a class="sonata-link-identifier" href="{{ path('adherent_edit', {'id': object.adherent.id}) }}">
            Adh : {{ object.adherent }}
        </a>
    {% else %}
        {% if object.prestataire is null and object.adherent is null and object.flux is null and not object.historical %}
            <a class="sonata-action-element btn btn-sm btn-primary helloassoAssociateButton" data-url="{{path('helloasso_associate', {'id': object.id})}}" data-date="{{ object.createdAt|date('d/m/Y H:i') }}" data-amount="{{ object.amount }}" data-payer="{{ object.fullpayer }}" data-user="{{ object.fulluser }}" data-type="{{ object.type }}" href="#">
                <i class="fa fa-share-square-o"></i> {{ "Associer"|trans() }}
            </a>
        {% endif %}
    {% endif %}
{% endspaceless -%}
{% endblock %}
