{% extends 'base.html' %}

{% block header %}
    <h1 class="title">
        Welcome, {{ name }}!
    </h1>
    <h2>{% block title %}Reservas de padel{% endblock title %}</h2>
{% endblock header %}

{% block content %}
    <table id="tablareservas" border = 1>
        <thead>
            <td id="columnid">ID</td>
            <td id="columnnombre">Nombre</td>
            <td>Fecha</td>
            <td>Hora</td>
            <td>Eliminar</td>
        </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="eliminar-btn">Eliminar</button>
                </form>
                </td>
            </tr>
        {% endfor %}
    </ul>
{% endblock content %}
