rowt/templates/stat.people.html.tera

104 lines
5.1 KiB
Plaintext
Raw Normal View History

2023-07-24 20:56:46 +02:00
{% import "includes/macros" as macros %}
{% extends "base" %}
{% block content %}
2024-03-04 13:28:42 +01:00
<div class="max-w-screen-lg w-full">
<h1 class="h1">
Statistik
<select id="yearSelect"
onchange="changeYear()"
style="background: transparent;
background-image: none;
text-decoration: underline"></select>
</h1>
<div class="search-wrapper">
<label for="name" class="sr-only">Suche</label>
<input type="search"
name="name"
id="filter-js"
class="search-bar"
placeholder="Suchen nach Namen..." />
</div>
<div id="filter-result-js" class="search-result"></div>
<div class="border-r border-l border-gray-200 dark:border-primary-600">
2025-01-07 10:52:46 +01:00
<div class="border-t border-gray-200 dark:border-primary-600 bg-white dark:bg-primary-900 text-black dark:text-white flex justify-between items-center px-3 py-1"
data-filterable="false"
data-filter="Header">
<span class="text-sm text-gray-600 dark:text-gray-100 w-10"><b>#</b></span>
<span class="grow"><b>Name</b></span>
2025-01-07 14:07:52 +01:00
<span class="pl-3 w-20 text-right"><b>km</b></span>
2025-01-07 10:52:46 +01:00
<span class="pl-3 w-20 text-right"><b>Fahrten</b></span>
</div>
2025-01-06 13:14:19 +01:00
{% set_global km = 0 %} {% set_global km = 0 %} {% set_global index = 1 %}
2024-03-04 13:28:42 +01:00
{% for s in stat %}
2024-03-20 13:34:21 +01:00
<div class="border-t border-gray-200 dark:border-primary-600 bg-white dark:bg-primary-900 text-black dark:text-white flex justify-between items-center px-3 py-1"
2024-03-04 13:28:42 +01:00
data-filterable="true"
data-filter="{{ s.name }}">
<span class="text-sm text-gray-600 dark:text-gray-100 w-10">
{% if km != s.rowed_km %}
{{ loop.index }}
{% set_global index = loop.index %}
{% else %}
{{ index }}
{% endif %}
</span>
<span class="grow">{{ s.name }}</span>
2025-01-07 14:07:52 +01:00
<span class="pl-3 w-20 text-right">{{ s.rowed_km }}</span>
2025-01-07 10:52:46 +01:00
<span class="pl-3 w-20 text-right">{{ s.amount_trips }}</span>
2024-03-04 13:28:42 +01:00
{% set_global km = s.rowed_km %}
</div>
{% endfor %}
2025-01-07 10:52:46 +01:00
<div class="border-t border-black dark:border-white bg-white dark:bg-primary-900 text-black dark:text-white flex justify-between items-center px-3 py-1"
2025-01-04 10:56:32 +01:00
data-filterable="false"
2024-03-20 13:41:14 +01:00
data-filter="Summe Vereinsmitglieder">
2024-03-20 13:34:21 +01:00
<span class="text-sm text-gray-600 dark:text-gray-100 w-10"></span>
2024-03-20 13:41:14 +01:00
<span class="grow"><b>Summe Vereinsmitglieder</b></span>
2025-01-07 14:07:52 +01:00
<span class="pl-3 w-20 text-right"><b>{{ club_km }}</b></span>
2025-01-07 10:52:46 +01:00
<span class="pl-3 w-20 text-right"><b>{{ club_trips }}</b></span>
2024-03-20 13:41:14 +01:00
</div>
<div class="border-t border-gray-200 dark:border-primary-600 bg-white dark:bg-primary-900 text-black dark:text-white flex justify-between items-center px-3 py-1"
2025-01-04 10:56:32 +01:00
data-filterable="false"
2024-03-20 13:41:14 +01:00
data-filter="Summe {{ guest_km.name }}">
<span class="text-sm text-gray-600 dark:text-gray-100 w-10"></span>
<span class="grow"><b>Summe {{ guest_km.name }}</b></span>
2025-01-07 14:07:52 +01:00
<span class="pl-3 w-20 text-right"><b>{{ guest_km.rowed_km }}</b></span>
2025-01-07 10:52:46 +01:00
<span class="pl-3 w-20 text-right"><b>{{ guest_km.amount_trips }}</b></span>
2024-03-20 13:34:21 +01:00
</div>
<div class="border-t border-gray-200 dark:border-primary-600 border-b bg-white dark:bg-primary-900 text-black dark:text-white flex justify-between items-center px-3 py-1"
2025-01-04 10:56:32 +01:00
data-filterable="false"
2024-03-20 13:41:14 +01:00
data-filter="Gesamtsumme">
2024-03-04 13:28:42 +01:00
<span class="text-sm text-gray-600 dark:text-gray-100 w-10"></span>
2024-03-20 13:41:14 +01:00
<span class="grow"><b>Gesamtsumme</b></span>
2025-01-07 14:07:52 +01:00
<span class="pl-3 w-20 text-right"><b>{{ club_km + guest_km.rowed_km }}</b></span>
2025-01-07 10:52:46 +01:00
<span class="pl-3 w-20 text-right"><b>{{ guest_km.amount_trips + club_trips }}</b></span>
2024-03-04 13:28:42 +01:00
</div>
</div>
2023-12-23 15:26:49 +01:00
</div>
2025-01-07 11:44:56 +01:00
<script>
function getYearFromURL() {
var queryParams = new URLSearchParams(window.location.search);
return queryParams.get('year');
}
function populateYears() {
var select = document.getElementById('yearSelect');
var currentYear = new Date().getFullYear();
var selectedYear = getYearFromURL() || currentYear;
for (var year = 1977; year <= currentYear; year++) {
var option = document.createElement('option');
option.value = option.textContent = year;
if (year == selectedYear) {
option.selected = true;
}
select.appendChild(option);
}
}
function changeYear() {
var selectedYear = document.getElementById('yearSelect').value;
window.location.href = '?year=' + selectedYear;
}
populateYears();
</script>
2025-01-07 11:39:36 +01:00
{% endblock content %}