feat(tournament): update mini championship creation to include location
- Modified addMiniChampionship method to accept location (ort) instead of tournament name. - Updated frontend components to reflect the change, including new input for location and localization updates for German language support. - Enhanced validation to ensure location is provided during mini championship creation.
This commit is contained in:
@@ -565,6 +565,7 @@
|
||||
"newMiniChampionship": "Neue Minimeisterschaft",
|
||||
"miniChampionshipYear": "Jahr (Altersstufen)",
|
||||
"miniChampionshipYearHint": "12 = in diesem Jahr 11 oder 12 Jahre, 10 = 9 oder 10, 8 = 8 oder jünger",
|
||||
"miniChampionshipLocation": "Ort",
|
||||
"tournamentParticipations": "Turnierteilnahmen",
|
||||
"date": "Datum",
|
||||
"newTournament": "Neues Turnier",
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
<div v-if="selectedDate === 'new'" class="new-tournament">
|
||||
<template v-if="isMiniChampionship">
|
||||
<label>
|
||||
{{ $t('tournaments.name') }}:
|
||||
<input type="text" v-model="newTournamentName" :placeholder="$t('tournaments.tournamentName')" />
|
||||
{{ $t('tournaments.miniChampionshipLocation') }}:
|
||||
<input type="text" v-model="newMiniOrt" :placeholder="$t('tournaments.miniChampionshipLocation')" />
|
||||
</label>
|
||||
<label>
|
||||
{{ $t('tournaments.date') }}:
|
||||
@@ -334,6 +334,7 @@ export default {
|
||||
newTournamentName: '',
|
||||
newWinningSets: 3,
|
||||
newMiniYear: new Date().getFullYear(),
|
||||
newMiniOrt: '',
|
||||
currentTournamentName: '',
|
||||
currentTournamentDate: '',
|
||||
currentWinningSets: 3,
|
||||
@@ -1610,6 +1611,11 @@ export default {
|
||||
},
|
||||
|
||||
async createMiniChampionship() {
|
||||
const ort = (this.newMiniOrt || '').trim();
|
||||
if (!ort) {
|
||||
await this.showInfo(this.$t('messages.error'), this.$t('tournaments.miniChampionshipLocation') + ' eingeben.', '', 'error');
|
||||
return;
|
||||
}
|
||||
if (!this.newDate) {
|
||||
await this.showInfo(this.$t('messages.error'), this.$t('tournaments.pleaseEnterDate'), '', 'error');
|
||||
return;
|
||||
@@ -1622,7 +1628,7 @@ export default {
|
||||
try {
|
||||
const r = await apiClient.post('/tournament/mini', {
|
||||
clubId: this.currentClub,
|
||||
tournamentName: this.newTournamentName || (`Minimeisterschaft ${year}`),
|
||||
ort,
|
||||
date: this.newDate,
|
||||
year,
|
||||
winningSets: this.newWinningSets
|
||||
@@ -1631,7 +1637,7 @@ export default {
|
||||
await this.loadTournaments();
|
||||
this.selectedDate = newTournamentId;
|
||||
this.newDate = '';
|
||||
this.newTournamentName = '';
|
||||
this.newMiniOrt = '';
|
||||
this.newMiniYear = new Date().getFullYear();
|
||||
this.newWinningSets = 3;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user