{# templates/contributor/index.html.twig #} {% extends 'base.html.twig' %} {% block title %}Liste des contributeurs{% endblock %} {% block body %}

{% if app.request.get('point-relay') == 'off' %} Contributeurs sans Point Relais {% elseif app.request.get('shipped') == 'on' %} Liste des contributeurs traités {% else %} Liste des contributeurs en attente {% endif %} {% if current_search %} - Recherche : "{{ current_search }}" {% endif %}

{% set currentParams = app.request.query.all %} {% set isPointRelayOff = currentParams['point-relay'] is defined and currentParams['point-relay'] == 'off' %} {% set isShippedOn = currentParams['shipped'] is defined and currentParams['shipped'] == 'on' %}
{% if not isPointRelayOff %} Contributeurs sans Point Relais {% endif %} {% if not isShippedOn %} Contributeurs traités {% endif %} {% if isPointRelayOff or isShippedOn %} Contributeurs en attente d'envoi {% endif %}
{# Barre de recherche #}
{# Conserver les paramètres de filtre existants #} {% if app.request.get('point-relay') %} {% endif %} {% if app.request.get('shipped') %} {% endif %}
{% if current_search %} Effacer {% endif %}
{% if app.request.get('point-relay') == 'off' %}

{{ contributors.getTotalItemCount }} contributeur(s) sans point relais spécifié {% if current_search %} correspondant à "{{ current_search }}"{% endif %}.

{% endif %} {% if current_search and contributors.getTotalItemCount == 0 %}

Aucun résultat trouvé pour "{{ current_search }}". Effacer la recherche

{% endif %}
{% for contributor in contributors %} {% else %} {% endfor %}
Contributeur Livraison Point Relais Téléphone Contrepartie Poids Statut Actions
{% if current_search %} {{ (contributor.deliveryFirstName ~ ' ' ~ contributor.deliveryLastName)|replace({(current_search): '' ~ current_search ~ ''})|raw }} {% else %} {{ contributor.deliveryFirstName }} {{ contributor.deliveryLastName }} {% endif %}
{% if current_search %} {{ contributor.name|replace({(current_search): '' ~ current_search ~ ''})|raw }} {% else %} {{ contributor.name }} {% endif %}
{% if current_search %} {{ contributor.email|replace({(current_search): '' ~ current_search ~ ''})|raw }} {% else %} {{ contributor.email }} {% endif %}
{% if contributor.deliveryAddress %} {{ contributor.deliveryFirstName }} {{ contributor.deliveryLastName }}
{{ contributor.deliveryAddress }} {% if contributor.deliveryAddress2 %}
{{ contributor.deliveryAddress2 }}{% endif %}
{{ contributor.deliveryPostalCode }} {{ contributor.deliveryCity }}
{{ contributor.deliveryCountry }} {% else %} {{ contributor.address }}
{{ contributor.postalCode }} {{ contributor.city }}
{{ contributor.country }} {% endif %}
{% if contributor.relayName %} {{ contributor.relayName }}
{{ contributor.relayAddress }}
ID: {{ contributor.relayId }} {% else %} Non spécifié {% endif %}
{{ contributor.deliveryPhone ?? contributor.phone }} {% for reward in contributor.rewards %}
{{ reward.title }} {% if reward.variation %}({{ reward.variation }}){% endif %} x{{ reward.quantity }}
{% endfor %}
{{ contributor.totalWeight|number_format(0) }}g {% if contributor.totalWeight > 1000 %}
({{ (contributor.totalWeight / 1000)|number_format(1) }}kg) {% endif %}
{% if contributor.shipped %} Envoi créé #{{ contributor.trackingNumber }} {% else %} En attente {% endif %} {% if not contributor.shipped %} {% if contributor.relayName %} Créer un envoi {% else %} Mettre à jour RelayID {% endif %} {% else %} {% endif %}
{% if current_search %} Aucun contributeur trouvé pour "{{ current_search }}" {% elseif app.request.get('point-relay') == 'off' %} Aucun contributeur sans point relais trouvé {% else %} Aucun contributeur trouvé {% endif %}
{# Contrôles de pagination #}
{{ knp_pagination_render(contributors) }}
{# Affichage du nombre total d'éléments #}
{% if current_search %} {% if app.request.get('point-relay') == 'off' %} {{ contributors.getTotalItemCount }} contributeur(s) sans point relais trouvé(s) pour "{{ current_search }}" {% else %} {{ contributors.getTotalItemCount }} contributeur(s) trouvé(s) pour "{{ current_search }}" {% endif %} {% else %} {% if app.request.get('point-relay') == 'off' %} Total : {{ contributors.getTotalItemCount }} contributeur(s) sans point relais {% else %} Total : {{ contributors.getTotalItemCount }} contributeur(s) {% endif %} {% endif %}
{% endblock %}