{% extends "layout.jinja2" %}

{% block content %}
    <div class="card mb-0">
        <div class="card-body">
            <p>
                <a href="{{ request.route_url('settings' ) }}" class="btn btn-light" role="button">
                    <span class="glyphicon glyphicon-chevron-left"></span> Retour</a>
                <a href="{{ request.route_url('user_edit', name='0') }}" class="btn btn-success" role="button">
                    <span class="glyphicon glyphicon-plus"></span> Nouvel utilisateur</a>
            </p>

            <table id="users_list" class="table table-striped table-sm">
                <thead>
                    <tr>
                        <th class-text="center">No Id</th>
                        <th>Nom</th>
                        <th>Dernière connexion</th>
                    </tr>
                </thead>
                <tbody class="table-group-divider">
                {% for entry in users %}
                    <tr>
                        <td class-text="center">{{ entry.id }}</td>
                        <td>
                            <a href="{{ request.route_url('user_edit', name=entry.name) }}">
                                {{ entry.name }}
                            </a>
                            </td>
                        <td>{{ entry.last_login }}</td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
{% endblock %}
