Add start date for stats in the jinja template

This commit is contained in:
Julien Constant 2023-09-07 13:48:57 +02:00
parent 13067c8529
commit 2138752ce9
2 changed files with 5 additions and 2 deletions

View File

@ -535,6 +535,9 @@ class Counter(models.Model):
.exclude(perm_sum=None)
.order_by("-perm_sum")
)
def get_stats_starting_date(self) -> date:
return get_start_of_semester()
def get_top_customers(self, since=get_start_of_semester()) -> QuerySet:
"""

View File

@ -11,7 +11,7 @@
{% block content %}
<h3>{% trans counter_name=counter %}{{ counter_name }} stats{% endtrans %}</h3>
<h4>{% trans counter_name=counter.name %}Top 100 {{ counter_name }}{% endtrans %}</h4>
<h4>{% trans counter_name=counter.name %}Top 100 {{ counter_name }}{% endtrans %} ({{ counter.get_stats_starting_date() }})</h4>
<table>
<thead>
<tr>
@ -35,7 +35,7 @@
</tbody>
</table>
<h4>{% trans counter_name=counter.name %}Top 100 barman {{ counter_name }}{% endtrans %}</h4>
<h4>{% trans counter_name=counter.name %}Top 100 barman {{ counter_name }}{% endtrans %} ({{ counter.get_stats_starting_date() }})</h4>
<table>
<thead>
<tr>