Merge pull request 'stats' (#835) from stats into staging
Reviewed-on: #835
This commit is contained in:
commit
e5c2bec145
@ -20,6 +20,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="filter-result-js" class="search-result"></div>
|
<div id="filter-result-js" class="search-result"></div>
|
||||||
<div class="border-r border-l border-gray-200 dark:border-primary-600">
|
<div class="border-r border-l border-gray-200 dark:border-primary-600">
|
||||||
|
<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>
|
||||||
|
<span><b>km</b></span>
|
||||||
|
<span class="pl-3 w-20 text-right"><b>Fahrten</b></span>
|
||||||
|
</div>
|
||||||
{% set_global km = 0 %} {% set_global km = 0 %} {% set_global index = 1 %}
|
{% set_global km = 0 %} {% set_global km = 0 %} {% set_global index = 1 %}
|
||||||
{% for s in stat %}
|
{% for s in stat %}
|
||||||
<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"
|
<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"
|
||||||
@ -34,72 +42,62 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
<span class="grow">{{ s.name }}</span>
|
<span class="grow">{{ s.name }}</span>
|
||||||
<span>{{ s.rowed_km }} km</span>
|
<span>{{ s.rowed_km }}</span>
|
||||||
<span class="pl-3">{{ s.amount_trips }} Fahrt{{ s.amount_trips | pluralize(plural="en") }}</span>
|
<span class="pl-3 w-20 text-right">{{ s.amount_trips }}</span>
|
||||||
{% set_global km = s.rowed_km %}
|
{% set_global km = s.rowed_km %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<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"
|
<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"
|
||||||
data-filterable="false"
|
data-filterable="false"
|
||||||
data-filter="Summe Vereinsmitglieder">
|
data-filter="Summe Vereinsmitglieder">
|
||||||
<span class="text-sm text-gray-600 dark:text-gray-100 w-10"></span>
|
<span class="text-sm text-gray-600 dark:text-gray-100 w-10"></span>
|
||||||
<span class="grow"><b>Summe Vereinsmitglieder</b></span>
|
<span class="grow"><b>Summe Vereinsmitglieder</b></span>
|
||||||
<span><b>{{ club_km }} km</b></span>
|
<span><b>{{ club_km }}</b></span>
|
||||||
<span class="pl-3"><b>{{ club_trips }} Fahrt{{ club_trips | pluralize(plural="en") }}</b></span>
|
<span class="pl-3 w-20 text-right"><b>{{ club_trips }}</b></span>
|
||||||
</div>
|
</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"
|
<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-filterable="false"
|
||||||
data-filter="Summe {{ guest_km.name }}">
|
data-filter="Summe {{ guest_km.name }}">
|
||||||
<span class="text-sm text-gray-600 dark:text-gray-100 w-10"></span>
|
<span class="text-sm text-gray-600 dark:text-gray-100 w-10"></span>
|
||||||
<span class="grow"><b>Summe {{ guest_km.name }}</b></span>
|
<span class="grow"><b>Summe {{ guest_km.name }}</b></span>
|
||||||
<span><b>{{ guest_km.rowed_km }} km</b></span>
|
<span><b>{{ guest_km.rowed_km }}</b></span>
|
||||||
<span class="pl-3"><b>{{ guest_km.amount_trips }} Fahrt{{ guest_km.amount_trips | pluralize(plural="en") }}</b></span>
|
<span class="pl-3 w-20 text-right"><b>{{ guest_km.amount_trips }}</b></span>
|
||||||
</div>
|
</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"
|
<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"
|
||||||
data-filterable="false"
|
data-filterable="false"
|
||||||
data-filter="Gesamtsumme">
|
data-filter="Gesamtsumme">
|
||||||
<span class="text-sm text-gray-600 dark:text-gray-100 w-10"></span>
|
<span class="text-sm text-gray-600 dark:text-gray-100 w-10"></span>
|
||||||
<span class="grow"><b>Gesamtsumme</b></span>
|
<span class="grow"><b>Gesamtsumme</b></span>
|
||||||
<span><b>{{ club_km + guest_km.rowed_km }} km</b></span>
|
<span><b>{{ club_km + guest_km.rowed_km }}</b></span>
|
||||||
<span class="pl-3"><b>{{ guest_km.amount_trips + club_trips }} Fahrt{{ guest_km.amount_trips + club_trips | pluralize(plural="en") }}</b></span>
|
<span class="pl-3 w-20 text-right"><b>{{ guest_km.amount_trips + club_trips }}</b></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="container" class="w-full"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
{% if personal %}
|
function getYearFromURL() {
|
||||||
const data = [
|
var queryParams = new URLSearchParams(window.location.search);
|
||||||
{%- for p in personal %}{ date: '{{p.date}}', km: {{p.km}} },{%- endfor %}
|
return queryParams.get('year');
|
||||||
]
|
}
|
||||||
sessionStorage.setItem('userStats', JSON.stringify(data));
|
|
||||||
{% endif %}
|
function populateYears() {
|
||||||
|
var select = document.getElementById('yearSelect');
|
||||||
function getYearFromURL() {
|
var currentYear = new Date().getFullYear();
|
||||||
var queryParams = new URLSearchParams(window.location.search);
|
var selectedYear = getYearFromURL() || currentYear;
|
||||||
return queryParams.get('year');
|
for (var year = 1977; year <= currentYear; year++) {
|
||||||
}
|
var option = document.createElement('option');
|
||||||
|
option.value = option.textContent = year;
|
||||||
function populateYears() {
|
if (year == selectedYear) {
|
||||||
var select = document.getElementById('yearSelect');
|
option.selected = true;
|
||||||
var currentYear = new Date().getFullYear();
|
}
|
||||||
var selectedYear = getYearFromURL() || currentYear;
|
select.appendChild(option);
|
||||||
for (var year = 1977; year <= currentYear; year++) {
|
}
|
||||||
var option = document.createElement('option');
|
}
|
||||||
option.value = option.textContent = year;
|
|
||||||
if (year == selectedYear) {
|
function changeYear() {
|
||||||
option.selected = true;
|
var selectedYear = document.getElementById('yearSelect').value;
|
||||||
}
|
window.location.href = '?year=' + selectedYear;
|
||||||
select.appendChild(option);
|
}
|
||||||
}
|
|
||||||
}
|
populateYears();
|
||||||
|
|
||||||
function changeYear() {
|
|
||||||
var selectedYear = document.getElementById('yearSelect').value;
|
|
||||||
window.location.href = '?year=' + selectedYear;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Call this function when the page loads
|
|
||||||
populateYears();
|
|
||||||
</script>
|
</script>
|
||||||
<script src="/public/logbook.js"></script>
|
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user