{% extends "backend/template.html" %}

{% block content %}
    <div class="container mt-3">
        <h2>Resultados para {{ classname }}: </h2>
        <!-- Botón para crear una nueva institución -->
        <a href="{{ url_for('.create_record') }}" class="btn btn-success mb-3">Crear {{ classname }}</a>
        <table class="table table-striped table-hover">
            <thead class="table-dark">
                <tr>
                    <th>ID</th>
                    <th>Nombre</th>
                    <th>Etiqueta</th>
                    <th>Ver</th>
                    <th>Editar</th>
                </tr>
            </thead>
            <tbody>
                {% for institution in institutions %}
                <tr>
                    <td>{{ institution.id }}</td>
                    <td>{{ institution.name }}</td>
                    <td>{{ institution.label }}</td>
                    <td>
                        <a href="{{ url_for('.view_record', record_id=institution.id, backlink=url_for('.list_record',classid=classid,page=1))  }}" class="btn btn-info">Ver</a>
                    </td>
                    <td>
                        <a href="{{ url_for('.edit_record', record_id=institution.id, backlink=url_for('.list_record',classid=classid,page=1))  }}" class="btn btn-primary">Editar</a>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock %}
