diff --git a/PadelClub.xcodeproj/project.pbxproj b/PadelClub.xcodeproj/project.pbxproj index 59d9ba6..96e1f06 100644 --- a/PadelClub.xcodeproj/project.pbxproj +++ b/PadelClub.xcodeproj/project.pbxproj @@ -3126,7 +3126,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; @@ -3170,7 +3170,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_TEAM = BQ3Y44M3Q6; @@ -3285,7 +3285,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; @@ -3327,7 +3327,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_TEAM = BQ3Y44M3Q6; @@ -3369,7 +3369,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; @@ -3411,7 +3411,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_TEAM = BQ3Y44M3Q6; diff --git a/PadelClub/Views/Navigation/Agenda/ActivityView.swift b/PadelClub/Views/Navigation/Agenda/ActivityView.swift index 835c9cd..b7a243f 100644 --- a/PadelClub/Views/Navigation/Agenda/ActivityView.swift +++ b/PadelClub/Views/Navigation/Agenda/ActivityView.swift @@ -150,8 +150,8 @@ struct ActivityView: View { } } //.searchable(text: $searchText) - .onAppear { presentToolbar = true } - .onDisappear { presentToolbar = false } +// .onAppear { presentToolbar = true } +// .onDisappear { presentToolbar = false } .refreshable { if navigation.agendaDestination == .tenup { federalDataViewModel.federalTournaments.removeAll() @@ -231,7 +231,7 @@ struct ActivityView: View { } } - if presentToolbar, tournaments.isEmpty == false, federalDataViewModel.areFiltersEnabled() || navigation.agendaDestination == .around { + if tournaments.isEmpty == false, federalDataViewModel.areFiltersEnabled() || navigation.agendaDestination == .around { ToolbarItemGroup(placement: .bottomBar) { VStack(spacing: 0) { let searchStatus = _searchStatus() diff --git a/PadelClub/Views/Navigation/Agenda/TournamentSubscriptionView.swift b/PadelClub/Views/Navigation/Agenda/TournamentSubscriptionView.swift index bc75ddc..9fc0961 100644 --- a/PadelClub/Views/Navigation/Agenda/TournamentSubscriptionView.swift +++ b/PadelClub/Views/Navigation/Agenda/TournamentSubscriptionView.swift @@ -88,19 +88,6 @@ struct TournamentSubscriptionView: View { var body: some View { List { - if didSaveInCalendar { - Section { - LabeledContent { - Image(systemName: "checkmark").foregroundStyle(.green) - } label: { - Text("Le tournoi a bien été ajouté dans votre calendrier par défaut") - let eventStore = EKEventStore() - if let defaultCalendarForNewEvents = eventStore.defaultCalendarForNewEvents { - Text(defaultCalendarForNewEvents.title) - } - } - } - } Section { LabeledContent("Tournoi") { Text(federalTournament.libelle ?? "Tournoi") @@ -160,60 +147,79 @@ struct TournamentSubscriptionView: View { } } - if let courrielEngagement = federalTournament.courrielEngagement { - Section { - RowButtonView("S'inscrire par email") { - contactType = .mail(date: nil, recipients: [courrielEngagement], bccRecipients: nil, body: messageBody, subject: messageSubject, tournamentBuild: build as? TournamentBuild) - } - } + Section { + Text(messageBody) + } header: { + Text("Message preparé par Padel Club") + } footer: { + CopyPasteButtonView(pasteValue: messageBody) } - - if let installation = federalTournament.installation, let telephone = installation.telephone { - if telephone.isMobileNumber() { - Section { - RowButtonView("S'inscrire par message") { - contactType = .message(date: nil, recipients: [telephone], body: messageBodyShort, tournamentBuild: build as? TournamentBuild) + } + .toolbarBackground(.visible, for: .bottomBar) + .toolbarBackground(.visible, for: .navigationBar) + .overlay(alignment: .bottom) { + if didSaveInCalendar { + Label("Ajouté dans votre calendrier par défaut", systemImage: "checkmark") + .toastFormatted() + .deferredRendering(for: .seconds(3)) + } + } + .toolbar(content: { + ToolbarItem(placement: .status) { + Menu { + if let courrielEngagement = federalTournament.courrielEngagement { + Section { + RowButtonView("S'inscrire par email", systemImage: "envelope") { + contactType = .mail(date: nil, recipients: [courrielEngagement], bccRecipients: nil, body: messageBody, subject: messageSubject, tournamentBuild: build as? TournamentBuild) + } } } - } - let number = telephone.replacingOccurrences(of: " ", with: "") - if let url = URL(string: "tel:\(number)") { - Link(destination: url) { - Label("Appeler", systemImage: "phone") + + if let installation = federalTournament.installation, let telephone = installation.telephone { + if telephone.isMobileNumber() { + Section { + RowButtonView("S'inscrire par message", systemImage: "message") { + contactType = .message(date: nil, recipients: [telephone], body: messageBodyShort, tournamentBuild: build as? TournamentBuild) + } + } + } + let number = telephone.replacingOccurrences(of: " ", with: "") + if let url = URL(string: "tel:\(number)") { + Link(destination: url) { + Label("Appeler", systemImage: "phone") + } + } } + } label: { + Text("Contact et inscription") } - - Section { - Text(messageBody) - } header: { - Text("Message preparé par Padel Club") - } footer: { - CopyPasteButtonView(pasteValue: messageBody) - } + .menuStyle(.button) + .buttonStyle(.borderedProminent) + .offset(y:-2) } - } - .toolbar(content: { - Menu { - ShareLink(item: federalTournament.sharePartnerMessage) { - Label("Prévenir votre partenaire", systemImage: "person.2") - } - - Button("Ajouter à votre agenda") { - addEvent() - } - - ShareLink(item: federalTournament.shareMessage) { - Label("Partager les infos", systemImage: "info") - } - Link(destination: URL(string:"https://tenup.fft.fr/tournoi/\(federalTournament.id)")!) { - Label("Voir sur Tenup", systemImage: "tennisball") - } - ShareLink(item: federalTournament.shareMessage) { - Label("Partager les infos", systemImage: "info") + ToolbarItem(placement: .topBarTrailing) { + Menu { + ShareLink(item: federalTournament.sharePartnerMessage) { + Label("Prévenir votre partenaire", systemImage: "person.2") + } + + Button("Ajouter à votre agenda") { + addEvent() + } + + ShareLink(item: federalTournament.shareMessage) { + Label("Partager les infos", systemImage: "info") + } + Link(destination: URL(string:"https://tenup.fft.fr/tournoi/\(federalTournament.id)")!) { + Label("Voir sur Tenup", systemImage: "tennisball") + } + ShareLink(item: federalTournament.shareMessage) { + Label("Partager les infos", systemImage: "info") + } + } label: { + LabelOptions() } - } label: { - LabelOptions() } }) .alert("Un problème est survenu", isPresented: messageSentFailed) { diff --git a/PadelClub/Views/Planning/PlanningSettingsView.swift b/PadelClub/Views/Planning/PlanningSettingsView.swift index bf111ea..1286f4d 100644 --- a/PadelClub/Views/Planning/PlanningSettingsView.swift +++ b/PadelClub/Views/Planning/PlanningSettingsView.swift @@ -202,12 +202,16 @@ struct PlanningSettingsView: View { .toastFormatted() .deferredRendering(for: .seconds(2)) } - } else if deletingDone { - Label("Tous les horaires ont été supprimés", systemImage: "clock.badge.xmark.fill") + } + + if deletingDone { + Label("Tous les horaires ont été supprimés", systemImage: "clock.badge.xmark") .toastFormatted() .deferredRendering(for: .seconds(2)) - } else if deletingDateMatchesDone { - Label("Horaires des matchs supprimés", systemImage: "clock.badge.xmark.fill") + } + + if deletingDateMatchesDone { + Label("Horaires des matchs supprimés", systemImage: "clock.badge.xmark") .toastFormatted() .deferredRendering(for: .seconds(2)) } diff --git a/PadelClub/Views/Tournament/FileImportView.swift b/PadelClub/Views/Tournament/FileImportView.swift index 8147fdf..c6644ff 100644 --- a/PadelClub/Views/Tournament/FileImportView.swift +++ b/PadelClub/Views/Tournament/FileImportView.swift @@ -311,17 +311,26 @@ struct FileImportView: View { } label: { Text("Équipe\(_filteredTeams.count.pluralSuffix) \(tournament.tournamentCategory.importingRawValue) \(tournament.federalTournamentAge.importingRawValue) détectée\(_filteredTeams.count.pluralSuffix)") } - LabeledContent { - Text(_filteredTeams.count.formatted()) - } label: { - Text("Équipe\(_filteredTeams.count.pluralSuffix) \(tournament.tournamentCategory.importingRawValue) \(tournament.federalTournamentAge.importingRawValue) détectée\(_filteredTeams.count.pluralSuffix)") - } } footer: { if previousTeams.isEmpty == false { Text("La liste ci-dessous n'est qu'une indication d'évolution par rapport au seul poids d'équipe. Cela ne tient pas compte des dates d'inscriptions, WCs et autres éléments.").foregroundStyle(.logoRed) } } + let unfound = _getUnfound(tournament: tournament, fromTeams: _filteredTeams) + + if unfound.isEmpty == false { + Section { + LabeledContent { + Text(unfound.count.formatted()) + } label: { + Text("Équipe\(unfound.count.pluralSuffix) précédente\(unfound.count.pluralSuffix) introuvable\(unfound.count.pluralSuffix)") + } + } footer: { + Text("Équipes de votre liste précédente non détectées dans ce nouveau fichier") + } + } + ForEach(_filteredTeams) { team in _teamView(team: team, inTeams: _filteredTeams, previousTeams: previousTeams) }