{% extends 'gakusei/filter-layout.html' %}
{% load crispy_forms_tags %}
{% load static %}

    {% block style %}
        <link rel="stylesheet" href="{% static 'gakusei/select2/select2.min.css' %}">
        <link rel="stylesheet" href="{% static 'gakusei/select2/select2-bootstrap-5-theme.min.css' %}">
    {% endblock %}

    {% block script %}
        <script src="{% static 'gakusei/js/jquery-3.7.1.min.js' %}"></script>
        <script src="{% static 'gakusei/select2/select2.full.min.js' %}"></script>

        <script>
            $(document).ready(function() {
                let opciones = {
                    placeholder: "----------",
                    allowClear: true,
                    containerCssClass : 'select form-select',
                    theme: "bootstrap-5",
                    width: 'auto',
                }
                
                $("#id_clase").select2(opciones);
                $("#id_estudiante").select2(opciones);
            });
        </script>
    {% endblock %}


    {% block regresar-url %}{% url 'inscripciones' %}{% endblock %}

    {% block card-title %}Buscar Inscripción{% endblock %}


    {% block url-filter-form %}{% url 'inscripciones-filter' %}{% endblock %}
    {% block url-filter-button %}{% url 'inscripciones-filter' %}{% endblock %}

    {% block thead %}
        <th>Clase</th>
        <th>Estudiante</th>
        <th>Precio a pagar</th>
        <th></th>
    {% endblock %}

    {% block tbody %}
        {% for inscripcion in object_list %}
            <tr>
                <td>{{inscripcion.clase}}</td>
                <td>{{inscripcion.estudiante}}</td>
                <td>{{inscripcion.precio_a_pagar}}$</td>
                <td class="text-center align-middle"><a href="{% url 'inscripciones-detail' inscripcion.id %}"><i class="fs-4 fa-solid fa-eye"></i></a></td>
            </tr>
            {% empty %}
            <tr>
                <td colspan="4" class="text-center fw-bold fst-italic">Sin Registros</td>
            </tr>
        {% endfor %}
    {% endblock %}