{% extends "reports/base.html" %}
{% load reports_tags %}
{% load humanize %}
{% load i18n %}

{% block content %}
<h1>{% trans "Tendenci&reg; Event Log Summary Report" %}</h1>

<div>
    <p>You can <a href="{% url reports-events-summary-historical %}">view historical reports</a> or go to the <a href="{% url event_log.search %}">Event log search</a> to see the latest event logs.</p>
</div>

<div class="event-log-summary-nav">
	<a href="./?{% month_url previous %}">{% trans "Previous" %}</a>
	{{ date_range.0|date:"M Y" }}
	<a href="./?{% month_url next %}">{% trans "Next" %}</a>
</div>

<table class="events-summary-chart">
<tr>
{% for day, items in chart_data.items %}
	<td>
		{% for item in items %}
            {% if item.application %}
			<a href="{% url reports-events-application item.application %}?{{ request.META.QUERY_STRING }}" title="{{ item.application }} ({{ item.count|intcomma }})">
				<div style="width: 24px; height: {{ item.height }}px; background-color: #{{ item.color }}"> </div>
			</a>
            {% endif %}
		{% endfor %}
		{{ day.day }}
		<div style="font-size: 10px;">{{ day|date:"D" }}</div>
	</td>
{% endfor %}
</tr>
</table>
<ul class="events-summary">
{% for item in summary_data.0 %}
    {% if item.application %}
	<li>
	<span style="background-color: #{{ item.color }};"> &nbsp;  &nbsp; </span>
	&nbsp;
    {% if item.application %}
	<a href="{% url reports-events-application item.application %}?{{ request.META.QUERY_STRING }}">{{ item.application }} ({{ item.count|intcomma }})</a>
    {% endif %}
	</li>
	{% endif %}
{% endfor %}
</ul>

<ul class="events-summary">
{% for item in summary_data.1 %}
    {% if item.application %}
	<li>
	<span style="background-color: #{{ item.color }};"> &nbsp;  &nbsp; </span>
	&nbsp;
	<a href="{% url reports-events-application item.application %}?{{ request.META.QUERY_STRING }}">{{ item.application }} ({{ item.count|intcomma }})</a>
	</li>
	{% endif %}
{% endfor %}
</ul>

<ul class="events-summary">
{% for item in summary_data.2 %}
    {% if item.application %}
	<li>
	<span style="background-color: #{{ item.color }};"> &nbsp;  &nbsp; </span>
	&nbsp;
	<a href="{% url reports-events-application item.application %}?{{ request.META.QUERY_STRING }}">{{ item.application }} ({{ item.count|intcomma }})</a>
	</li>
	{% endif %}
{% endfor %}
</ul>

<div style="clear: both;"></div>
{% comment %}
<form>{% csrf_token %}
<table>{{ form }}</table>
<input type="submit" value="submit">
</form>
{% endcomment %}

{% endblock content %}

