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

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

{% block event_content -%}
<div class="col-10">
    <h1>{{ 'Participation Edit'|trans }}</h1>

    <table>
        <tbody>
            <tr>
                <th>{{ 'Associated person'|trans }}</th>
                <td>{{ person_macro.render(participation.person) }}</td>
            </tr>
            <tr>
                <th>{{ 'Associated event'|trans }} </th>
                <td>{{ participation.event.name }}</td>
            </tr>
            <tr>
                <th>{{ 'Date'|trans }} </th>
                <td>{{ participation.event.date|format_date('long') }}</td>
            </tr>
        </tbody>
    </table>

    {{ form_start(form) }}
    {{ form_row(form.role) }}
    {{ form_row(form.status) }}

    <ul class="record_actions">
        <li class="cancel">

            {% set returnPath = app.request.get('return_path') %}
            {% set returnLabel = app.request.get('return_label') %}

            <a href="{{ returnPath |default( path('chill_event__event_show', { 'id' : participation.event.id } )) }}" class="btn btn-cancel">
                {{ returnLabel |default('Back to the event'|trans) }}
            </a>
        </li>
        <li>
            {{ form_widget(form.submit, { 'attr' : { 'class' : 'btn btn-edit' } } ) }}
        </li>
    </ul>

    {{ form_end(form) }}
</div>
{% endblock %}
