|
|
|
|
@ -10,10 +10,10 @@ import LeStorage |
|
|
|
|
|
|
|
|
|
struct TeamsCallingView: View { |
|
|
|
|
@Environment(Tournament.self) var tournament: Tournament |
|
|
|
|
let teams : [TeamRegistration] |
|
|
|
|
|
|
|
|
|
var body: some View { |
|
|
|
|
List { |
|
|
|
|
let teams = tournament.selectedSortedTeams() |
|
|
|
|
Section { |
|
|
|
|
ForEach(teams) { team in |
|
|
|
|
Menu { |
|
|
|
|
@ -21,7 +21,6 @@ struct TeamsCallingView: View { |
|
|
|
|
} label: { |
|
|
|
|
HStack { |
|
|
|
|
TeamRowView(team: team, displayCallDate: true) |
|
|
|
|
if team.called() { |
|
|
|
|
Spacer() |
|
|
|
|
Menu { |
|
|
|
|
_menuOptions(team: team) |
|
|
|
|
@ -30,7 +29,6 @@ struct TeamsCallingView: View { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.buttonStyle(.plain) |
|
|
|
|
.listRowView(isActive: team.confirmed(), color: .green, hideColorVariation: true) |
|
|
|
|
} |
|
|
|
|
@ -71,5 +69,20 @@ struct TeamsCallingView: View { |
|
|
|
|
Text("Effacer la date de convocation") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Divider() |
|
|
|
|
|
|
|
|
|
Button(role: .destructive) { |
|
|
|
|
team.callDate = team.initialMatch()?.startDate ?? tournament.startDate |
|
|
|
|
do { |
|
|
|
|
try self.tournament.tournamentStore.teamRegistrations.addOrUpdate(instance: team) |
|
|
|
|
} catch { |
|
|
|
|
Logger.error(error) |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Indiquer comme convoquée") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|