From: Daniel Karbach Date: Fri, 2 Jan 2026 13:03:50 +0000 (+0100) Subject: tournament group_size settings form X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=85d902651f227ae9322d5bc6e07b2ff7cc593cf8;p=alttp.git tournament group_size settings form --- diff --git a/app/Http/Controllers/RoundController.php b/app/Http/Controllers/RoundController.php index 6814c45..a33785b 100644 --- a/app/Http/Controllers/RoundController.php +++ b/app/Http/Controllers/RoundController.php @@ -187,7 +187,7 @@ class RoundController extends Controller } private static $GROUP_NAMES = [ - 'A', 'B', 'C', 'D', 'E', + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', ]; } diff --git a/app/Http/Controllers/TournamentController.php b/app/Http/Controllers/TournamentController.php index 9feb053..b3561ee 100644 --- a/app/Http/Controllers/TournamentController.php +++ b/app/Http/Controllers/TournamentController.php @@ -114,15 +114,19 @@ class TournamentController extends Controller public function settings(Request $request, Tournament $tournament) { $this->authorize('update', $tournament); $validatedData = $request->validate([ + 'group_size' => 'integer|nullable', 'result_reveal' => 'string|nullable|in:always,finishers,never,participants', 'show_numbers' => 'boolean|nullable', ]); - if (array_key_exists('show_numbers', $validatedData)) { - $tournament->show_numbers = $validatedData['show_numbers']; + if (array_key_exists('group_size', $validatedData)) { + $tournament->group_size = $validatedData['group_size']; } if (isset($validatedData['result_reveal'])) { $tournament->result_reveal = $validatedData['result_reveal']; } + if (array_key_exists('show_numbers', $validatedData)) { + $tournament->show_numbers = $validatedData['show_numbers']; + } $tournament->save(); if ($tournament->wasChanged()) { TournamentChanged::dispatch($tournament); diff --git a/resources/js/components/tournament/SettingsDialog.jsx b/resources/js/components/tournament/SettingsDialog.jsx index ad2de57..a24f383 100644 --- a/resources/js/components/tournament/SettingsDialog.jsx +++ b/resources/js/components/tournament/SettingsDialog.jsx @@ -112,6 +112,24 @@ const SettingsDialog = ({ value={tournament.show_numbers} /> + {Tournament.hasAssignedGroups(tournament) ? ( +
+ {i18n.t('tournaments.groupSize')} + { + const num = parseInt(value, 10); + if (value >= 1 && value <= 8) { + settings(tournament, { group_size: num }); + } + }} + type="number" + value={tournament.group_size} + /> +
+ ) : null}
{i18n.t('tournaments.resultReveal')} @@ -177,6 +195,7 @@ SettingsDialog.propTypes = { accept_applications: PropTypes.bool, discord: PropTypes.string, locked: PropTypes.bool, + group_size: PropTypes.number, result_reveal: PropTypes.string, show_numbers: PropTypes.bool, }), diff --git a/resources/js/i18n/de.js b/resources/js/i18n/de.js index a739183..ae56a37 100644 --- a/resources/js/i18n/de.js +++ b/resources/js/i18n/de.js @@ -924,6 +924,7 @@ export default { discordSettingsError: 'Fehler beim Speichern der Discord Einstellungen', discordSettingsSuccess: 'Discord Einstellungen gespeichert', discordSuccess: 'Discord verknüpft', + groupSize: 'Seeds pro Runde', inviteBot: 'Bot einladen', locked: 'Turnier sperren', lockError: 'Fehler beim Sperren', diff --git a/resources/js/i18n/en.js b/resources/js/i18n/en.js index a1c296d..d633cae 100644 --- a/resources/js/i18n/en.js +++ b/resources/js/i18n/en.js @@ -925,6 +925,7 @@ export default { discordSettingsError: 'Error saving discord settings', discordSettingsSuccess: 'Discord settings saved', discordSuccess: 'Discord associated', + groupSize: 'Seeds per Round', inviteBot: 'Invite bot', locked: 'Lock rounds', lockError: 'Error locking tournament',