{% extends 'base.html' %}

{% block header %}
<section class="hero has-text-centered">
    <h1 class="title is-1">
        ¡Bienvenido, {{ name }}!
    </h1>
    <h1 class="subtitle is-2 has-text-centered">
        Estas son tus reservas de padel
    </h1>
</section>
{% endblock header %}

{% block content %}
    <table class="table is-fullwidth" id="tablareservas" border = 1>
        <thead>
            <th id="columnid">ID</th>
            <th id="columnnombre">Nombre</th>
            <th>Fecha</th>
            <th>Hora</th>
            <th></th>
        </thead>

        {% for reserva in reservas %}
            <tr>
                <td>{{ reserva.id }}</td>
                <td>{{ reserva.nombre }}</td>
                <td>{{ reserva.fecha }}</td>
                <td>{{ reserva.hora }}</td>
                <td>
                <form class="form-eliminar" action="{{ url_for('reservas.eliminar_reserva', id=reserva.id) }}" method="post" style="display: inline;">
                    <button type="submit"  class="button is-danger  is-small">Eliminar</button>
                </form>
                </td>
            </tr>
        {% endfor %}
    </table>
{% endblock content %}
