|
|
|
|
@ -153,16 +153,22 @@ struct TournamentCellView: View { |
|
|
|
|
} |
|
|
|
|
Spacer() |
|
|
|
|
if let tournament = tournament as? Tournament, tournament.isCanceled == false { |
|
|
|
|
if shouldTournamentBeOver { |
|
|
|
|
Text("à clôturer ?") |
|
|
|
|
.foregroundStyle(.logoRed) |
|
|
|
|
} else if let teamCount { |
|
|
|
|
let hasStarted = tournament.inscriptionClosed() || tournament.hasStarted() |
|
|
|
|
let word = hasStarted ? "équipe" : "inscription" |
|
|
|
|
Text(word + teamCount.pluralSuffix) |
|
|
|
|
.task(priority: .background) { |
|
|
|
|
self.shouldTournamentBeOver = await tournament.shouldTournamentBeOver() |
|
|
|
|
} |
|
|
|
|
VStack(alignment: .trailing) { |
|
|
|
|
if shouldTournamentBeOver { |
|
|
|
|
Text("à clôturer ?") |
|
|
|
|
.foregroundStyle(.logoRed) |
|
|
|
|
} else if let teamCount { |
|
|
|
|
let hasStarted = tournament.inscriptionClosed() || tournament.hasStarted() |
|
|
|
|
let word = hasStarted ? "équipe" : "inscription" |
|
|
|
|
Text(word + teamCount.pluralSuffix) |
|
|
|
|
.task(priority: .background) { |
|
|
|
|
self.shouldTournamentBeOver = await tournament.shouldTournamentBeOver() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
let value: Int = tournament.onlineTeams().count |
|
|
|
|
if value > 0 { |
|
|
|
|
Text("(dont " + value.formatted() + " en ligne)") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -170,17 +176,6 @@ struct TournamentCellView: View { |
|
|
|
|
Text(build.category.localizedLabel()) |
|
|
|
|
Text(build.age.localizedFederalAgeLabel()) |
|
|
|
|
} |
|
|
|
|
if displayStyle == .wide, let tournament = tournament as? Tournament { |
|
|
|
|
if tournament.enableOnlineRegistration { |
|
|
|
|
let value: Int = tournament.onlineTeams().count |
|
|
|
|
HStack { |
|
|
|
|
Spacer() |
|
|
|
|
if value > 0 { |
|
|
|
|
Text("(dont " + value.formatted() + " inscrite\(value.pluralSuffix) en ligne)") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.font(.caption) |
|
|
|
|
|