{% extends "SsoBackendBundle:TokenUsage:base.html.twig" %}
{% block title %}{{ parent() }} - List{% endblock %}

{% block body %}
    <h1>Token Usage</h1>
    <div class="row">
        <div class="col-md-12 col-ld-12">
            <a class="btn btn-primary dropdown-toggle" data-toggle="collapse" data-target="#filters">
                show filter
                <span class="caret"></span>
            </a>
            <a class="btn btn-danger" href="{{ path('_admin_backend_tokenusage_delete') }}">Delete log</a>
        </div>
        <div class="col-md-12 col-ld-12">
            <div id="filters" class="collapse">
                <form class="well" action="{{ path('_admin_backend_tokenusage_index') }}"
                      method="get" {{ form_enctype(filterForm) }}>
                    {{ form_widget(filterForm) }}
                    <p>
                        <button class="btn btn-success" type="submit" name="filter_action" value="filter">filter
                        </button>
                        <button class="btn btn-danger" type="submit" name="filter_action" value="reset">reset</button>
                    </p>
                </form>
            </div>
        </div>
    </div>
    <hr/>
    <div class="row">
        <div class="col-md-12 col-ld-12">
            <table class="table table-striped table-bordered table-condensed">
                <thead>
                <tr>
                    <th>Date</th>
                    <th>Ip</th>
                    <th>ServiceToken</th>
                    <th>Controller</th>
                    <th>Action</th>
                    <th>Track-Id</th>
                </tr>
                </thead>
                <tbody>
                {% for entity in entities %}
                    <tr>
                        <td>{{ entity.Date|date('Y-m-d H:i:s') }}</td>
                        <td>{{ entity.Ip }}</td>
                        <td class="infinitely-tooltip cutstring"><a class="infinitely-tooltip tt" data-toggle="tooltip"
                                                                    data-placement="top"
                                                                    title="Id: {{ entity.UsageId|e }}"
                                                                    href="#">{{ entity.ServiceToken }}</a></td>
                        <td>{{ entity.Controller }}</td>
                        <td>{{ entity.Action }}</td>
                        <td>{{ entity.TrackId }}</td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>

        <div class="col-md-12 col-ld-12">
            {{ pagerHtml|raw }}
        </div>

    </div>
    <script>
        $(function () {
            $(".tt").tooltip();
        });
    </script>

{% endblock %}
