{% extends "djangosampler/base.html" %}
{% block menu %}
    <div class="date-selector">
        {% for date_link in date_links %}
            {% if date_link.friendly_name == current_date %}
                <span>{{ date_link.friendly_name }}</span>
            {% else %}
                <a href="{{ date_link.url }}">{{ date_link.friendly_name }}</a>
            {% endif %}
        {% endfor %}
    </div>
    <div class="query-type-selector">
        {% for query_type in query_types %}
            {% if query_type.name == current_query_type %}
                <span>{{ query_type.friendly_name }}</span>
            {% else %}
                <a href="{{ query_type.url }}">{{ query_type.friendly_name }}</a>
            {% endif %}
        {% endfor %}
    </div>
{% endblock %}
{% block body %}
<h3>Queries {{ start_offset }} to {{ end_offset }} of {{ total_queries }}</h3>
<table>
    <tr>
        <th></th>
        <th><a href="{{ by_count_url }}">Count</a></th>
        <th><a href="{{ by_duration_url }}">Total Duration (s)</a></th>
        <th><a href="{{ by_cost_url }}">Total Cost</a></th>
        <th>Query</th>
    </tr>
    {% for query in queries %}
        <tr class="{% cycle 'odd' 'even' %}">
            <td class="chooser"><a href={{ query.url }}>&#x0398;</a></td>
            <td>{{ query.count }}</td>
            <td>{{ query.total_duration|floatformat:4 }}</td>
            <td>{{ query.total_cost }}</td>
            <td>{{ query.query|truncatechars:2048 }}</td>
        </tr>
    {% endfor %}
</table>
<div id="page-selector">
    Page: 
    {% for page in pages %}
        {% if page.number == current_page %}
            {{ page.number }}
        {% else %}
        <a href="{{ page.url }}">{{ page.number }}</a>
        {% endif %}
    {% endfor %}
</div>
{% endblock %}

