{% extends admin.getTemplate('base_list_field') %}
{% block field %}
    <div>
	    {# {% if object is instanceof("App\\Entity\\Operation") %} #}
    	{% set objectFlux = null %}
    	{% if field_description.label|lower == 'expediteur' %}
    		{% if object.flux is not null %}
    			{% set objectFlux = object.account.accountableObject == object.flux.expediteur ? null : object.flux.expediteur %}
    		{% endif %}
    	{% elseif field_description.label|lower == 'destinataire' %}
    		{% if object.flux is not null %}
    			{% set objectFlux = object.account.accountableObject != object.flux.destinataire ? null : object.flux.destinataire %}
    		{% endif %}
    	{% elseif field_description.label|lower matches '/^Compte (groupe|comptoir|adherent|prestataire)/i' %}
    		{% set objectFlux = object.account.accountableObject %}
	    {% endif %}
	    {% if objectFlux is not null %}
	        {% if objectFlux is instanceof("App\\Entity\\Adherent") %}
				{% set name = 'Adherent' %}
				{% set editRoute = 'adherent_edit' %}
			{% elseif objectFlux is instanceof("App\\Entity\\Prestataire") %}
				{% set name = 'Prestataire' %}
				{% set editRoute = 'prestataire_edit' %}
			{% elseif objectFlux is instanceof("App\\Entity\\Comptoir") %}
				{% set name = 'Comptoir' %}
				{% set editRoute = 'comptoir_edit' %}
			{% elseif objectFlux is instanceof("App\\Entity\\Groupe") %}
				{% set name = 'Groupe' %}
				{% set editRoute = 'admin_app_groupe_edit' %}
			{% else %}
				{% set name = '' %}
				{% set editRoute = '' %}
			{% endif %}

		    {% if editRoute != '' %}
		        <a class="sonata-link-identifier" href="{{ path(editRoute, {'id': objectFlux.id}) }}">
		            {{ name ? '('~name~') ' }}{{ value }}
		        </a>
	    	{% else %}
		        {{ value }}
	    	{% endif %}
	    {% endif %}
    </div>
{% endblock %}