|
|
|
|
@ -114,26 +114,29 @@ struct EditingTeamView: View { |
|
|
|
|
Text("Inscrits en ligne") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
LabeledContent { |
|
|
|
|
Text(team.hasPaidOnline() ? "Oui" : "Non") |
|
|
|
|
} label: { |
|
|
|
|
Text("Payé en ligne") |
|
|
|
|
if tournament.enableOnlinePayment || team.hasPaidOnline() { |
|
|
|
|
LabeledContent { |
|
|
|
|
Text(team.hasPaidOnline() ? "Oui" : "Non") |
|
|
|
|
} label: { |
|
|
|
|
Text("Payé en ligne") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if let refundMessage, refundMessage.isEmpty == false { |
|
|
|
|
Text(refundMessage).foregroundStyle(.logoRed) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if team.hasPaidOnline() { |
|
|
|
|
RowButtonView("Rembourser l'équipe", role: .destructive) { |
|
|
|
|
await _processRefund() |
|
|
|
|
} |
|
|
|
|
} else if team.hasConfirmed() == false { |
|
|
|
|
} else if team.hasConfirmed() == false, tournament.enableTimeToConfirm { |
|
|
|
|
RowButtonView("Confirmer l'inscription de l'équipe", role: .destructive) { |
|
|
|
|
team.confirmRegistration() |
|
|
|
|
} |
|
|
|
|
.disabled(team.walkOut) |
|
|
|
|
} |
|
|
|
|
} header: { |
|
|
|
|
Text("Statut de l'inscription en ligne") |
|
|
|
|
} footer: { |
|
|
|
|
if team.hasPaidOnline() { |
|
|
|
|
Text("Le remboursement passe part le service de Stripe qui re-crédite le moyen de paiement utilisé du montant payé.") |
|
|
|
|
@ -274,6 +277,10 @@ struct EditingTeamView: View { |
|
|
|
|
} |
|
|
|
|
.alert("Attention", isPresented: hasChanged, actions: { |
|
|
|
|
Button("Confirmer") { |
|
|
|
|
if walkOut == false && team.walkOut == true { |
|
|
|
|
registrationDateModified = Date() |
|
|
|
|
registrationDate = registrationDateModified |
|
|
|
|
} |
|
|
|
|
_resetTeam() |
|
|
|
|
team.registrationDate = registrationDate |
|
|
|
|
team.wildCardBracket = wildCardBracket |
|
|
|
|
@ -378,12 +385,21 @@ struct EditingTeamView: View { |
|
|
|
|
} |
|
|
|
|
.onChange(of: registrationDate) { |
|
|
|
|
if canSaveWithoutWarning() { |
|
|
|
|
team.registrationDate = registrationDate |
|
|
|
|
_save() |
|
|
|
|
if let tr = team.registrationDate, tr == registrationDate { |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
team.registrationDate = registrationDate |
|
|
|
|
_save() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.onChange(of: [walkOut, wildCardBracket, wildCardGroupStage]) { |
|
|
|
|
if canSaveWithoutWarning() { |
|
|
|
|
if walkOut == false && team.walkOut == true { |
|
|
|
|
registrationDateModified = Date() |
|
|
|
|
team.registrationDate = registrationDateModified |
|
|
|
|
registrationDate = registrationDateModified |
|
|
|
|
} |
|
|
|
|
_resetTeam() |
|
|
|
|
team.walkOut = walkOut |
|
|
|
|
team.wildCardBracket = wildCardBracket |
|
|
|
|
|