{% if sql_queries %}
    <div id="debug-queries">
        <p class="info"></p>
        <table class="sortable">
            <colgroup><col width="1" /><col /><col width="1" /></colgroup>
            <thead>
                <tr>
                    <th scope="col">#</th>
                    <th scope="col">SQL</th>
                    <th scope="col">Time</th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <th>{{ sql_queries|length }}</th>
                    <th class="dupes"></th>
                    <th class="time"></th>
                </tr>
            </tfoot>
            <tbody>
                {% for query in sql_queries %}
                    <tr class="{% cycle odd,even %}">
                        <td>{{ forloop.counter }}</td>
                        <td class="query">{{ query.sql|escape }}</td>
                        <td class="time">{{ query.time }}</td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
{% endif %}