|
|
|
@ -16,8 +16,9 @@ let inscriptionManagerWomanRankTip = InscriptionManagerWomanRankTip() |
|
|
|
//let searchTip = InscriptionManagerSearchInputTip() |
|
|
|
//let searchTip = InscriptionManagerSearchInputTip() |
|
|
|
//let createTip = InscriptionManagerCreateInputTip() |
|
|
|
//let createTip = InscriptionManagerCreateInputTip() |
|
|
|
let rankUpdateTip = InscriptionManagerRankUpdateTip() |
|
|
|
let rankUpdateTip = InscriptionManagerRankUpdateTip() |
|
|
|
//let padelBeachExportTip = PadelBeachExportTip() |
|
|
|
let padelBeachExportTip = PadelBeachExportTip() |
|
|
|
//let padelBeachImportTip = PadelBeachImportTip() |
|
|
|
let padelBeachImportTip = PadelBeachImportTip() |
|
|
|
|
|
|
|
let teamsExportTip = TeamsExportTip() |
|
|
|
|
|
|
|
|
|
|
|
struct InscriptionManagerView: View { |
|
|
|
struct InscriptionManagerView: View { |
|
|
|
|
|
|
|
|
|
|
|
@ -396,11 +397,7 @@ struct InscriptionManagerView: View { |
|
|
|
Label("Clôturer", systemImage: "lock") |
|
|
|
Label("Clôturer", systemImage: "lock") |
|
|
|
} |
|
|
|
} |
|
|
|
Divider() |
|
|
|
Divider() |
|
|
|
if let teamPaste { |
|
|
|
_sharingTeamsMenuView() |
|
|
|
ShareLink(item: teamPaste) { |
|
|
|
|
|
|
|
Label("Exporter les paires", systemImage: "square.and.arrow.up") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Button { |
|
|
|
Button { |
|
|
|
presentImportView = true |
|
|
|
presentImportView = true |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
@ -410,6 +407,11 @@ struct InscriptionManagerView: View { |
|
|
|
Label("beach-padel.app.fft.fr", systemImage: "safari") |
|
|
|
Label("beach-padel.app.fft.fr", systemImage: "safari") |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_sharingTeamsMenuView() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Divider() |
|
|
|
|
|
|
|
|
|
|
|
Button { |
|
|
|
Button { |
|
|
|
tournament.unlockRegistration() |
|
|
|
tournament.unlockRegistration() |
|
|
|
_save() |
|
|
|
_save() |
|
|
|
@ -431,6 +433,23 @@ struct InscriptionManagerView: View { |
|
|
|
.navigationBarTitleDisplayMode(.inline) |
|
|
|
.navigationBarTitleDisplayMode(.inline) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private func _sharingTeamsMenuView() -> some View { |
|
|
|
|
|
|
|
Menu { |
|
|
|
|
|
|
|
if let teamPaste = teamPaste() { |
|
|
|
|
|
|
|
ShareLink(item: teamPaste) { |
|
|
|
|
|
|
|
Text("En texte") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if let teamPaste = teamPaste(.csv) { |
|
|
|
|
|
|
|
ShareLink(item: teamPaste) { |
|
|
|
|
|
|
|
Text("En csv") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} label: { |
|
|
|
|
|
|
|
Label("Exporter les paires", systemImage: "square.and.arrow.up") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var walkoutTeams: [TeamRegistration] { |
|
|
|
var walkoutTeams: [TeamRegistration] { |
|
|
|
tournament.walkoutTeams() |
|
|
|
tournament.walkoutTeams() |
|
|
|
} |
|
|
|
} |
|
|
|
@ -439,8 +458,8 @@ struct InscriptionManagerView: View { |
|
|
|
tournament.unsortedTeamsWithoutWO() |
|
|
|
tournament.unsortedTeamsWithoutWO() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var teamPaste: URL? { |
|
|
|
func teamPaste(_ exportFormat: ExportFormat = .rawText) -> URL? { |
|
|
|
tournament.pasteDataForImporting().createTxtFile(self.tournament.tournamentTitle(.short)) |
|
|
|
tournament.pasteDataForImporting(exportFormat).createFile(self.tournament.tournamentTitle(.short), exportFormat) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var unsortedPlayers: [PlayerRegistration] { |
|
|
|
var unsortedPlayers: [PlayerRegistration] { |
|
|
|
@ -535,7 +554,7 @@ struct InscriptionManagerView: View { |
|
|
|
.listRowView(isActive: true, color: team.initialRoundColor() ?? tournament.cutLabelColor(index: teamIndex, teamCount: filterMode == .waiting ? 0 : selectedSortedTeams.count), hideColorVariation: true) |
|
|
|
.listRowView(isActive: true, color: team.initialRoundColor() ?? tournament.cutLabelColor(index: teamIndex, teamCount: filterMode == .waiting ? 0 : selectedSortedTeams.count), hideColorVariation: true) |
|
|
|
} |
|
|
|
} |
|
|
|
} header: { |
|
|
|
} header: { |
|
|
|
if filterMode == .all { |
|
|
|
if filterMode == .all && walkoutTeams.isEmpty == false { |
|
|
|
Text("\(teams.count.formatted()) équipe\(teams.count.pluralSuffix) dont \(walkoutTeams.count.formatted()) forfait\(walkoutTeams.count.pluralSuffix)") |
|
|
|
Text("\(teams.count.formatted()) équipe\(teams.count.pluralSuffix) dont \(walkoutTeams.count.formatted()) forfait\(walkoutTeams.count.pluralSuffix)") |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Text("\(teams.count.formatted()) équipe\(teams.count.pluralSuffix)") |
|
|
|
Text("\(teams.count.formatted()) équipe\(teams.count.pluralSuffix)") |
|
|
|
@ -823,9 +842,13 @@ struct InscriptionManagerView: View { |
|
|
|
|
|
|
|
|
|
|
|
@ViewBuilder |
|
|
|
@ViewBuilder |
|
|
|
private func _relatedTips() -> some View { |
|
|
|
private func _relatedTips() -> some View { |
|
|
|
// if pasteString == nil |
|
|
|
// if tournament.inscriptionClosed() && tournament.tournamentLevel.shouldShareTeams() { |
|
|
|
// && createdPlayerIds.isEmpty |
|
|
|
// Section { |
|
|
|
// && tournament.unsortedTeams().count >= tournament.teamCount |
|
|
|
// TipView(teamsExportTip) |
|
|
|
|
|
|
|
// .tipStyle(tint: nil) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// if tournament.unsortedTeams().count >= tournament.teamCount |
|
|
|
// && tournament.unsortedPlayers().filter({ $0.source == .beachPadel }).isEmpty { |
|
|
|
// && tournament.unsortedPlayers().filter({ $0.source == .beachPadel }).isEmpty { |
|
|
|
// Section { |
|
|
|
// Section { |
|
|
|
// TipView(padelBeachExportTip) { action in |
|
|
|
// TipView(padelBeachExportTip) { action in |
|
|
|
|