{% load i18n %}

<p>
   {% trans 'Place your SQL statement directly in the text area below and submit your request using the button.' %}
</p>

<div class="daiquiri-query-dropdowns">
    {% include 'query/query_dropdown_databases.html' %}
    {% include 'query/query_dropdown_columns.html' %}
    {% include 'query/query_dropdown_functions.html' %}

    {% for dropdown in settings.QUERY_DROPDOWNS %}
    {% include dropdown.template %}
    {% endfor %}

    {% include 'query/query_dropdown_examples.html' %}
</div>

<div class="daiquiri-query-dropdowns-area" ng-show="service.forms.sql.dropdown">

</div>

<formgroup
    data-type="codemirror"
    data-label="{% trans 'SQL query' %}"
    data-model="service.forms.sql.values.query"
    data-errors="service.forms.sql.errors.query"
    data-mode="text/x-mariadb">
</formgroup>

<div class="row">
    <formgroup
        class="col-md-6"
        data-type="text"
        data-label="{% trans 'Table name' %}"
        data-model="service.forms.sql.values.table_name"
        data-errors="service.forms.sql.errors.table_name">
    </formgroup>
    <formgroup
        class="col-md-3"
        data-type="select"
        data-label="{% trans 'Query language' %}"
        data-model="service.forms.sql.values.query_language"
        data-errors="service.forms.sql.errors.query_language"
        data-options="service.query_languages"
        data-options-label="text">
    </formgroup>
    <formgroup
        class="col-md-3"
        data-type="select"
        data-label="{% trans 'Queue' %}"
        data-model="service.active_queue"
        data-options="service.queues"
        data-options-label="text">
    </formgroup>
</div>

<button class="btn btn-primary" ng-click="service.forms.sql.submit()">
    {% trans 'Submit new SQL Query' %}
</button>

<button class="btn" ng-click="service.forms.sql.clearQuery()">
    {% trans 'Clear input window' %}
</button>
