{% load i18n %}

    <div class="modal" id="update-user-modal" tabindex="-1">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="{% trans 'Close' %}">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" id="update-user-modal-title">{% trans 'Update user' %}</h4>
                </div>

                <div class="modal-body">
                    <div class="row">
                        <formgroup
                            class="col-md-6"
                            data-id="first_name"
                            data-type="text"
                            data-label="{% trans 'First Name' %}"
                            data-model="service.current_row.user.first_name"
                            data-errors="service.errors.user.first_name">
                        </formgroup>
                        <formgroup
                            class="col-md-6"
                            data-id="last_name"
                            data-type="text"
                            data-label="{% trans 'Last Name' %}"
                            data-model="service.current_row.user.last_name"
                            data-errors="service.errors.user.last_name">
                        </formgroup>
                    </div>
                    <formgroup
                        data-id="name"
                        data-type="text"
                        data-label="{% trans 'Email' %}"
                        data-model="service.current_row.user.email"
                        data-errors="service.errors.user.email">
                    </formgroup>
                    {% for detail_key in detail_keys %}
                    <formgroup
                        data-id="{{ detail_key.key }}"
                        data-type="{{ detail_key.data_type }}"
                        data-label="{{ detail_key.label }}"
                        data-model="{{ detail_key.model }}"
                        data-errors="{{ detail_key.errors }}"
                        data-options='{{ detail_key.options_json|safe }}'
                        data-options-label="label">
                    </formgroup>
                    {% endfor %}
                    <formgroup
                        data-id="groups"
                        data-type="multicheckbox"
                        data-label="{% trans 'Groups' %}"
                        data-model="service.current_row.user.groups"
                        data-errors="service.errors.user.groups"
                        data-options="service.groups"
                        data-options-label="name">
                    </formgroup>
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        {% trans 'Close' %}
                    </button>
                    <button type="button" class="btn btn-primary" ng-click="service.store_profile()">
                        {% trans 'Update user' %}
                    </button>
                </div>
            </div>
        </div>
    </div>
