{% extends "admin.html.twig" %}

{% block adminContent %}
    <div class="d-flex">
        <div>
            <h1>{{ 'admin.roles.title'|trans }}</h1>
            <p>{{ 'admin.roles.subtitle'|trans }}</p>
        </div>
        <div class="ms-auto pt-3">
            <a href="{{ path('admin_perfis_new') }}" class="btn btn-primary">
                <i class="fa fa-plus"></i>
                {{ 'admin.roles.button.new'|trans }}
            </a>
        </div>
    </div>

    {% include "flashMessages.html.twig" %}

    <table class="table table-hover border">
        <thead>
            <tr class="table-primary">
                <th>#</th>
                <th>{{ 'label.name'|trans }}</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            {% for perfil in perfis %}
                <tr>
                    <td>
                        {{ perfil.id }}
                    </td>
                    <td>
                        {{ perfil.nome }}
                    </td>
                    <td class="text-end">
                        <a href="{{ path('admin_perfis_edit', { id: perfil.id }) }}" class="btn btn-secondary">
                            <i class="fa fa-edit"></i>
                        </a>
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endblock %}
