<thead class="thead-dark">
	<tr>
		<th scope="col" width="">{{ 'Nom' | trad }}</th>
		<th scope="col" width="">{{ 'Société' | trad }}</th>
		<th scope="col" width="">
            <a class="ajouter_v2  white-tooltip" style="float:right;font-weight:normal;"
                onclick="contributorsList('{{group.GROUPE_CONTRIB}}');">
                {# href="{{ path('Consultation.Contributor.contributorsListForGroup', {idAO: idAO, group: groupName}) }}"> #}
                <span class="infos_tooltip left">
                    {{ 'Ajouter contributeur' | trad }}
                </span>
            </a>
		</th>
	</tr>
</thead>
{% if group.contributors | length > 0 %}
	{% for contributor in group.contributors %}
		<tbody>
			<tr id="contributor_{{ loop.index }}">
				<td>{{ contributor.NOM }}</td>
				<td>{{ contributor.CODE_STE }}</td>
				<td align="right">
                    <div class="icone">
                        {{ hover_action(
                            'contributor_' ~ loop.index, 
                            'Supprimer_v2', 
                            "popupConfirmation(
                                '" ~ path('Ajax.Erreur.popupConfirmationGestion') ~ "', 
                                '', '',
                                '" ~ contributor.deleteMessage|e('js')|raw ~ "',
                                'redirect', '" ~ contributor.CONTRIB ~ "', '', '', '', 'removeContributor', '', '', '', '', 
                                '" ~ ('Suppression contributeur' | trad |e('js')|raw) ~ "'
                            )",
                            'float: right;margin-right:5px;'
                        ) }}
                    </div>
				</td>
			</tr>
		</tbody>
	{% endfor %}
{% endif %}
<script>
    function removeContributor(contrib) {
        activeLoader();
        $.ajax({
            url: {{ path(
                'Consultation.GroupOfContributors.removeContributorFromGroup',
                {idAO: idAO, group: group.GROUPE_CONTRIB}
            ) | json }},
            type: 'POST',
            data: {'contributor': contrib},
            dataType: 'html',
            success: function (data) {
                desactiveLoader();
                $("#divParam").html(data);
            },
        });
    }
    {# function contributorsList(groupName) {
        activeLoader();
        $.ajax({
            url: {{ path(
                'Consultation.Contributor.contributorsListForGroup',
                {idAO: idAO, group: groupName}
            ) | json }},
            type: 'POST',
            data: {'group': groupName},
            dataType: 'html',
            success: function (data) {
                desactiveLoader();
                $("#divParam").html(data);
            },
        });
    } #}
</script>
