diff --git a/PadelClub/Views/Tournament/Screen/Components/InscriptionInfoView.swift b/PadelClub/Views/Tournament/Screen/Components/InscriptionInfoView.swift index a52b8c5..3fb55c6 100644 --- a/PadelClub/Views/Tournament/Screen/Components/InscriptionInfoView.swift +++ b/PadelClub/Views/Tournament/Screen/Components/InscriptionInfoView.swift @@ -27,33 +27,56 @@ struct InscriptionInfoView: View { var body: some View { List { Section { - let footerString = "via [beach-padel.app.fft.fr](\(URLs.beachPadel.rawValue))" - - LabeledContent { - Text(entriesFromBeachPadel.count.formatted()) - } label: { - Text("Paires importées") - Text(.init(footerString)) - } - .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) + LabeledContent { + Text(selectedTeams.filter { $0.confirmed() }.count.formatted()) + } label: { + Text("Paires ayant confirmées") + } + .listRowView(color: .green) } + + if tournament.isAnimation() == false, entriesFromBeachPadel.count > 0 { + let notFromBeach = selectedTeams.filter({ $0.isImported() == false }) + Section { + let subtitle = "via [beach-padel.app.fft.fr](\(URLs.beachPadel.rawValue))" + + LabeledContent { + Text(entriesFromBeachPadel.count.formatted()) + } label: { + Text("Paires importées") + Text(.init(subtitle)) + } + .listRowView(color: .indigo) + + DisclosureGroup { + ForEach(notFromBeach) { team in + TeamDetailView(team: team) + } + } label: { + LabeledContent { + Text(notFromBeach.count.formatted()) + } label: { + Text("Paires non importées") + } + } + .listRowView(color: .brown) + } footer: { + if notFromBeach.isEmpty == false { + let footerString = "Au moins un joueur ne provient pas du fichier. Il est possible que vous ayez à mettre à jour les équipes sur [beach-padel.app.fft.fr](\(URLs.beachPadel.rawValue))" + + Text(.init(footerString)) + } + } + } + Section { DisclosureGroup { ForEach(callDateIssue) { team in diff --git a/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift b/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift index 81a6368..7dd6dc2 100644 --- a/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift +++ b/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift @@ -78,6 +78,7 @@ struct InscriptionManagerView: View { case groupStage case wildcardGroupStage case wildcardBracket + case notImported func emptyLocalizedLabelDescription() -> String { switch self { @@ -95,6 +96,8 @@ struct InscriptionManagerView: View { return "Vous n'avez placé aucune équipe dans le tableau." case .groupStage: return "Vous n'avez placé aucune équipe en poule." + case .notImported: + return "Vous n'avez aucune équipe non importé. Elles proviennent toutes du fichier." } } @@ -114,6 +117,8 @@ struct InscriptionManagerView: View { return "Aucune équipe dans le tableau" case .groupStage: return "Aucune équipe en poule" + case .notImported: + return "Aucune équipe non importée" } } @@ -133,6 +138,8 @@ struct InscriptionManagerView: View { return displayStyle == .wide ? "Forfaits" : "forfait" case .waiting: return displayStyle == .wide ? "Liste d'attente" : "attente" + case .notImported: + return "Non importées" } } } @@ -470,6 +477,8 @@ struct InscriptionManagerView: View { teams = teams.filter({ $0.inRound() && $0.inGroupStage() == false }) case .groupStage: teams = teams.filter({ $0.inGroupStage() }) + case .notImported: + teams = teams.filter({ $0.isImported() == false }) default: break } @@ -652,6 +661,10 @@ struct InscriptionManagerView: View { case .waiting: let waiting: Int = max(0, unsortedTeamsWithoutWO.count - tournament.teamCount) return waiting.formatted() + case .notImported: + let notImported: Int = max(0, sortedTeams.filter({ $0.isImported() == false }).count) + return notImported.formatted() + } }