|
|
|
|
@ -18,85 +18,38 @@ struct TournamentBuildView: View { |
|
|
|
|
@ViewBuilder |
|
|
|
|
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) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.task { |
|
|
|
|
groupStageStatus = await tournament.groupStageStatus() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if tournament.rounds().isEmpty == false { |
|
|
|
|
NavigationLink(value: Screen.round) { |
|
|
|
|
LabeledContent { |
|
|
|
|
if let bracketStatus { |
|
|
|
|
Text(bracketStatus).lineLimit(1) |
|
|
|
|
.multilineTextAlignment(.trailing) |
|
|
|
|
} else { |
|
|
|
|
ProgressView() |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Tableau") |
|
|
|
|
if tournament.shouldVerifyBracket { |
|
|
|
|
Text("Vérifier la tableau").foregroundStyle(.logoRed) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.task { |
|
|
|
|
bracketStatus = await tournament.bracketStatus() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
|
|
|
|
|
|
if state == .running || state == .finished { |
|
|
|
|
TournamentInscriptionView(tournament: tournament) |
|
|
|
|
TournamentBroadcastRowView(tournament: tournament) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if state == .running || state == .finished { |
|
|
|
|
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(" ") |
|
|
|
|
} |
|
|
|
|
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 { |
|
|
|
|
cashierStatus = await tournament.cashierStatus() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.task { |
|
|
|
|
cashierStatus = await tournament.cashierStatus() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if state != .finished { |
|
|
|
|
@ -142,11 +95,50 @@ struct TournamentBuildView: View { |
|
|
|
|
callStatus = await tournament.callStatus() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.task { |
|
|
|
|
groupStageStatus = await tournament.groupStageStatus() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if state == .running || state == .finished { |
|
|
|
|
TournamentInscriptionView(tournament: tournament) |
|
|
|
|
if tournament.rounds().isEmpty == false { |
|
|
|
|
NavigationLink(value: Screen.round) { |
|
|
|
|
LabeledContent { |
|
|
|
|
if let bracketStatus { |
|
|
|
|
Text(bracketStatus).lineLimit(1) |
|
|
|
|
.multilineTextAlignment(.trailing) |
|
|
|
|
} else { |
|
|
|
|
ProgressView() |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Tableau") |
|
|
|
|
if tournament.shouldVerifyBracket { |
|
|
|
|
Text("Vérifier la tableau").foregroundStyle(.logoRed) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.task { |
|
|
|
|
bracketStatus = await tournament.bracketStatus() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|