{% extends "explorer/base.html" %} {% load explorer_tags i18n %} {% block sql_explorer_content %}
{% spaceless %}

{% if query %} {{ query.title }} {% if shared %}  shared{% endif %} {% else %} {% trans "New Query" %} {% endif %}

{% endspaceless %} {% if query %} {% endif %} {% if message %}
{{ message }}
{% endif %}
{% if query %}
{% csrf_token %} {% else %} {% csrf_token %} {% endif %} {% if error %}
{{ error|escape }}
{% endif %} {{ form.non_field_errors }}
{% if form.title.errors %}{% for error in form.title.errors %}
{{ error|escape }}
{% endfor %}{% endif %}
{% if form.connections|length > 1 and can_change %}
{{ form.connection }}
{% else %} {# still need to submit the connection, just hide the UI element #} {% endif %}
{% if form.description.errors %}
{{ form.description.errors }}
{% endif %}
{% if form.sql.errors %} {% for error in form.sql.errors %}
{{ error|escape }}
{% endfor %} {% endif %}
SQL
{% if query %} {% endif %}
{% if params %} {% include 'explorer/params.html' %} {% endif %}
{% if can_change %}
{% else %}
{% endif %}
{% include 'explorer/preview_pane.html' %}
{% if query and can_change and tasks_enabled %} {{ form.snapshot }} {% blocktrans %}Snapshot{% endblocktrans %} {% endif %}
{% if query.avg_duration %} {% blocktrans trimmed with avg_duration=query.avg_duration user_email=form.created_by_user_email created=form.created_at_time %} Avg. execution: {{ avg_duration|floatformat:2 }}ms. Query created by {{ user_email }} on {{ created }}. {% endblocktrans %} {% endif %}
{% endblock %} {% block sql_explorer_scripts %} {{ block.super }} {% endblock %}