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

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

{% block navigation %}{% include 'SsoBackendBundle:Layout:navigation.html.twig' %}{% endblock %}
{% block body %}
    <div class="row">

        <div class="col-md-12">
            <section class="panel">
                <header class="panel-heading">
                    <div class="panel-actions">
                        <a href="#" class="panel-action panel-action-toggle" data-panel-toggle></a>
                        <a href="#" class="panel-action panel-action-dismiss" data-panel-dismiss></a>
                    </div>

                    <h2 class="panel-title">User-Log List</h2>
                </header>
                <div class="panel-body">
                <div class="row">
                    <div class="col-md-4">
                        <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 class="col-md-4 col-md-offset-4">

                        <section class="panel panel-featured-bottom panel-featured-primary">
                            <div class="panel-body">
                                <div class="widget-summary widget-summary-md">
                                    <div class="widget-summary-col widget-summary-col-icon">
                                        <div class="summary-icon bg-primary">
                                            <i class="fa fa-list"></i>
                                        </div>
                                    </div>
                                    <div class="widget-summary-col">
                                        <div class="summary">
                                            <h4 class="title">Logs Total</h4>
                                            <div class="info">
                                                <strong class="amount">{{ pagination.getTotalItemCount }}</strong>
                                                <span class="text-primary">({{ pagination.getItemNumberPerPage }} per Page)</span>
                                            </div>
                                        </div>
                                        <div class="summary-footer">
                                            <a class="text-muted text-uppercase">(view all)</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </section>
                    </div>
                </div>
                 <div class="row mt-lg">
                     <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>
                </div>
            </section>
        </div>

        <div class="col-lg-12">
            <div class="pull-right">
                <div class="navigation">
                    {{ knp_pagination_render(pagination) }}
                </div>
            </div>
        </div>
    </div>
{% endblock %}
