{% load rl %}
{% extends 'admin/base_site.html' %}

{% block title %}Log summary{% endblock %}

{% block content %}

<p>{{ projectComment }}</p>

{% pyexec from django.conf import settings %}

{% block controls %}
<div id="content-main">
<p>Project: {{ settings.APPNAME }}</p>
    <form method="get" action="../usage/">
        <div>
            <fieldset class="module aligned ()">
                <div class="form-row">
                    <label for="id_plotField">Plot:</label>
                    {{ form.plotField }}
                </div>

                <label>Including only:
                <div class="form-row">
                    {% for fieldName in fieldNames %}
                        <label for={% py '"id_%s"' % fieldName['name'] %}>{{ fieldName.displayName }}</label>
                        {% py str(form[fieldName['name']]) %}
                    {% endfor %}
                </div></label>

                <div class="form-row">
                    <label for="id_period">Period:</label>
                    {{ form.period }}
                </div>
            </fieldset>

        <input type="submit" value="Update Statistics" />
        <!--input type="submit" disabled value="Export for Excel (Coming 2007 Q1)" / Need CSS for disabled button, with grayed-out background images-->
        </div>
    </form>
</div>
{% endblock %}

{% block display %}

{% block charts %}

<img src="{{ chartUrl }}"></img>

{% endblock %}{% # charts %}

{% block tables %}

{% if not datas %}
<p>No data found &#8212; try picking different options from the menus above.</p>
{% endif %}

{% for data in datas %}
<p>{% py seriesNames[forloop['counter0']] %}</p>
<table>
    <thead>
        <tr>
            <th>Date</th>
            <th>Number of Brochures</th>
        </tr>
    </thead>
    <tbody>
        {% for hit in data %}
        <tr>
            <td>{% py dates[forloop['counter0']].strftime('%d %b %Y') %}</td>
            <td>{{ hit }}</td>
        </tr>
        {% endfor %}
    </tbody>
    <tr><th>Total</th><th>{% py str(totals[forloop['counter0']]) %}</th></tr>
</table>
<br />
{% endfor %}

{% endblock %}{% # tables %}

{% endblock %}{% # display %}

{% endblock %}{% # content %}
