{% extends "::base.html.twig" %}

{% block title %}Administration{% endblock %}

{% block navigation %}{% include 'SsoBackendBundle:Layout:navigation.html.twig' %}{% endblock %}

{% block bodyhead %}
    <header class="page-header">
        <h2>Admin Frontend User Log</h2>

        <div class="right-wrapper pull-right">
            <ol class="breadcrumbs">
                <li>
                    <a href="/">
                        <i class="fa fa-home"></i>
                    </a>
                </li>
                <li><span>Admin Frontend User Log</span></li>
            </ol>
        </div>
    </header>
{% endblock %}

{% block body %}
    <div class="row">
        <div class="col-md-12">
            <h2>User-Log List</h2>
        </div>
        <div class="col-md-6">
            <a class="btn btn-primary dropdown-toggle" data-toggle="collapse" data-target="#filters">
                show filter
                <span class="caret"></span>
            </a>
            <div id="filters" class="collapse well">
                <form method="get" action="#" class="form">
                    {{ form_rest(form) }}
                    <input type="submit" name="submit-filter" class="btn btn-primary mt-md mb-md" value="filter"/>
                </form>
            </div>
        </div>
        <div class="col-md-6">
            <p class="pull-right">Logs Total: {{ pagination.getTotalItemCount }}</p>
        </div>
        <div class="col-md-12">
            <hr />
        </div>
        <div class="col-md-12">
            <div class="table-responsive">
                <table class="table table-sortable table-striped table-bordered table-condensed">
                    <thead>
                    <tr>
                        <th {% if pagination.isSorted('a.keyId') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'keyId', 'a.keyId') }}</th>
                        <th {% if pagination.isSorted('a.userGuid') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'userGuid', 'a.userGuid') }}</th>
                        <th {% if pagination.isSorted('a.userEmail') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'userEmail', 'a.userEmail') }}</th>
                        <th {% if pagination.isSorted('a.userName') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'userName', 'a.userName') }}</th>
                        <th {% if pagination.isSorted('a.firstName') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'firstName', 'a.firstName') }}</th>
                        <th {% if pagination.isSorted('a.lastName') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'lastName', 'a.lastName') }}</th>
                        <th {% if pagination.isSorted('a.createdAt') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'createdAt', 'a.createdAt') }}</th>
                        <th {% if pagination.isSorted('a.updatedAt') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'updatedAt', 'a.updatedAt') }} </th>
                        <th>action</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for entity in pagination %}
                        <tr>
                            <td>{{ entity.id }}</td>
                            <td>{{ entity.userGuid }}</td>
                            <td>{{ entity.userEmail }}</td>
                            <td>{{ entity.userName }}</td>
                            <td>{{ entity.firstName }}</td>
                            <td>{{ entity.lastName }}</td>
                            <td>{% if entity.createdAt %}{{ entity.createdAt|date('Y-m-d H:i:s') }}{% endif %}</td>
                            <td>{% if entity.updatedAt %}{{ entity.updatedAt|date('Y-m-d H:i:s') }}{% endif %}</td>
                            <td>
                                <a class="btn btn-default btn-xs"
                                   href="{{ path('admin_saml_auth_user_log_show', {'keyId' : entity.id }) }}">show</a>
                            </td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
        <div class="col-lg-12">
            <div class="pull-right">
                <div class="navigation">
                    {{ knp_pagination_render(pagination) }}
                </div>
            </div>
        </div>
    </div>
{% endblock %}
