{% extends 'base.html.twig' %}

{% block body %}
    <h1>Enfant</h1>

    <table>
        <tbody>
            <tr>
                <th>Id</th>
                <td>{{ enfant.id }}</td>
            </tr>
            <tr>
                <th>Nom</th>
                <td>{{ enfant.nom }}</td>
            </tr>
            <tr>
                <th>Prenom</th>
                <td>{{ enfant.prenom }}</td>
            </tr>
            <tr>
                <th>Parent</th>
                <td>{{ enfant.parent.username }}</td>
            </tr>
            <tr>
                <th>Evenement</th>
                <td>
                    <ul>
                        {% for evt in enfant.eventsParticipes %}
                            <li>{{ evt.nom }}</li>
                        {% endfor %}
                    </ul>
                </td>
            </tr>
        </tbody>
    </table>

    <ul>
        <li>
            <a href="{{ path('enfant_index') }}">Back to the list</a>
        </li>
        <li>
            <a href="{{ path('enfant_edit', { 'id': enfant.id }) }}">Edit</a>
        </li>
        <li>
            {{ form_start(delete_form) }}
                <input type="submit" value="Delete">
            {{ form_end(delete_form) }}
        </li>
    </ul>
{% endblock %}
