|
|
|
@ -8,18 +8,45 @@ |
|
|
|
import SwiftUI |
|
|
|
import SwiftUI |
|
|
|
|
|
|
|
|
|
|
|
struct InscriptionInfoView: View { |
|
|
|
struct InscriptionInfoView: View { |
|
|
|
|
|
|
|
@EnvironmentObject var dataStore: DataStore |
|
|
|
@Environment(Tournament.self) var tournament |
|
|
|
@Environment(Tournament.self) var tournament |
|
|
|
@State private var duplicates = [PlayerRegistration]() |
|
|
|
@State private var duplicates = [PlayerRegistration]() |
|
|
|
@State private var problematicPlayers = [PlayerRegistration]() |
|
|
|
@State private var problematicPlayers = [PlayerRegistration]() |
|
|
|
@State private var inadequatePlayers = [PlayerRegistration]() |
|
|
|
@State private var inadequatePlayers = [PlayerRegistration]() |
|
|
|
@State private var playersWithoutValidLicense = [PlayerRegistration]() |
|
|
|
@State private var playersWithoutValidLicense = [PlayerRegistration]() |
|
|
|
@State private var entriesNotFromBeachPadel = [TeamRegistration]() |
|
|
|
@State private var entriesFromBeachPadel = [TeamRegistration]() |
|
|
|
@State private var playersMissing = [TeamRegistration]() |
|
|
|
@State private var playersMissing = [TeamRegistration]() |
|
|
|
@State private var waitingList = [TeamRegistration]() |
|
|
|
@State private var waitingList = [TeamRegistration]() |
|
|
|
@State private var selectedTeams = [TeamRegistration]() |
|
|
|
@State private var selectedTeams = [TeamRegistration]() |
|
|
|
|
|
|
|
|
|
|
|
var body: some View { |
|
|
|
var body: some View { |
|
|
|
List { |
|
|
|
List { |
|
|
|
|
|
|
|
Section { |
|
|
|
|
|
|
|
LabeledContent { |
|
|
|
|
|
|
|
Text(entriesFromBeachPadel.count.formatted()) |
|
|
|
|
|
|
|
} label: { |
|
|
|
|
|
|
|
Text("Paires importées") |
|
|
|
|
|
|
|
Text(SourceFileManager.beachPadel.absoluteString) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.listRowView(color: .indigo) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LabeledContent { |
|
|
|
|
|
|
|
Text(selectedTeams.filter { $0.called() }.count.formatted()) |
|
|
|
|
|
|
|
} label: { |
|
|
|
|
|
|
|
Text("Paires convoquées") |
|
|
|
|
|
|
|
Text("Vous avez envoyé une convocation par sms ou email") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.listRowView(color: .cyan) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LabeledContent { |
|
|
|
|
|
|
|
Text(selectedTeams.filter { $0.confirmed() }.count.formatted()) |
|
|
|
|
|
|
|
} label: { |
|
|
|
|
|
|
|
Text("Paires ayant confirmées") |
|
|
|
|
|
|
|
Text("Vous avez noté la confirmation de l'équipe") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.listRowView(color: .green) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let waitingListInBracket = waitingList.filter({ $0.bracketPosition != nil }) |
|
|
|
let waitingListInBracket = waitingList.filter({ $0.bracketPosition != nil }) |
|
|
|
let waitingListInGroupStage = waitingList.filter({ $0.groupStage != nil }) |
|
|
|
let waitingListInGroupStage = waitingList.filter({ $0.groupStage != nil }) |
|
|
|
|
|
|
|
|
|
|
|
@ -96,9 +123,7 @@ struct InscriptionInfoView: View { |
|
|
|
LabeledContent { |
|
|
|
LabeledContent { |
|
|
|
Text(inadequatePlayers.count.formatted()) |
|
|
|
Text(inadequatePlayers.count.formatted()) |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
let playerLabel : String = tournament.tournamentCategory == .women ? "joueuse" : "joueur" |
|
|
|
Text("Joueurs trop bien classés") |
|
|
|
let grammarSuffix : String = tournament.tournamentCategory == .women ? "e" + inadequatePlayers.count.pluralSuffix : inadequatePlayers.count.pluralSuffix |
|
|
|
|
|
|
|
Text(playerLabel.capitalized + inadequatePlayers.count.pluralSuffix + " trop bien classé" + grammarSuffix) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.listRowView(color: .red) |
|
|
|
.listRowView(color: .red) |
|
|
|
@ -137,32 +162,6 @@ struct InscriptionInfoView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
.listRowView(color: .pink) |
|
|
|
.listRowView(color: .pink) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
|
|
|
|
LabeledContent { |
|
|
|
|
|
|
|
Text(entriesNotFromBeachPadel.count.formatted()) |
|
|
|
|
|
|
|
} label: { |
|
|
|
|
|
|
|
Text("Paires importées") |
|
|
|
|
|
|
|
Text(SourceFileManager.beachPadel.absoluteString) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.listRowView(color: .indigo) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LabeledContent { |
|
|
|
|
|
|
|
Text(selectedTeams.filter { $0.called() }.count.formatted()) |
|
|
|
|
|
|
|
} label: { |
|
|
|
|
|
|
|
Text("Paires convoquées") |
|
|
|
|
|
|
|
Text("Vous avez envoyé une convocation par sms ou email") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.listRowView(color: .cyan) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LabeledContent { |
|
|
|
|
|
|
|
Text(selectedTeams.filter { $0.confirmed() }.count.formatted()) |
|
|
|
|
|
|
|
} label: { |
|
|
|
|
|
|
|
Text("Paires ayant confirmées") |
|
|
|
|
|
|
|
Text("Vous avez noté la confirmation de l'équipe") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.listRowView(color: .green) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
.navigationTitle("Synthèse") |
|
|
|
.navigationTitle("Synthèse") |
|
|
|
.navigationBarTitleDisplayMode(.inline) |
|
|
|
.navigationBarTitleDisplayMode(.inline) |
|
|
|
@ -180,7 +179,7 @@ struct InscriptionInfoView: View { |
|
|
|
problematicPlayers = players.filter({ $0.sex == -1 }) |
|
|
|
problematicPlayers = players.filter({ $0.sex == -1 }) |
|
|
|
inadequatePlayers = tournament.inadequatePlayers(in: players) |
|
|
|
inadequatePlayers = tournament.inadequatePlayers(in: players) |
|
|
|
playersWithoutValidLicense = tournament.playersWithoutValidLicense(in: players) |
|
|
|
playersWithoutValidLicense = tournament.playersWithoutValidLicense(in: players) |
|
|
|
entriesNotFromBeachPadel = selectedTeams.filter({ $0.isImported() }) |
|
|
|
entriesFromBeachPadel = tournament.unsortedTeams().filter({ $0.isImported() }) |
|
|
|
playersMissing = selectedTeams.filter({ $0.unsortedPlayers().count < 2 }) |
|
|
|
playersMissing = selectedTeams.filter({ $0.unsortedPlayers().count < 2 }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|