2023-07-24 20:56:46 +02:00
|
|
|
{% import "includes/macros" as macros %}
|
|
|
|
|
|
|
|
{% extends "base" %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
|
2023-07-30 14:33:50 +02:00
|
|
|
<div class="max-w-screen-lg w-full">
|
2023-09-27 15:36:07 +02:00
|
|
|
<h1 class="h1">Statistik</h1>
|
2023-11-04 19:33:36 +01:00
|
|
|
<div class="search-wrapper">
|
2023-09-28 11:52:14 +02:00
|
|
|
<label for="name" class="sr-only">Suche</label>
|
2023-11-04 19:33:36 +01:00
|
|
|
<input type="search" name="name" id="filter-js" class="search-bar" placeholder="Suchen nach Namen...">
|
2023-09-28 11:52:14 +02:00
|
|
|
</div>
|
|
|
|
|
2023-11-04 19:33:36 +01:00
|
|
|
<div id="filter-result-js" class="search-result"></div>
|
2023-09-28 11:52:14 +02:00
|
|
|
|
2023-11-04 19:33:36 +01:00
|
|
|
<div class="border-r border-l border-gray-200 dark:border-primary-600">
|
2023-09-28 09:26:30 +02:00
|
|
|
{% set_global km = 0 %}
|
2023-09-28 11:52:14 +02:00
|
|
|
{% set_global index = 1 %}
|
2023-07-30 14:33:50 +02:00
|
|
|
{% for s in stat %}
|
2023-11-04 19:33:36 +01:00
|
|
|
<div class="border-t border-gray-200 dark:border-primary-600 {% if loop.last %} border-b {% endif %} bg-white dark:bg-primary-900 text-black dark:text-white flex justify-between items-center px-3 py-1" data-filterable="true" data-filter="{{ s.name }}">
|
|
|
|
<span class="text-sm text-gray-600 dark:text-gray-100 w-10">
|
2023-09-28 11:52:14 +02:00
|
|
|
{% if km != s.rowed_km %}
|
|
|
|
{{loop.index}}
|
|
|
|
{% set_global index = loop.index %}
|
|
|
|
{% else %}
|
|
|
|
{{ index }}
|
|
|
|
{% endif %}
|
|
|
|
</span>
|
|
|
|
<span class="grow">{{s.name}}</span>
|
2023-09-27 15:55:17 +02:00
|
|
|
<span>{{s.rowed_km}} km</span>
|
2023-09-28 11:52:14 +02:00
|
|
|
|
2023-09-28 09:26:30 +02:00
|
|
|
{% set_global km = s.rowed_km %}
|
2023-09-28 11:52:14 +02:00
|
|
|
</div>
|
2023-07-30 14:33:50 +02:00
|
|
|
{% endfor %}
|
2023-09-28 11:52:14 +02:00
|
|
|
</div>
|
2023-10-01 13:40:36 +02:00
|
|
|
<div id="container" class="w-full"></div>
|
2023-07-30 14:33:50 +02:00
|
|
|
</div>
|
2023-10-01 13:40:36 +02:00
|
|
|
|
2023-10-01 15:39:30 +02:00
|
|
|
<script>
|
2023-10-01 20:50:23 +02:00
|
|
|
{% if personal %}
|
2023-10-01 14:19:23 +02:00
|
|
|
const data = [
|
2023-10-01 14:35:04 +02:00
|
|
|
{%- for p in personal %}
|
|
|
|
{ date: '{{p.date}}', km: {{p.km}} },
|
|
|
|
{%- endfor %}
|
2023-10-01 15:39:30 +02:00
|
|
|
]
|
2023-10-01 18:41:20 +02:00
|
|
|
sessionStorage.setItem('userStats', JSON.stringify(data));
|
2023-10-01 20:50:23 +02:00
|
|
|
{% endif %}
|
2023-10-01 13:40:36 +02:00
|
|
|
</script>
|
2023-10-01 15:39:30 +02:00
|
|
|
|
|
|
|
<script src="/public/logbook.js"></script>
|
2023-07-24 20:56:46 +02:00
|
|
|
{% endblock content%}
|