aircox-radiocampus/aircox/templates/aircox/controllers/stats.html
2016-10-26 21:48:58 +02:00

57 lines
1.7 KiB
HTML

{% load i18n %}
<div id='stats'>
{% for stats in statistics %}
<section class="station">
<header>
<h1>{{ stats.station.name }}</h1>
<h2>- {{ stats.date|date:'l d F Y' }}</h2>
</header>
<table border=1>
<tr>
<th>{% trans "Date" %}</th>
{# Translators "Header for statistics view" #}
<th>{% trans "Diffusion or sound played" %}
<th></th>
</tr>
{% for item in stats.items %}
<tr class="log">
<th>{{ item.date|date:"H:i" }}</th>
<th>{{ item.name }}</th>
<th>{% for tag,count in item.tags.items %}
{{ tag }}: {{ count }};
{% endfor %}</th>
<th>{{ item.type }}</th>
</tr>
{% for track in item.tracks %}
<tr class="track">
<td>{{ track.date|date:"H:i" }}</td>
<td>{{ track.artist }} -- <emph>{{ track.title }}</emph> {{ track.version }}</td>
<td>{{ track.tags.all|join:', ' }}</td>
</tr>
{% endfor %}
{% endfor %}
<tr>
<td>{{ stats.date|date:'d/m/Y' }}</td>
{# TODO: translation block #}
<td>{% trans "Total and average" %} ({{ stats.count }} tracks)</td>
<td>{% for tag, count, average in stats.tags %}
{{ tag }}: <b>{{ count }} / {{ average|floatformat }}%</b>;
{% endfor %}
</td>
</tr>
</table>
</section>
{% endfor %}
</div>