{% extends "layout.html" %}
{% from "_macros.html" import render_pagination %}
{%- block title -%}
{{ _('Users') }}
{%- endblock -%}
{% block content %}

<nav aria-label="breadcrumb">
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="{{ url_for('admin') }}">{{ _('Admin') }}</a></li>
        <li class="breadcrumb-item active" aria-current="page">{{ _('Users') }}</li>
    </ol>
</nav>

<div class="table-responsive">
    <table class="table table-sm table-bordered table-hover table-striped">
        <thead>
            <tr>
                <th>{{ _('Email') }}</th>
                <th>created_at</th>
                <th>confirmed_at</th>
                <th>tos_accepted_at</th>
                <th>deletion_requested_at</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            {% for user in users %}
                <tr>
                    <td>{{ user.email }}</td>
                    <td>{% if user.created_at %}{{ user.created_at | dateformat }}{% endif %}</td>
                    <td>{% if user.confirmed_at %}{{ user.confirmed_at | dateformat }}{% endif %}</td>
                    <td>{% if user.tos_accepted_at %}{{ user.tos_accepted_at | dateformat }}{% endif %}</td>
                    <td>{% if user.deletion_requested_at %}{{ user.deletion_requested_at | dateformat }}{% endif %}</td>
                    <td>
                        <a href="{{ url_for('admin_user_update', id=user.id) }}">{{ _('Edit') }}</a>
                        <a href="{{ url_for('admin_user_delete', id=user.id) }}">{{ _('Delete') }}</a>
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
</div>

<div class="my-4">{{ render_pagination(pagination) }}</div>

<div class="my-4">
    <a class="btn btn-outline-danger m-1" href="{{ url_for('admin_reset_tos_accepted') }}" role="button">{{ _('Reset acceptance of terms of service and privacy') }}&hellip;</a>
</div>


{% endblock %}