Redesigned the user interface #23

This commit is contained in:
ChaoticByte 2023-02-17 22:01:09 +01:00
parent f7048d1e9f
commit d93591bcb2
32 changed files with 846 additions and 1297 deletions

View file

@ -3,146 +3,62 @@
{% load i18n %}
{% block title %}
{% translate "Drinks - Statistics" %}
{% translate "Drinks - Statistics" %}
{% endblock %}
{% block headAdditional %}
<link rel="stylesheet" href="/static/css/statistics.css">
{% endblock %}
{% block content %}
<h1 class="heading">{% translate "Statistics" %}</h1>
<div class="maincontainer">
<div class="tablescontainer">
<div id="noyopd" class="statisticstable">
<h1>{% translate "Your orders per drink" %}</h1>
{% if noyopd %}
<table>
<tr>
<th>{% translate "drink" %}</th>
<th>{% translate "count" %}</th>
</tr>
{% for row in noyopd %}
<tr>
<td>{{ row.0 }}</td>
<td>{{ row.1 }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<div>{% translate "No history." %}</div>
{% endif %}
</div>
<div id="noaopd" class="statisticstable">
<h1>{% translate "All orders per drink" %}</h1>
{% if noaopd %}
<table>
<tr>
<th>{% translate "drink" %}</th>
<th>{% translate "count" %}</th>
</tr>
{% for row in noaopd %}
<tr>
<td>{{ row.0 }}</td>
<td>{{ row.1 }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<div>{% translate "No history." %}</div>
{% endif %}
</div>
<div id="yopml12m" class="statisticstable">
<h1>{% translate "Your orders per month (last 12 months)" %}</h1>
{% if yopml12m %}
<table>
<tr>
<th>{% translate "month" %}</th>
<th>{% translate "count" %}</th>
</tr>
{% for row in yopml12m %}
<tr>
<td>{{ row.0 }}</td>
<td>{{ row.1 }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<div>{% translate "No history." %}</div>
{% endif %}
</div>
<div id="aopml12m" class="statisticstable">
<h1>{% translate "All orders per month (last 12 months)" %}</h1>
{% if aopml12m %}
<table>
<tr>
<th>{% translate "month" %}</th>
<th>{% translate "count" %}</th>
</tr>
{% for row in aopml12m %}
<tr>
<td>{{ row.0 }}</td>
<td>{{ row.1 }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<div>{% translate "No history." %}</div>
{% endif %}
</div>
<div id="yopwd" class="statisticstable">
<h1>{% translate "Your orders per weekday" %}</h1>
{% if yopwd %}
<table>
<tr>
<th>{% translate "day" %}</th>
<th>{% translate "count" %}</th>
</tr>
{% for row in yopwd %}
<tr>
<td>{{ row.0 }}</td>
<td>{{ row.1 }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<div>{% translate "No history." %}</div>
{% endif %}
</div>
<div id="aopwd" class="statisticstable">
<h1>{% translate "All orders per weekday" %}</h1>
{% if aopwd %}
<table>
<tr>
<th>{% translate "day" %}</th>
<th>{% translate "count" %}</th>
</tr>
{% for row in aopwd %}
<tr>
<td>{{ row.0 }}</td>
<td>{{ row.1 }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<div>{% translate "No history." %}</div>
{% endif %}
</div>
</div>
<h1>{% translate "Statistics" %}</h1>
<div>
<div class="flex flex-column flex-center">
<h3>{% translate "Orders per drink" %}</h3>
<table>
<tr>
<th>{% translate "drink" %}</th>
<th>{% translate "you" %}</th>
<th>{% translate "all" %}</th>
</tr>
{% for key, values in orders_per_drink.items %}
<tr>
<td>{{ key }}</td>
<td>{{ values.a|default:"0" }}</td>
<td>{{ values.b|default:"0" }}</td>
</tr>
{% endfor %}
</table>
</div>
<script src="/static/js/autoreload.js"></script>
{% endblock %}
<div class="flex flex-column flex-center">
<h3>{% translate "Orders per month (last 12 months)" %}</h3>
<table>
<tr>
<th>{% translate "month" %}</th>
<th>{% translate "you" %}</th>
<th>{% translate "all" %}</th>
</tr>
{% for key, values in orders_per_month.items %}
<tr>
<td>{{ key }}</td>
<td>{{ values.a|default:"0" }}</td>
<td>{{ values.b|default:"0" }}</td>
</tr>
{% endfor %}
</table>
</div>
<div class="flex flex-column flex-center">
<h3>{% translate "Orders per weekday" %}</h3>
<table>
<tr>
<th>{% translate "day" %}</th>
<th>{% translate "you" %}</th>
<th>{% translate "all" %}</th>
</tr>
{% for key, values in orders_per_weekday.items %}
<tr>
<td>{{ key }}</td>
<td>{{ values.a|default:"0" }}</td>
<td>{{ values.b|default:"0" }}</td>
</tr>
{% endfor %}
</table>
</div>
<script src="/static/js/autoreload.js"></script>
{% endblock %}