|
|
|
@ -33,6 +33,8 @@ struct PlayerDetailView: View { |
|
|
|
var body: some View { |
|
|
|
var body: some View { |
|
|
|
Form { |
|
|
|
Form { |
|
|
|
Section { |
|
|
|
Section { |
|
|
|
|
|
|
|
Toggle("Joueur sur place", isOn: $player.hasArrived) |
|
|
|
|
|
|
|
|
|
|
|
LabeledContent { |
|
|
|
LabeledContent { |
|
|
|
TextField("Nom", text: $player.lastName) |
|
|
|
TextField("Nom", text: $player.lastName) |
|
|
|
.keyboardType(.alphabet) |
|
|
|
.keyboardType(.alphabet) |
|
|
|
@ -101,11 +103,7 @@ struct PlayerDetailView: View { |
|
|
|
Text("Calculé en fonction du sexe") |
|
|
|
Text("Calculé en fonction du sexe") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
|
|
|
|
Toggle("Joueur sur place", isOn: $player.hasArrived) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
Section { |
|
|
|
LabeledContent { |
|
|
|
LabeledContent { |
|
|
|
TextField("Licence", text: $licenceId) |
|
|
|
TextField("Licence", text: $licenceId) |
|
|
|
@ -119,9 +117,12 @@ struct PlayerDetailView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
Text("Licence") |
|
|
|
Text("Licence") |
|
|
|
CopyPasteButtonView(pasteValue: player.licenceId?.strippedLicense) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} footer: { |
|
|
|
|
|
|
|
CopyPasteButtonView(pasteValue: player.licenceId?.strippedLicense) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
LabeledContent { |
|
|
|
LabeledContent { |
|
|
|
TextField("Téléphone", text: $phoneNumber) |
|
|
|
TextField("Téléphone", text: $phoneNumber) |
|
|
|
.keyboardType(.namePhonePad) |
|
|
|
.keyboardType(.namePhonePad) |
|
|
|
@ -134,9 +135,12 @@ struct PlayerDetailView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
Text("Téléphone") |
|
|
|
Text("Téléphone") |
|
|
|
CopyPasteButtonView(pasteValue: player.phoneNumber) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} footer: { |
|
|
|
|
|
|
|
CopyPasteButtonView(pasteValue: player.phoneNumber) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
LabeledContent { |
|
|
|
LabeledContent { |
|
|
|
TextField("Email", text: $email) |
|
|
|
TextField("Email", text: $email) |
|
|
|
.keyboardType(.emailAddress) |
|
|
|
.keyboardType(.emailAddress) |
|
|
|
@ -149,8 +153,9 @@ struct PlayerDetailView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
Text("Email") |
|
|
|
Text("Email") |
|
|
|
CopyPasteButtonView(pasteValue: player.email) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} footer: { |
|
|
|
|
|
|
|
CopyPasteButtonView(pasteValue: player.email) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@ -177,17 +182,19 @@ struct PlayerDetailView: View { |
|
|
|
.navigationBarTitleDisplayMode(.inline) |
|
|
|
.navigationBarTitleDisplayMode(.inline) |
|
|
|
.toolbarBackground(.visible, for: .navigationBar) |
|
|
|
.toolbarBackground(.visible, for: .navigationBar) |
|
|
|
.toolbar { |
|
|
|
.toolbar { |
|
|
|
ToolbarItem(placement: .keyboard) { |
|
|
|
if focusedField == ._rank || focusedField == ._computedRank { |
|
|
|
Button("Valider") { |
|
|
|
ToolbarItem(placement: .keyboard) { |
|
|
|
if focusedField == ._rank { |
|
|
|
Button("Valider") { |
|
|
|
player.setComputedRank(in: tournament) |
|
|
|
if focusedField == ._rank { |
|
|
|
player.team()?.updateWeight(inTournamentCategory: tournament.tournamentCategory) |
|
|
|
player.setComputedRank(in: tournament) |
|
|
|
_save() |
|
|
|
player.team()?.updateWeight(inTournamentCategory: tournament.tournamentCategory) |
|
|
|
} else if focusedField == ._computedRank { |
|
|
|
_save() |
|
|
|
player.team()?.updateWeight(inTournamentCategory: tournament.tournamentCategory) |
|
|
|
} else if focusedField == ._computedRank { |
|
|
|
_save() |
|
|
|
player.team()?.updateWeight(inTournamentCategory: tournament.tournamentCategory) |
|
|
|
|
|
|
|
_save() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
focusedField = nil |
|
|
|
} |
|
|
|
} |
|
|
|
focusedField = nil |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|