Fixed orders/weekday statistic, improved statistics page layout

This commit is contained in:
Julian Müller (ChaoticByte) 2023-10-31 18:00:20 +01:00
parent 60d2df9fb9
commit 31ae251164
5 changed files with 62 additions and 39 deletions

View file

@ -8,14 +8,14 @@
{% block content %}
<h1>{% translate "Statistics" %}</h1>
<div>
<div class="flex flex-column flex-center">
<h3>{% translate "Orders per drink" %}</h3>
<div class="statistics-container">
<div class="flex flex-column">
<h3>{% translate "orders / drink" %}</h3>
<table>
<tr>
<th>{% translate "drink" %}</th>
<th>{% translate "you" %}</th>
<th>{% translate "all" %}</th>
<th>{% translate "you" %}</th>
</tr>
{% for key, values in orders_per_drink.items %}
<tr>
@ -26,13 +26,13 @@
{% endfor %}
</table>
</div>
<div class="flex flex-column flex-center">
<h3>{% translate "Orders per month (last 12 months)" %}</h3>
<div class="flex flex-column">
<h3>{% translate "orders / month" %}</h3>
<table>
<tr>
<th>{% translate "month" %}</th>
<th>{% translate "you" %}</th>
<th>{% translate "all" %}</th>
<th>{% translate "you" %}</th>
</tr>
{% for key, values in orders_per_month.items %}
<tr>
@ -43,19 +43,19 @@
{% endfor %}
</table>
</div>
<div class="flex flex-column flex-center">
<h3>{% translate "Orders per weekday" %}</h3>
<div class="flex flex-column">
<h3>{% translate "orders / weekday" %}</h3>
<table>
<tr>
<th>{% translate "day" %}</th>
<th>{% translate "you" %}</th>
<th>{% translate "all" %}</th>
<th>{% translate "you" %}</th>
</tr>
{% for key, values in orders_per_weekday.items %}
{% for values in orders_per_weekday %}
<tr>
<td>{{ key }}</td>
<td>{{ values.a|default:"0" }}</td>
<td>{{ values.b|default:"0" }}</td>
<td>{{ values.0 }}</td>
<td>{{ values.1|default:"0" }}</td>
<td>{{ values.2|default:"0" }}</td>
</tr>
{% endfor %}
</table>