feat(mannschaften): split SUN columns and prepare seasonal team CSVs
Some checks failed
Code Analysis and Production Deploy / analyze (push) Failing after 2m40s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Has been skipped

This commit is contained in:
Torsten Schulz (local)
2026-05-20 17:45:14 +02:00
parent e19158558d
commit 2d42ef3ecd
3 changed files with 65 additions and 27 deletions

View File

@@ -51,7 +51,7 @@
<!-- Mannschaftsaufstellung -->
<div class="bg-white rounded-xl shadow-lg p-6">
<h2 class="text-2xl font-semibold text-gray-900 mb-6">
Mannschaftsaufstellung Saison 2025/26
Mannschaftsaufstellung Saison {{ mannschaftSeasonLabel }}
</h2>
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-4">
<div
@@ -233,14 +233,17 @@
Spiele
</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
S/U/N
S
</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
U
</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
N
</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Sätze
</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Bälle
</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Punkte
</th>
@@ -262,13 +265,16 @@
{{ row.meetings_count ?? '-' }}
</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900">
{{ formatSun(row) }}
{{ row.meetings_won ?? 0 }}
</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900">
{{ row.sets_relation || '-' }}
{{ row.meetings_tie ?? 0 }}
</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900">
{{ row.games_relation || '-' }}
{{ row.meetings_lost ?? 0 }}
</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900">
{{ formatSaetze(row) }}
</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900">
{{ formatPunkte(row) }}
@@ -364,6 +370,15 @@ const spielplanSeasonLabel = computed(() => {
return match ? `20${match[1]}/${match[2]}` : ''
})
const mannschaftSeasonLabel = computed(() => {
if (spielplanSeasonLabel.value) return spielplanSeasonLabel.value
const now = new Date()
const year = now.getFullYear()
const start = now.getMonth() >= 6 ? year : year - 1
return `${start}/${String(start + 1).slice(-2)}`
})
async function fetchCsvText(url) {
const attempt = async () => {
const withBuster = `${url}${url.includes('?') ? '&' : '?'}_t=${Date.now()}`
@@ -650,12 +665,11 @@ const getRowClass = (row) => {
return 'bg-white'
}
const formatSun = (row) => {
const s = row?.meetings_won
const u = row?.meetings_tie
const n = row?.meetings_lost
if (s == null && u == null && n == null) return '-'
return `${s ?? 0}/${u ?? 0}/${n ?? 0}`
const formatSaetze = (row) => {
const won = row?.sets_won
const lost = row?.sets_lost
if (won == null && lost == null) return row?.sets_relation || '-'
return `${won ?? 0}:${lost ?? 0}`
}
const formatPunkte = (row) => {