diff --git a/aircox/models/log.py b/aircox/models/log.py index a58f2fe..9bf0e5b 100644 --- a/aircox/models/log.py +++ b/aircox/models/log.py @@ -33,6 +33,9 @@ class LogQuerySet(models.QuerySet): def after(self, date): return self.filter(date__gte=date) if isinstance(date, tz.datetime) else self.filter(date__date__gte=date) + def before(self, date): + return self.filter(date__lte=date) if isinstance(date, tz.datetime) else self.filter(date__date__lte=date) + def on_air(self): return self.filter(type=Log.TYPE_ON_AIR) diff --git a/aircox/templates/aircox/dashboard/statistics.html b/aircox/templates/aircox/dashboard/statistics.html index 785de35..4e17766 100644 --- a/aircox/templates/aircox/dashboard/statistics.html +++ b/aircox/templates/aircox/dashboard/statistics.html @@ -6,15 +6,20 @@ {% block content-container %}
{{ object.start|time:"H:i" }} - {{ object.end|time:"H:i" }} | -- {{ object.episode|default:"" }} - | -|
{{ object.start|time:"H:i" }} {% if object|is_diffusion %} - {{ object.end|time:"H:i" }}{% endif %} | - {% endif %} - -- {% if object.source %}{{ object.source }} / {% endif %} - {% include "aircox/widgets/track_item.html" with object=track %} - | - {% with track.tags.all|join:', ' as tags %} -- {% if tags and tags.strip %} - - {% endif %} - | - {% endwith %} + {% regroup object_list by date.date as by_date %} + {% for date, objects in by_date %} +
+ {{ date|date:"l - d F Y" }} + | ||
---|---|---|
{% translate "No tracks" %} | +||
{{ object.start|time:"H:i" }} - {{ object.end|time:"H:i" }} | ++ {{ object.episode|default:"" }} + | |
{{ object.start|time:"H:i" }} {% if object|is_diffusion %} - {{ object.end|time:"H:i" }}{% endif %} | + {% endif %} + ++ {% if object.source %}{{ object.source }} / {% endif %} + {% include "aircox/widgets/track_item.html" with object=track %} + | + {% with track.tags.all|join:', ' as tags %} ++ {% if tags and tags.strip %} + + {% endif %} + | + {% endwith %} +
{% translate "No tracks" %} | +