|
|
|
|
@ -19,66 +19,63 @@ struct TournamentBuildView: View { |
|
|
|
|
var body: some View { |
|
|
|
|
let state = tournament.state() |
|
|
|
|
|
|
|
|
|
if tournament.hasEnded() { |
|
|
|
|
Section { |
|
|
|
|
Section { |
|
|
|
|
if tournament.hasEnded() { |
|
|
|
|
NavigationLink(value: Screen.rankings) { |
|
|
|
|
Text("Classement final des équipes") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
|
if tournament.groupStageCount > 0 { |
|
|
|
|
NavigationLink(value: Screen.groupStage) { |
|
|
|
|
LabeledContent { |
|
|
|
|
if let groupStageStatus { |
|
|
|
|
Text(groupStageStatus).lineLimit(1) |
|
|
|
|
.multilineTextAlignment(.trailing) |
|
|
|
|
} else { |
|
|
|
|
ProgressView() |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Poules") |
|
|
|
|
if tournament.shouldVerifyGroupStage { |
|
|
|
|
Text("Vérifier les poules").foregroundStyle(.logoRed) |
|
|
|
|
} |
|
|
|
|
if state == .running || state == .finished { |
|
|
|
|
TournamentInscriptionView(tournament: tournament) |
|
|
|
|
TournamentBroadcastRowView(tournament: tournament) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
NavigationLink(value: Screen.cashier) { |
|
|
|
|
let tournamentStatus = cashierStatus |
|
|
|
|
LabeledContent { |
|
|
|
|
if let tournamentStatus { |
|
|
|
|
Text(tournamentStatus.completion) |
|
|
|
|
} else { |
|
|
|
|
ProgressView() |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Encaissement") |
|
|
|
|
if let tournamentStatus { |
|
|
|
|
Text(tournamentStatus.label).lineLimit(1) |
|
|
|
|
} else { |
|
|
|
|
Text(" ") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.task { |
|
|
|
|
groupStageStatus = await tournament.groupStageStatus() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.task { |
|
|
|
|
cashierStatus = await tournament.cashierStatus() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if tournament.rounds().isEmpty == false { |
|
|
|
|
NavigationLink(value: Screen.round) { |
|
|
|
|
if state != .finished { |
|
|
|
|
NavigationLink(value: Screen.schedule) { |
|
|
|
|
let tournamentStatus = scheduleStatus |
|
|
|
|
LabeledContent { |
|
|
|
|
if let bracketStatus { |
|
|
|
|
Text(bracketStatus).lineLimit(1) |
|
|
|
|
.multilineTextAlignment(.trailing) |
|
|
|
|
if let tournamentStatus { |
|
|
|
|
Text(tournamentStatus.completion) |
|
|
|
|
} else { |
|
|
|
|
ProgressView() |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Tableau") |
|
|
|
|
if tournament.shouldVerifyBracket { |
|
|
|
|
Text("Vérifier la tableau").foregroundStyle(.logoRed) |
|
|
|
|
Text("Horaires") |
|
|
|
|
if let tournamentStatus { |
|
|
|
|
Text(tournamentStatus.label).lineLimit(1) |
|
|
|
|
} else { |
|
|
|
|
Text(" ") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.task { |
|
|
|
|
bracketStatus = await tournament.bracketStatus() |
|
|
|
|
scheduleStatus = await tournament.scheduleStatus() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
|
if state == .running || state == .finished { |
|
|
|
|
TournamentBroadcastRowView(tournament: tournament) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if state == .running || state == .finished { |
|
|
|
|
NavigationLink(value: Screen.cashier) { |
|
|
|
|
let tournamentStatus = cashierStatus |
|
|
|
|
NavigationLink(value: Screen.call) { |
|
|
|
|
let tournamentStatus = callStatus |
|
|
|
|
LabeledContent { |
|
|
|
|
if let tournamentStatus { |
|
|
|
|
Text(tournamentStatus.completion) |
|
|
|
|
@ -86,7 +83,7 @@ struct TournamentBuildView: View { |
|
|
|
|
ProgressView() |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Encaissement") |
|
|
|
|
Text("Convocations") |
|
|
|
|
if let tournamentStatus { |
|
|
|
|
Text(tournamentStatus.label).lineLimit(1) |
|
|
|
|
} else { |
|
|
|
|
@ -95,58 +92,53 @@ struct TournamentBuildView: View { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.task { |
|
|
|
|
cashierStatus = await tournament.cashierStatus() |
|
|
|
|
callStatus = await tournament.callStatus() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if state != .finished { |
|
|
|
|
NavigationLink(value: Screen.schedule) { |
|
|
|
|
let tournamentStatus = scheduleStatus |
|
|
|
|
Section { |
|
|
|
|
if tournament.groupStageCount > 0 { |
|
|
|
|
NavigationLink(value: Screen.groupStage) { |
|
|
|
|
LabeledContent { |
|
|
|
|
if let tournamentStatus { |
|
|
|
|
Text(tournamentStatus.completion) |
|
|
|
|
if let groupStageStatus { |
|
|
|
|
Text(groupStageStatus).lineLimit(1) |
|
|
|
|
.multilineTextAlignment(.trailing) |
|
|
|
|
} else { |
|
|
|
|
ProgressView() |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Horaires") |
|
|
|
|
if let tournamentStatus { |
|
|
|
|
Text(tournamentStatus.label).lineLimit(1) |
|
|
|
|
} else { |
|
|
|
|
Text(" ") |
|
|
|
|
Text("Poules") |
|
|
|
|
if tournament.shouldVerifyGroupStage { |
|
|
|
|
Text("Vérifier les poules").foregroundStyle(.logoRed) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.task { |
|
|
|
|
scheduleStatus = await tournament.scheduleStatus() |
|
|
|
|
groupStageStatus = await tournament.groupStageStatus() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
NavigationLink(value: Screen.call) { |
|
|
|
|
let tournamentStatus = callStatus |
|
|
|
|
if tournament.rounds().isEmpty == false { |
|
|
|
|
NavigationLink(value: Screen.round) { |
|
|
|
|
LabeledContent { |
|
|
|
|
if let tournamentStatus { |
|
|
|
|
Text(tournamentStatus.completion) |
|
|
|
|
if let bracketStatus { |
|
|
|
|
Text(bracketStatus).lineLimit(1) |
|
|
|
|
.multilineTextAlignment(.trailing) |
|
|
|
|
} else { |
|
|
|
|
ProgressView() |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Convocations") |
|
|
|
|
if let tournamentStatus { |
|
|
|
|
Text(tournamentStatus.label).lineLimit(1) |
|
|
|
|
} else { |
|
|
|
|
Text(" ") |
|
|
|
|
Text("Tableau") |
|
|
|
|
if tournament.shouldVerifyBracket { |
|
|
|
|
Text("Vérifier la tableau").foregroundStyle(.logoRed) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.task { |
|
|
|
|
callStatus = await tournament.callStatus() |
|
|
|
|
bracketStatus = await tournament.bracketStatus() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if state == .running || state == .finished { |
|
|
|
|
TournamentInscriptionView(tournament: tournament) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|