{% extends "explorer/base.html" %} {% load explorer_tags i18n %} {% block sql_explorer_content %}
{% if query %} {% query_favorite_button query.id is_favorite 'query_favorite_toggle query_favourite_detail'%} {% endif %}

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

{% if shared %}  shared{% 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 can_change %}
{{ form.database_connection }}
{% else %} {# still need to submit the connection, just hide the UI element #}
{{ form.database_connection }}
{% endif %}
{% if form.description.errors %}
{{ form.description.errors }}
{% endif %}
{% if form.sql.errors %} {% for error in form.sql.errors %}
{{ error|escape }}
{% endfor %} {% endif %}
{% if params %}
{% include 'explorer/params.html' %}
{% endif %}
{% if query %}
{% if query and can_change and assistant_enabled %}{{ form.few_shot }} {% translate "Assistant Example" %}{% endif %}
{% endif %}
{% if can_change %} {% export_buttons query %} {% else %} {% export_buttons query %} {% endif %}
{% if assistant_enabled %} {% include 'explorer/assistant.html' %} {% endif %}
{% include 'explorer/preview_pane.html' %}
{% if query.avg_duration %} {% blocktranslate trimmed with avg_duration_display=query.avg_duration_display cuser=query.created_by_user created=form.created_at_time %} Avg. execution: {{ avg_duration_display }}ms. Query created by {{ cuser }} on {{ created }}. {% endblocktranslate %} {% if query %} {% translate "History" %}{% endif %} {% endif %}
{% if query and can_change and tasks_enabled %}{{ form.snapshot }} {% translate "Snapshot" %}{% endif %}
{% endblock %}