{% if 'contacts' in components %}

Contacts {% if contacts %} {{ contacts|length }} {% endif %}

{% if contacts %}
{% for contact in contacts %}

{{ contact.titre }} {{ contact.prenom }} {{ contact.marital }} {{ contact.nom }}

{% if contact.nature == "ayantdroit" %} Ayant-droit {% else %} {{ contact.nature|capitalize }} {% endif %}
{# Construction de l'adresse en filtrant les champs vides #} {% set adresse_parts = [ contact.adresse1, contact.adresse2, contact.cp, contact.ville ]|filter(v => v) %} {% if adresse_parts %}

{{ adresse_parts|join(' ') }}

{% if contact.telephone1 %}

{{ contact.telephone1 }}

{% endif %} {% if contact.telephone2 %}

{{ contact.telephone2 }}

{% endif %} {% if contact.telephone1 is empty and contact.telephone2 is empty %}

Aucun n⁰ de tél.

{% endif %} {% if contact.courriel %}

{{ contact.courriel }}

{% else %}

Aucun courriel

{% endif %} {% else %}

Aucune adresse

{% endif %}
{% endfor %}
{% else %}

Aucun contact

{% endif %}
{% endif %}