{% extends "SsoBackendBundle:token:base.html.twig" %}
{# % form_theme filterForm ':Forms:bootstrap.layout.html.twig' % #}
{% block title %}{{ parent() }} - Index{% endblock %}

{% block body %}
    <br/><br/>

    {{ form_start(addForm) }}
    {{ form_label(addForm.servicename) }} <br/>
    {{ form_widget(addForm.servicename) }} {{ form_widget(addForm.submit) }}
    {{ form_end(addForm) }}

    <br/><br/>
    <br/><br/>

    <div style="font-size: 20px;margin-bottom: 20px;" class="pull-right">
        <span class="label label-success label-as-badge">count: {{ pagination.getTotalItemCount }}</span>
    </div>
    <table class="table table-striped table-bordered table-condensed">
        <thead>
        <tr>
            <th width="100%" {% if pagination.isSorted('a.ServiceName') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'Service Group Name', 'a.ServiceName') }}</th>
            <th>&nbsp;</th>
            <th>&nbsp;</th>
            <th>&nbsp;</th>
            <th>&nbsp;</th>
        </tr>
        </thead>
        <tbody>
        {% for entity in pagination %}
            <tr>
                <td>{{ entity.ServiceName }}</td>
                <td><a class="btn btn-success btn-xs"
                       href="{{ path('_admin_backend_servicetoken_list_services', {'ServiceNameId': entity.ServiceNameId}) }}">Edit
                        Services</a></td>
                <td><a class="btn btn-success btn-xs"
                       href="{{ path('_admin_backend_servicetoken_list_tokens', {'ServiceNameId': entity.ServiceNameId}) }}">Edit
                        Tokens</a></td>
                <td><a class="btn btn-warning btn-xs"
                       href="{{ path('_admin_backend_servicetoken_edit_servicename', {'serviceNameId': entity.ServiceNameId}) }}">Edit
                        Group</a></td>
                <td><a class="btn btn-danger btn-xs"
                       href="{{ path('_admin_backend_servicetoken_remove_servicename', {'serviceNameId': entity.ServiceNameId}) }}">Remove
                        Group</a></td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
    <div class="navigation">
        {{ knp_pagination_render(pagination) }}
    </div>

    <style>
        th.sorted > a.desc:before {
            content: "\2191";
            padding-right: 3px;
            margin-top: -5px;
            font-size: 18px;
            color: #000;
            text-decoration: none;
            font-weight: bold;
        }

        th.sorted > a.asc:before {
            content: "\2193";
            padding-right: 3px;
            margin-top: -5px;
            font-size: 18px;
            color: #000;
            text-decoration: none;
            font-weight: bold;
        }
    </style>
{% endblock %}
