|
|
|
@ -128,6 +128,10 @@ struct EditingTeamView: View { |
|
|
|
RowButtonView("Rembourser l'équipe", role: .destructive) { |
|
|
|
RowButtonView("Rembourser l'équipe", role: .destructive) { |
|
|
|
await _processRefund() |
|
|
|
await _processRefund() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else if team.hasConfirmed() == false { |
|
|
|
|
|
|
|
RowButtonView("Confirmer l'inscription de l'équipe", role: .destructive) { |
|
|
|
|
|
|
|
team.confirmRegistration() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} footer: { |
|
|
|
} footer: { |
|
|
|
if team.hasPaidOnline() { |
|
|
|
if team.hasPaidOnline() { |
|
|
|
@ -178,10 +182,7 @@ struct EditingTeamView: View { |
|
|
|
Text(registrationDateModified.localizedWeekDay().capitalized) |
|
|
|
Text(registrationDateModified.localizedWeekDay().capitalized) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#if DEBUG |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
.disabled(team.hasPaidOnline() || team.hasRegisteredOnline()) |
|
|
|
.disabled(team.hasPaidOnline() || team.hasRegisteredOnline()) |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Toggle(isOn: $wildCardBracket) { |
|
|
|
Toggle(isOn: $wildCardBracket) { |
|
|
|
Text("Wildcard Tableau") |
|
|
|
Text("Wildcard Tableau") |
|
|
|
@ -461,6 +462,36 @@ struct EditingTeamView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//#Preview { |
|
|
|
struct RegistrationStatusPicker: View { |
|
|
|
// EditingTeamView(team: TeamRegistration.mock()) |
|
|
|
var player: PlayerRegistration |
|
|
|
//} |
|
|
|
@State var selectedStatus: PlayerRegistration.RegistrationStatus |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
init(player: PlayerRegistration) { |
|
|
|
|
|
|
|
self.player = player |
|
|
|
|
|
|
|
_selectedStatus = .init(wrappedValue: player.registrationStatus) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var body: some View { |
|
|
|
|
|
|
|
Picker(selection: $selectedStatus) { |
|
|
|
|
|
|
|
ForEach(PlayerRegistration.RegistrationStatus.allCases) { status in |
|
|
|
|
|
|
|
Text(status.localizedRegistrationStatus()) |
|
|
|
|
|
|
|
.tag(status) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} label: { |
|
|
|
|
|
|
|
if player.registrationStatus != selectedStatus { |
|
|
|
|
|
|
|
HStack { |
|
|
|
|
|
|
|
FooterButtonView("Valider") { |
|
|
|
|
|
|
|
player.registrationStatus = selectedStatus |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Divider() |
|
|
|
|
|
|
|
FooterButtonView("Annuler", role: .cancel) { |
|
|
|
|
|
|
|
selectedStatus = player.registrationStatus |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.foregroundStyle(.blue) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Text("État de la confirmation") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|