add a way to know if the team is from beach

paca_championship
Raz 12 months ago
parent c5bc2fb0d5
commit e8665a3e8b
  1. 59
      PadelClub/Views/Tournament/Screen/Components/InscriptionInfoView.swift
  2. 13
      PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift

@ -27,33 +27,56 @@ struct InscriptionInfoView: View {
var body: some View { var body: some View {
List { List {
Section { 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 { LabeledContent {
Text(selectedTeams.filter { $0.called() }.count.formatted()) Text(selectedTeams.filter { $0.called() }.count.formatted())
} label: { } label: {
Text("Paires convoquées") Text("Paires convoquées")
Text("Vous avez envoyé une convocation par sms ou email")
} }
.listRowView(color: .cyan) .listRowView(color: .cyan)
// LabeledContent { LabeledContent {
// Text(selectedTeams.filter { $0.confirmed() }.count.formatted()) Text(selectedTeams.filter { $0.confirmed() }.count.formatted())
// } label: { } label: {
// Text("Paires ayant confirmées") Text("Paires ayant confirmées")
// Text("Vous avez noté la confirmation de l'équipe") }
// } .listRowView(color: .green)
// .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 { Section {
DisclosureGroup { DisclosureGroup {
ForEach(callDateIssue) { team in ForEach(callDateIssue) { team in

@ -78,6 +78,7 @@ struct InscriptionManagerView: View {
case groupStage case groupStage
case wildcardGroupStage case wildcardGroupStage
case wildcardBracket case wildcardBracket
case notImported
func emptyLocalizedLabelDescription() -> String { func emptyLocalizedLabelDescription() -> String {
switch self { switch self {
@ -95,6 +96,8 @@ struct InscriptionManagerView: View {
return "Vous n'avez placé aucune équipe dans le tableau." return "Vous n'avez placé aucune équipe dans le tableau."
case .groupStage: case .groupStage:
return "Vous n'avez placé aucune équipe en poule." 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" return "Aucune équipe dans le tableau"
case .groupStage: case .groupStage:
return "Aucune équipe en poule" 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" return displayStyle == .wide ? "Forfaits" : "forfait"
case .waiting: case .waiting:
return displayStyle == .wide ? "Liste d'attente" : "attente" 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 }) teams = teams.filter({ $0.inRound() && $0.inGroupStage() == false })
case .groupStage: case .groupStage:
teams = teams.filter({ $0.inGroupStage() }) teams = teams.filter({ $0.inGroupStage() })
case .notImported:
teams = teams.filter({ $0.isImported() == false })
default: default:
break break
} }
@ -652,6 +661,10 @@ struct InscriptionManagerView: View {
case .waiting: case .waiting:
let waiting: Int = max(0, unsortedTeamsWithoutWO.count - tournament.teamCount) let waiting: Int = max(0, unsortedTeamsWithoutWO.count - tournament.teamCount)
return waiting.formatted() return waiting.formatted()
case .notImported:
let notImported: Int = max(0, sortedTeams.filter({ $0.isImported() == false }).count)
return notImported.formatted()
} }
} }

Loading…
Cancel
Save