{% extends "base.html" %}
{% load i18n %}
{% load smart_pagination %}
{% block title %}{% trans "Users" %}{% endblock %}
{% block content %}
    <div class="row justify-content-center">
        <div class="col-lg-8">
            <h1>
                {% trans "Users" %}
            </h1>
            <div class="card">
                <div class="card-body table-responsive">
                    <table class="table table-hover">
                        <tr>
                            <th>{% trans "Username" %}</th>
                            <th>{% trans "Email" %}</th>
                            <th>{% trans "Active" %}</th>
                            <th>{% trans "Admin" %}</th>
                            <th>{% trans "Last login" %}</th>
                        </tr>
                        {% for user in users %}
                            <tr>
                                <td>
                                    <a href="{% url 'accounts.user-detail' username=user.username %}">{{ user.username }}</a>
                                </td>
                                <td>
                                    <a href="{% url 'accounts.user-detail' username=user.username %}">{{ user.email }}</a>
                                </td>
                                <td>
                                    {% if user.is_active %}
                                        <i class="fa fa-check text-success-bright"></i>
                                    {% else %}
                                        <i class="fa fa-times text-danger-bright"></i>
                                    {% endif %}
                                </td>
                                <td>
                                    {% if user.is_superuser %}
                                        <i class="fa fa-check text-success-bright"></i>
                                    {% else %}
                                        <i class="fa fa-times text-danger-bright"></i>
                                    {% endif %}
                                </td>
                                <td>{{ user.last_login|date:"Y-m-d H:i:s e" }}</td>
                            </tr>
                        {% endfor %}
                    </table>
                </div>
            </div>
            {% include "pagination.html" %}
        </div>
    </div>
{% endblock %}
