{% load i18n %}

    <div class="modal" id="examples-modal-form" tabindex="-1">
        <div class="modal-dialog modal-lg">
            <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">{% trans 'Example query' %}</h4>
                </div>

                <div class="modal-body">
                    <div class="row">
                        <formgroup
                            class="col-md-8"
                            data-id="name"
                            data-type="text"
                            data-label="{{ meta.Example.name.verbose_name }}"
                            data-help="{{ meta.Example.name.help_text }}"
                            data-model="service.current_row.name"
                            data-errors="service.errors.name">
                        </formgroup>
                        <formgroup
                            class="col-md-4"
                            data-id="order"
                            data-type="number"
                            data-label="{{ meta.Example.order.verbose_name }}"
                            data-help="{{ meta.Example.order.help_text }}"
                            data-model="service.current_row.order"
                            data-errors="service.errors.order">
                        </formgroup>
                    </div>
                   <formgroup
                        data-id="query_string"
                        data-type="codemirror"
                        data-label="{{ meta.Example.query_string.verbose_name }}"
                        data-help="{{ meta.Example.query_string.help_text }}"
                        data-model="service.current_row.query_string"
                        data-errors="service.errors.query_string"
                        data-mode="text/x-sql">
                   </formgroup>
                   <formgroup
                        data-id="description"
                        data-type="textarea"
                        data-label="{{ meta.Example.description.verbose_name }}"
                        data-help="{{ meta.Example.description.help_text }}"
                        data-model="service.current_row.description"
                        data-errors="service.errors.description">
                   </formgroup>
                   <div class="row">
                        <formgroup
                            class="col-md-6"
                            data-id="query_language"
                            data-type="select"
                            data-label="{{ meta.Example.query_language.verbose_name }}"
                            data-help="{{ meta.Example.query_language.help_text }}"
                            data-model="service.current_row.query_language"
                            data-errors="service.errors.query_language"
                            data-options="service.query_languages"
                            data-options-label="text">
                        </formgroup>
                        <formgroup
                            class="col-md-6"
                            data-id="access_level"
                            data-type="select"
                            data-label="{{ meta.Example.access_level.verbose_name }}"
                            data-help="{{ meta.Example.access_level.help_text }}"
                            data-model="service.current_row.access_level"
                            data-errors="service.errors.access_level"
                            data-options="service.accesslevels"
                            data-options-label="text">
                        </formgroup>
                    </div>
                    <formgroup
                        data-id="groups"
                        data-type="multicheckbox"
                        data-label="{% trans 'Groups with access' %}"
                        data-model="service.current_row.groups"
                        data-errors="service.errors.groups"
                        data-options="service.groups"
                        data-options-label="name"
                        data-options-empty="{% trans 'no groups available' %}">
                    </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_example()">
                        {% trans 'Save' %}
                    </button>
                </div>
            </div>
        </div>
    </div>
