{% extends 'gakusei/detail-layout.html' %}    

    {% block regresar-url %}{% url 'dia-de-clase' %}{% endblock %}


    {% block card-title %}{{object}}{% endblock %}


    {% block edit-url %}{% url 'dia-de-clase-edit' object.pk %}{% endblock %}
    {% block edit-text %}<i class="fs-4 fa-solid fa-pen-to-square"></i> Editar Dia de Clase{% endblock %}


    {% block card-body %}
        <ul class="mb-4 list-group list-group-flush">
            <li class="list-group-item"><a href="{% url 'clase-detail' object.clase.id %}">
                <span class="fw-bold">Clase:</span>            {{object.clase}}        </a>
            </li>
            <li class="list-group-item">
                <span class="fw-bold">Numero de Clase:</span>   {{object.numero}}
            </li>
            <li class="list-group-item">
                <span class="fw-bold">Fecha de la Clase:</span> {{object.fecha}}
            </li>
            <li class="list-group-item">
                <span class="fw-bold">Horario:</span>           {{object.horario.simplificado}}
            </li>
            <li class="list-group-item">
                <span class="fw-bold">Status:</span>            {{object.status}}
            </li>
            <li class="list-group-item">
                <span class="fw-bold">Observaciones:</span>     {% if object.obs %}{{object.obs}}{% else %}---{% endif %}
            </li>
        </ul>

        <h3>Asistensias</h3>

        <div class="table-responsive mb-4">
            <table class="table table-striped table-hover table-bordered">
                <thead class="table-primary">
                    <th>Estudiante</th>
                    <th>Status</th>
                    <th>Editar</th>
                </thead>
                <tbody>
                    {% for estudiante in object.asistencias.all %}
                    <tr>
                        <td>{{estudiante.estudiante.full_name}}</td>
                        <td>{{estudiante.presente|yesno:"Presente, No Presente" }}</td>
                        <td class="text-center align-middle"><a href="{% url 'asistencia-edit' estudiante.pk %}"><i class="fs-4 fa-solid fa-pen-to-square"></i></a></td>
                    </tr>
                    {% empty %}
                    <tr>
                        <td colspan="3"><i>Sin asistencias registradas.</i></td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>

    {% endblock %}

    {% block delete-title %}Eliminar Dia de Clase{% endblock %}
    {% block delete-url %}{% url 'dia-de-clase-delete' object.pk %}{% endblock %}