{% import '_includes/macros/status.html.twig' as statusTools %}
{% import '_includes/macros/date.html.twig' as dateTools %}
{% set hideActor=hideActor|default(false) %}

<table>
	<thead>
		<tr>
			<td>Nom</td>
			<td>Status</td>
			{% if not hideActor %}
			<td>Acteur</td>
			{% endif %}
			<td class="text-center">Début planifié</td>
			<td class="text-center">Fin planifiée</td>
			<td class="text-center">Début réél</td>
			<td class="text-center">Fin réele</td>
			<td colspan="2" class="text-center"><span class="d-none">Actions</span></td>
		</tr>
	</thead>
	<tbody>
		{% for activity in activities %}
		<tr>
			<td><a href="{{ url('activity_activity', {id: activity.id}, false) }}">{{ activity.name }}</a></td>
			<td>{{ statusTools.statusName(activity.status) }}</td>
			{% if not hideActor %}
			<td>{% if activity.actor is not null %} <a
				href="{{ url('actor_actor', {id: activity.actor.id}, false) }}" title="Editer">{{ activity.actor.displayName }}
			</a>
			{% endif %}</td>
			{% endif %}
			<td class="text-center">{% if activity.startDate is not null %} {{ dateTools.euro(activity.startDate) }}
				{% endif %}</td>
			<td class="text-center">{% if activity.endDate is not null %} {{ dateTools.euro(activity.endDate) }}
				{% endif %}</td>
			<td class="text-center">{% if activity.realStartDate is not null %} {{ dateTools.euro(activity.realStartDate) }}
				{% endif %}</td>
			<td class="text-center">{% if activity.realEndDate is not null %} {{ dateTools.euro(activity.realEndDate) }}
				{% endif %}</td>
			<td class="text-center"><a
				href="{{ url('activity_activity', {id: activity.id}, false) }}"
				title="Editer l'acteur"
				<i class="icofont-pencil-alt-2"><span class="d-none">Editer</span></i></i></a></td>
			<td class="text-center">{% if activityDeleteForm is defined %} {% include '_includes/html/genericForm.html.twig' with {'form': activityDeleteForm, 'data': {activity: activity, variant: 'icon'}} only %}
				{% endif %}</td>
		</tr>
		{% endfor %}
	</tbody>
</table>