{% extends '@ChillEvent/layout.html.twig' %}

{% import '@ChillPerson/Person/macro.html.twig' as person_macro %}

{% block title 'Participation creation'|trans %}

    {% block _collection_row %}
        <tr>
        <td>
            {{ form_widget(form) }}
        </td>
        <td>
            {# {{ form_row(participationField.status) }} #}
        </td>
        </tr>
    {% endblock %}

{% block event_content -%}
    <h1>{{ 'Participation creation'|trans }}</h1>

    <table class="table">
        <tbody>
            <tr>
                <th>{{ 'Associated event'|trans }} </th>
                <td>{{ participations[0].event.name }}</td>
            </tr>
        </tbody>
    </table>

    {% include '@ChillEvent/Participation/_ignored_participations.html.twig' with ignored_participations %}

    {{ form_start(form) }}
    <table class="table">
        <thead>
            <tr>
                <th>{{ 'Person'|trans }}</th>
                <th>{{ 'Role'|trans }}</th>
                <th>{{ 'Status'|trans }}</th>
            </tr>
        </thead>
        <tbody>
            {% for participationField in form.participations %}
            <tr>
                <td>{{ person_macro.render(participationField.vars.value.person) }}</td>
                <td>{{ form_widget(participationField.role) }}</td>
                <td>{{ form_widget(participationField.status) }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    <ul class="record_actions">
        <li class="cancel">
            <a href="{{ path('chill_event__event_show', { 'event_id' : participations[0].event.id } ) }}" class="btn btn-cancel">
                {{ 'Back to the event'|trans }}
            </a>
        </li>
        <li>
            {{ form_widget(form.submit, { 'attr' : { 'class' : 'btn btn-create' } } ) }}
        </li>
    </ul>

    {{ form_end(form) }}

{% endblock %}
