{% extends "SsoBackendBundle:WsApplicationAttribute:base.html.twig" %}
{% block title %}{{ parent() }} Manager{% endblock %}

{% block body %}
    <h2>Sso IDP Application Attribute</h2>
    <div class="row">
        {#
            <div class="col-md-12 col-ld-12">
                {% if form_errors(filterForm) %}
            <div class="alert alert-warning">
                <a href="#" class="close" data-dismiss="alert">&times;</a>
                    {{ form_errors(filterForm) }}
            </div>
                {% endif %}
                &nbsp;
            </div>
        #}
        <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>
        </div>
        <div class="col-md-12 col-ld-12">
            <div id="filters" class="collapse">
                <form class="well" action="{{ path('_admin_backend_webservice_application_attribute') }}"
                      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>Name</th>
                    <th>Type</th>
                    <th>Application Name</th>
                    <th>Actions</th>
                </tr>
                </thead>
                <tbody>
                {% for entity in entities %}
                    <tr>
                        <td class="infinitely-tooltip"><a class="tt" data-toggle="tooltip" data-placement="right"
                                                          title="Id: {{ entity.id|e }}"
                                                          href="{{ path('_admin_backend_webservice_application_attribute_show', { 'attributeId': entity.id }) }}">{{ entity.Name }}</a>
                        </td>
                        <td>{{ entity.Type }}</td>
                        <td>{% if entity.Application %}{{ entity.Application.Name }}{% else %}-{% endif %}</td>
                        <td>
                            <a class="btn btn-success btn-xs"
                               href="{{ path('_admin_backend_webservice_application_attribute_show', { 'attributeId': entity.id }) }}">
                                show
                            </a>&nbsp;
                            <a class="btn btn-danger btn-xs"
                               href="{{ path('_admin_backend_webservice_application_attribute_edit', { 'attributeId': entity.id }) }}">
                                edit
                            </a>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>

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

        <div class="col-md-12 col-ld-12">
            <a class="btn btn-primary likepaginator"
               href="{{ path('_admin_backend_webservice_application_attribute_new') }}">
                new Attribute
            </a>
        </div>
    </div>

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

{% endblock %}