Refactor team name formatting and update version to 1.8.6
Some checks failed
Code Analysis and Production Deploy / analyze (push) Failing after 2m27s
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-08-26 10:22:08 +02:00
parent 7aadb5e215
commit 2103e9c1e8
10 changed files with 87 additions and 54 deletions

View File

@@ -58,7 +58,9 @@
</p>
</div>
<p class="text-sm text-gray-800">
{{ game.HeimMannschaft }} vs {{ game.GastMannschaft }}
{{ formatMatchTeamName(game.HeimMannschaft, game.HeimMannschaftAltersklasse) }}
vs
{{ formatMatchTeamName(game.GastMannschaft, game.GastMannschaftAltersklasse) }}
</p>
</div>
</div>
@@ -69,6 +71,7 @@
<script setup>
import { computed, ref, watch } from 'vue'
import { formatTeamDisplayName } from '~/utils/team-display'
const props = defineProps({
season: {
@@ -91,10 +94,13 @@ const games = ref([])
const widgetTitle = computed(() => {
if (!props.teamName) return 'Mannschaft'
const youth = String(props.teamAgeGroup || '').toLowerCase().includes('jugend')
return youth ? `(J) ${props.teamName}` : props.teamName
return formatTeamDisplayName(props.teamName, props.teamAgeGroup)
})
function formatMatchTeamName(teamName, teamAgeGroup) {
return formatTeamDisplayName(teamName, teamAgeGroup) || '-'
}
const seasonLabel = computed(() => {
const match = String(props.season || '').match(/^(\d{2})--(\d{2})$/)
if (!match) return props.season || '-'
@@ -184,4 +190,4 @@ watch(
},
{ immediate: true }
)
</script>
</script>