{% extends "base.html" %}

{% block page_content %}
  <div class="row">
  {% include "admin/admin_tasks.html" %}

  <div class="col-md-12">
  <div class="panel panel-info" id="users">
  <div class="panel-heading">List Active Users</div>
  <div class="panel-body"><p>
  <div class="no-more-tables">
  <table class="table table-hover table-striped table-condensed cf">
  <thead>
   <tr>
    <td>email</td>
    <td>last seen</td>
    <td>last ip</td>
    <td>wallet</td>
    <td>currency</td>
    <td></td>
   </tr>
  </thead>
  <tbody>
  {% for usr in users %}
   <tr>
    <td data-title="Email"><font {% if usr.is_administrator() == True %}color="red"{% endif %}>{{ usr.email }}</td>
    <td data-title="Last Seen">{{ moment(usr.last_seen).format('lll') }}</td>
    <td data-title="Last IP"><a href="https://apps.db.ripe.net/search/query.html?searchtext={{ usr.last_ip }}" data-toggle="tooltip" title="RIPE Whois Search" target="_blank">{{ usr.last_ip }}</a></td>
    <a href="{{ url_for('panel.dashboard', user_id=usr.id) }}" data-toggle="tooltip" title="Show Dashboard"><span class="glyphicon glyphicon-modal-window"></span></a>
   </tr>
  {% endfor %}
  </tbody>
  </table>   
  {% if users.has_prev %}<a href="{{ url_for('view', page=users.prev_num) }}">&lt;&lt; Previous</a>{% else %}&lt;&lt; Previous{% endif %} |
  {% if users.has_next %}<a href="{{ url_for('view', page=users.next_num) }}">Next &gt;&gt;</a>{% else %}Next &gt;&gt;{% endif %}
  </div>
  </div>
  </div>

  </div>

  <div class="row">
  </div>

{% endblock %}
