add a way to know if the team is from beach

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

@ -27,31 +27,54 @@ 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())
Text(selectedTeams.filter { $0.called() }.count.formatted())
} label: {
Text("Paires importées")
Text(.init(footerString))
Text("Paires convoquées")
}
.listRowView(color: .indigo)
.listRowView(color: .cyan)
LabeledContent {
Text(selectedTeams.filter { $0.called() }.count.formatted())
Text(selectedTeams.filter { $0.confirmed() }.count.formatted())
} label: {
Text("Paires convoquées")
Text("Vous avez envoyé une convocation par sms ou email")
Text("Paires ayant confirmées")
}
.listRowView(color: .cyan)
.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(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(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 {

@ -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()
}
}

Loading…
Cancel
Save