|
|
|
|
@ -547,12 +547,26 @@ struct InscriptionManagerView: View { |
|
|
|
|
|
|
|
|
|
private func _sharingTeamsMenuView() -> some View { |
|
|
|
|
Menu { |
|
|
|
|
ShareLink(item: teamPaste(), preview: .init("Inscriptions")) { |
|
|
|
|
Menu { |
|
|
|
|
ShareLink(item: teamPaste(.rawText, type: .sharing), preview: .init(ExportType.sharing.localizedString().capitalized)) { |
|
|
|
|
Text("En texte") |
|
|
|
|
} |
|
|
|
|
ShareLink(item: teamPaste(.csv, type: .sharing), preview: .init(ExportType.sharing.localizedString().capitalized)) { |
|
|
|
|
Text("En csv") |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Pour diffusion") |
|
|
|
|
} |
|
|
|
|
Menu { |
|
|
|
|
ShareLink(item: teamPaste(.rawText, type: .payment), preview: .init(ExportType.payment.localizedString().capitalized)) { |
|
|
|
|
Text("En texte") |
|
|
|
|
} |
|
|
|
|
ShareLink(item: teamPaste(.csv), preview: .init("Inscriptions")) { |
|
|
|
|
ShareLink(item: teamPaste(.csv, type: .payment), preview: .init(ExportType.payment.localizedString().capitalized)) { |
|
|
|
|
Text("En csv") |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Pour encaissement") |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Label("Exporter les paires", systemImage: "square.and.arrow.up") |
|
|
|
|
} |
|
|
|
|
@ -575,8 +589,8 @@ struct InscriptionManagerView: View { |
|
|
|
|
tournament.unsortedTeamsWithoutWO() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func teamPaste(_ exportFormat: ExportFormat = .rawText) -> TournamentShareFile { |
|
|
|
|
TournamentShareFile(tournament: tournament, exportFormat: exportFormat) |
|
|
|
|
func teamPaste(_ exportFormat: ExportFormat = .rawText, type: ExportType) -> TournamentShareFile { |
|
|
|
|
TournamentShareFile(tournament: tournament, exportFormat: exportFormat, type: type) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var unsortedPlayers: [PlayerRegistration] { |
|
|
|
|
@ -1251,10 +1265,11 @@ struct TournamentGroupStageShareContent: Transferable { |
|
|
|
|
struct TournamentShareFile: Transferable { |
|
|
|
|
let tournament: Tournament |
|
|
|
|
let exportFormat: ExportFormat |
|
|
|
|
let type: ExportType |
|
|
|
|
|
|
|
|
|
func shareFile() -> URL { |
|
|
|
|
print("Generating URL...") |
|
|
|
|
return tournament.pasteDataForImporting(exportFormat).createFile(self.tournament.tournamentTitle()+"-inscriptions", exportFormat) |
|
|
|
|
return tournament.pasteDataForImporting(exportFormat, type: type).createFile(self.tournament.tournamentTitle()+"-"+type.localizedString(), exportFormat) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static var transferRepresentation: some TransferRepresentation { |
|
|
|
|
|