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

{% block title %}{{ parent() }} - Update{% endblock %}

{% block body %}
    <h1>User - Update</h1>
    {% include 'SsoDemoBundle:Layout:form.html.twig' %}
    {% include 'SsoDemoBundle:User/javascripts:update.html.twig' %}
    <h3>Help</h3>

    <div class="panel-group" id="accordion">

        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseUserUpdateRequest">
                        Request Example
                    </a>
                </h4>
            </div>
            <div id="collapseUserUpdateRequest" class="panel-collapse collapse">
                <div class="panel-body">

                    <h3>Request Example:</h3>
                    {% include 'SsoHelpBundle:User:xml/update.html.twig' %}

                </div>
            </div>
        </div>

        <br/>

        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseUserUpdateResponse">
                        Response Success Example
                    </a>
                </h4>
            </div>
            <div id="collapseUserUpdateResponse" class="panel-collapse collapse">
                <div class="panel-body">

                    <h3>Response Success Example:</h3>
                    {% include 'SsoHelpBundle:User:xml/response/update.html.twig' %}

                </div>
            </div>
        </div>

    </div>
{% endblock %}

{% block javascripts %}
    {{ parent() }}
    <script>
        $('.dynamic-collection').collection({
            'add': '<a href="#" class="btn btn-default"><span class="glyphicon glyphicon-plus-sign"></a>',
            'remove': '<a href="#" class="btn btn-default"><span class="glyphicon glyphicon-minus-sign"></a>',
            'allow_up': false,
            'allow_down': false,
            'allow_duplicate': false,
            'init_with_n_elements': 1,
            'after_add': function() { $('#form_UpdateUserGroups').attr('checked', 'checked'); },
            'after_remove': function() { $('#form_UpdateUserGroups').attr('checked', 'checked'); }
        });
    </script>
{% endblock %}
