{% extends "SsoBackendBundle:Token:base.html.twig" %}
{% block title %}
    User Group Manager
{% endblock %}

{% block body %}
    <h2>User Groups</h2>
    <div class="row">
        <div class="col-xs-12">
            <a class="btn btn-primary dropdown-toggle" data-toggle="collapse" data-target="#filters">
                show filter
                <span class="caret"></span>
            </a>
        </div>
        <div class="col-xs-12">
            <div id="filters" class="collapse">
                {{ form_start(filterForm, { attr: { class: 'well'}, action: path('_admin_backend_webservice_user_group') }) }}
                    {{ form_rest(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_end(filterForm) }}
            </div>
        </div>
    </div>
    <hr/>
    <div class="row">
        <div class="col-xs-12">
            <table class="table table-striped table-bordered table-condensed">
                <thead>
                <tr>
                    <th>Id</th>
                    <th>Name</th>
                    <th>created</th>
                    <th>updated</th>
                    <th>Actions</th>
                </tr>
                </thead>
                <tbody>
                {% for entity in entities %}
                    <tr>
                        <td>
                            {{ entity.id }}
                        </td>
                        <td>{{ entity.name }}</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-success btn-xs"
                               href="{{ path('_admin_backend_webservice_user_group_show', { 'userGroupId': entity.id }) }}">
                                show
                            </a>&nbsp;
                            <a class="btn btn-danger btn-xs"
                               href="{{ path('_admin_backend_webservice_user_group_edit', { 'userGroupId': entity.id }) }}">
                                edit
                            </a>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>

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

        <div class="col-xs-12">
            <a class="btn btn-primary likepaginator" href="{{ path('_admin_backend_webservice_user_group_new') }}">
                New User Group
            </a>
        </div>
    </div>
{% endblock %}
