|
|
|
@ -87,11 +87,12 @@ struct RoundView: View { |
|
|
|
.tipStyle(tint: .master, asSection: true) |
|
|
|
.tipStyle(tint: .master, asSection: true) |
|
|
|
|
|
|
|
|
|
|
|
if upperRound.loserRounds.isEmpty == false { |
|
|
|
if upperRound.loserRounds.isEmpty == false { |
|
|
|
|
|
|
|
let correspondingLoserRoundTitle = upperRound.round.correspondingLoserRoundTitle() |
|
|
|
Section { |
|
|
|
Section { |
|
|
|
NavigationLink { |
|
|
|
NavigationLink { |
|
|
|
LoserRoundsView(upperBracketRound: upperRound) |
|
|
|
LoserRoundsView(upperBracketRound: upperRound) |
|
|
|
.environment(tournament) |
|
|
|
.environment(tournament) |
|
|
|
.navigationTitle(upperRound.correspondingLoserRoundTitle) |
|
|
|
.navigationTitle(correspondingLoserRoundTitle) |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
LabeledContent { |
|
|
|
LabeledContent { |
|
|
|
let status = upperRound.status() |
|
|
|
let status = upperRound.status() |
|
|
|
@ -101,7 +102,7 @@ struct RoundView: View { |
|
|
|
Text("\(status.0) terminé\(status.0.pluralSuffix) sur \(status.1)") |
|
|
|
Text("\(status.0) terminé\(status.0.pluralSuffix) sur \(status.1)") |
|
|
|
} |
|
|
|
} |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
Text(upperRound.correspondingLoserRoundTitle) |
|
|
|
Text(correspondingLoserRoundTitle) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -129,6 +130,7 @@ struct RoundView: View { |
|
|
|
if availableSeeds.isEmpty == false, let availableSeedGroup { |
|
|
|
if availableSeeds.isEmpty == false, let availableSeedGroup { |
|
|
|
Section { |
|
|
|
Section { |
|
|
|
RowButtonView("Placer \(availableSeedGroup.localizedLabel())" + ((availableSeedGroup.isFixed() == false) ? " au hasard" : "")) { |
|
|
|
RowButtonView("Placer \(availableSeedGroup.localizedLabel())" + ((availableSeedGroup.isFixed() == false) ? " au hasard" : "")) { |
|
|
|
|
|
|
|
Task { |
|
|
|
tournament.setSeeds(inRoundIndex: upperRound.round.index, inSeedGroup: availableSeedGroup) |
|
|
|
tournament.setSeeds(inRoundIndex: upperRound.round.index, inSeedGroup: availableSeedGroup) |
|
|
|
_save() |
|
|
|
_save() |
|
|
|
if tournament.availableSeeds().isEmpty && tournament.availableQualifiedTeams().isEmpty { |
|
|
|
if tournament.availableSeeds().isEmpty && tournament.availableQualifiedTeams().isEmpty { |
|
|
|
@ -136,6 +138,7 @@ struct RoundView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
_prepareRound() |
|
|
|
_prepareRound() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} footer: { |
|
|
|
} footer: { |
|
|
|
if availableSeedGroup.isFixed() == false { |
|
|
|
if availableSeedGroup.isFixed() == false { |
|
|
|
Text("Le tirage au sort ne sera pas visuel. Toutes les équipes de ce chapeau seront tirées.") |
|
|
|
Text("Le tirage au sort ne sera pas visuel. Toutes les équipes de ce chapeau seront tirées.") |
|
|
|
@ -160,6 +163,7 @@ struct RoundView: View { |
|
|
|
ForEach(availableQualifiedTeams) { team in |
|
|
|
ForEach(availableQualifiedTeams) { team in |
|
|
|
NavigationLink { |
|
|
|
NavigationLink { |
|
|
|
SpinDrawView(drawees: [team], segments: spaceLeft) { results in |
|
|
|
SpinDrawView(drawees: [team], segments: spaceLeft) { results in |
|
|
|
|
|
|
|
Task { |
|
|
|
results.forEach { drawResult in |
|
|
|
results.forEach { drawResult in |
|
|
|
team.setSeedPosition(inSpot: spaceLeft[drawResult.drawIndex], slot: nil, opposingSeeding: true) |
|
|
|
team.setSeedPosition(inSpot: spaceLeft[drawResult.drawIndex], slot: nil, opposingSeeding: true) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -169,6 +173,7 @@ struct RoundView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
_prepareRound() |
|
|
|
_prepareRound() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
TeamRowView(team: team, displayCallDate: false) |
|
|
|
TeamRowView(team: team, displayCallDate: false) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -189,6 +194,7 @@ struct RoundView: View { |
|
|
|
ForEach(availableSeeds) { team in |
|
|
|
ForEach(availableSeeds) { team in |
|
|
|
NavigationLink { |
|
|
|
NavigationLink { |
|
|
|
SpinDrawView(drawees: [team], segments: seedSpaceLeft) { results in |
|
|
|
SpinDrawView(drawees: [team], segments: seedSpaceLeft) { results in |
|
|
|
|
|
|
|
Task { |
|
|
|
results.forEach { drawResult in |
|
|
|
results.forEach { drawResult in |
|
|
|
team.setSeedPosition(inSpot: seedSpaceLeft[drawResult.drawIndex], slot: nil, opposingSeeding: false) |
|
|
|
team.setSeedPosition(inSpot: seedSpaceLeft[drawResult.drawIndex], slot: nil, opposingSeeding: false) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -198,6 +204,7 @@ struct RoundView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
_prepareRound() |
|
|
|
_prepareRound() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
TeamRowView(team: team, displayCallDate: false) |
|
|
|
TeamRowView(team: team, displayCallDate: false) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -214,6 +221,7 @@ struct RoundView: View { |
|
|
|
ForEach(availableSeeds) { team in |
|
|
|
ForEach(availableSeeds) { team in |
|
|
|
NavigationLink { |
|
|
|
NavigationLink { |
|
|
|
SpinDrawView(drawees: [team], segments: spaceLeft) { results in |
|
|
|
SpinDrawView(drawees: [team], segments: spaceLeft) { results in |
|
|
|
|
|
|
|
Task { |
|
|
|
results.forEach { drawResult in |
|
|
|
results.forEach { drawResult in |
|
|
|
team.setSeedPosition(inSpot: spaceLeft[drawResult.drawIndex], slot: nil, opposingSeeding: true) |
|
|
|
team.setSeedPosition(inSpot: spaceLeft[drawResult.drawIndex], slot: nil, opposingSeeding: true) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -223,6 +231,7 @@ struct RoundView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
_prepareRound() |
|
|
|
_prepareRound() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
TeamRowView(team: team, displayCallDate: false) |
|
|
|
TeamRowView(team: team, displayCallDate: false) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -286,6 +295,7 @@ struct RoundView: View { |
|
|
|
let availableSeedSpot = opposingSeeding ? spaceLeft : seedSpaceLeft |
|
|
|
let availableSeedSpot = opposingSeeding ? spaceLeft : seedSpaceLeft |
|
|
|
NavigationStack { |
|
|
|
NavigationStack { |
|
|
|
SpinDrawView(drawees: seeds, segments: availableSeedSpot, autoMode: true) { draws in |
|
|
|
SpinDrawView(drawees: seeds, segments: availableSeedSpot, autoMode: true) { draws in |
|
|
|
|
|
|
|
Task { |
|
|
|
draws.forEach { drawResult in |
|
|
|
draws.forEach { drawResult in |
|
|
|
seeds[drawResult.drawee].setSeedPosition(inSpot: availableSeedSpot[drawResult.drawIndex], slot: nil, opposingSeeding: opposingSeeding) |
|
|
|
seeds[drawResult.drawee].setSeedPosition(inSpot: availableSeedSpot[drawResult.drawIndex], slot: nil, opposingSeeding: opposingSeeding) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -300,6 +310,7 @@ struct RoundView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
.headerProminence(.increased) |
|
|
|
.headerProminence(.increased) |
|
|
|
.toolbar { |
|
|
|
.toolbar { |
|
|
|
ToolbarItem(placement: .topBarTrailing) { |
|
|
|
ToolbarItem(placement: .topBarTrailing) { |
|
|
|
|