{% extends "_base.html" %}

{% block content %}{{ super() }}
<h2>{{ _('Registered accounts') }}</h2>
<table class="table table-hover">
  <thead>
    <tr>
      <td>{{ _('Email') }}</td>
      <td>{{ _('Last login') }}</td>
      <td>{{ _('Action') }}</td>
    </tr>
  </thead>
  <tbody>
  {% for user in users %}
  <tr>
    <td>
      {{ user.email }}
    </td>
    <td>
      {{ user.format_last_login(current_user.timezone_offset_minutes) }}
    </td>
    <td>
      <div class="btn-group">
        {% if not user.is_admin and user.is_active %}
        <a class="btn btn-default" href="{{ url_for('suspend', userid=user.get_id()) }}">
          <span class="fa fa-lock"></span> {{ _('Suspend') }}
        </a>
        {% elif not user.is_admin %}
        <a class="btn btn-danger" href="{{ url_for('unsuspend', userid=user.get_id()) }}">
          <span class="fa fa-unlock-alt"></span> {{ _('Activate') }}
        </a>
        {% endif %}
        <a class="btn btn-default" href="{{ url_for('reset_password', userid=user.get_id()) }}">
          <span class="fa fa-key"></span> {{ _('Reset password') }}
        </a>
      </div>
    </td>
  </tr>
  {% endfor %}
  </tbody>
</table>

<h2>{{ _('Email status') }}</h2>
<p>
  {{ _('The next sync will upload %(num)d email(s).', num=pending_emails) }}
</p>
<a class="btn btn-default" href="{{ url_for('sync') }}">{{ _('Sync now') }}</a>
{% endblock %}
