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

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

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


    {% block card-body %}
        <ul class="mb-4 list-group list-group-flush">
            <li class="list-group-item"><span class="fw-bold">Nombre:</span>     {{ object.nombre }}         </li>
            <li class="list-group-item"><span class="fw-bold">Descuento:</span>  {{ object.descuento_full }} </li>
            <li class="list-group-item"><span class="fw-bold">Status:</span>     {{object.status}}           </li>
        </ul>


        <h3>Estudiantes con {{object}}</h3>

        <div class="table-responsive mb-4">
            <table class="table table-striped table-hover table-bordered">
                <thead class="table-primary">
                    <tr>
                        <th>Estudiantes</th>
                        <th>Observacion</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    {% for becado in object.becados.all %}
                    <tr>
                        <td>{{becado.estudiante}}</td>
                        {% if becado.obs %} <td>{{becado.obs}}</td> {% else %} <td><i>Ninguna</i></td> {% endif %}
                        <td class="text-end"><a href="{% url 'becas-desasignar' becado.pk %}">Retirar Beca</a></td>
                    </tr>
                    {% empty %}
                    <tr>
                        <td colspan="3">No hay estudiantes hechos con esta Beca</td>
                    </tr>
                {% endfor %}    
                </tbody>
            </table>
        </div>
    {% endblock %}


    {% block edit %}{% endblock %}
    {% block delete %}{% endblock %}
