{% load i18n %}
<div class="djDebugPanelTitle">
  <h3>{% translate "SQL profiled" %}</h3>
  <button type="button" class="djDebugClose">»</button>
</div>
<div class="djDebugPanelContent">
  <div class="djdt-scroll">
    {% if result %}
      <dl>
        <dt>{% translate "Executed SQL" %}</dt>
        <dd>{{ sql|safe }}</dd>
        <dt>{% translate "Time" %}</dt>
        <dd>{{ duration }} ms</dd>
        <dt>{% translate "Database" %}</dt>
        <dd>{{ alias }}</dd>
      </dl>
      <table>
        <thead>
          <tr>
            {% for h in headers %}
              <th>{{ h|upper }}</th>
            {% endfor %}
          </tr>
        </thead>
        <tbody>
          {% for row in result %}
            <tr>
              {% for column in row %}
                <td>{{ column|escape }}</td>
              {% endfor %}
            </tr>
          {% endfor %}
        </tbody>
      </table>
    {% else %}
      <dl>
        <dt>{% translate "Error" %}</dt>
        <dd>{{ result_error }}</dd>
      </dl>
    {% endif %}
  </div>
</div>
