{% extends "layout.html" %}
{% block body %}
        {% include "notifications.html" %}
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          {% include "small_topbar.html" %}
          <ul class="breadcrumb" style="margin-bottom: 5px;">
            <li><a href="{{ url_for('view.home') }}">{{ _('Home') }}</a></li>
            <li><a href="{{ url_for('view.admin_authentications') }}">{{ _('Administration') }}</a></li>
            <li class="active">{{ _('%(user)s\'s sessions', user=user) }}</li>
          </ul>
          <br />
          <div class="form-container">
            <legend id="authentication">{{ _('Sessions') }}</legend>
            <div class="table-responsive">
              <table class="table table-striped table-hover nowrap" id="table-sessions" width="100%">
                <thead>
                  <tr>
                    <th>{{ _('IP') }}</th>
                    <th>{{ _('Last seen') }}</th>
                    <th>{{ _('User-Agent') }}</th>
                    <th>{{ _('API Login') }}</th>
                    <th>{{ _('Current session') }}</th>
                    <th>{{ _('Expire') }}</th>
                  </tr>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>
          </div>
        </div>
        <div id="confirmation-modal" class="modal fade">
          <div class="modal-dialog modal-lg">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">{{ _('Confirmation') }}</h4>
              </div>
              <div class="modal-body">
                <div class="alert alert-warning">
                  <i class="fa fa-2x fa-fw fa-question-circle"></i>{{ _('You are about to revoke a session, are you sure?') }}
                  <pre><code id="session-details" class="JSON"></code></pre>
                </div>
                <div class="alert alert-danger" id="error-confirm" style="display:none;">
                  <strong><i class="fa fa-2x fa-fw fa-exclamation-circle"></i>&nbsp;{{ _('Warning!') }}</strong> {{ _('You are about to revoke your <strong>current</strong> session.') }}
                </div>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">{{ _('Cancel') }}</button>
                <button type="button" class="btn btn-info" data-dismiss="modal" id="perform-revoke">{{ _('Confirm') }}</button>
              </div>
            </div>
          </div>
        </div>
{% endblock %}
