add french loc

fix minor stuff
add publish option (swift only)
multistore
Razmig Sarkissian 2 years ago
parent 7d2f41c03a
commit e221813fba
  1. 26
      PadelClub.xcodeproj/project.pbxproj
  2. 21
      PadelClub/Data/Tournament.swift
  3. 7
      PadelClub/Localization/en.lproj/Localizable.strings
  4. 7
      PadelClub/Localization/fr.lproj/Localizable.strings
  5. 30
      PadelClub/Utils/Tips.swift
  6. 1
      PadelClub/Utils/URLs.swift
  7. 3
      PadelClub/Views/Match/MatchDetailView.swift
  8. 12
      PadelClub/Views/Navigation/Umpire/UmpireView.swift
  9. 53
      PadelClub/Views/Tournament/Screen/BroadcastView.swift
  10. 6
      PadelClub/Views/Tournament/TournamentView.swift

@ -254,6 +254,7 @@
FFDB1C732BB2CFE900F1E467 /* MySortDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFDB1C722BB2CFE900F1E467 /* MySortDescriptor.swift */; };
FFDDD40C2B93B2BB00C91A49 /* DeferredViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFDDD40B2B93B2BB00C91A49 /* DeferredViewModifier.swift */; };
FFEF7F4E2BDE69130033D0F0 /* MenuWarningView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFEF7F4D2BDE69130033D0F0 /* MenuWarningView.swift */; };
FFF0241E2BF48B15001F14B4 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = FFF0241D2BF48B15001F14B4 /* Localizable.strings */; };
FFF03C942BD91D0C00B516FC /* ButtonValidateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF03C932BD91D0C00B516FC /* ButtonValidateView.swift */; };
FFF116E12BD2A9B600A33B06 /* DateInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF116E02BD2A9B600A33B06 /* DateInterval.swift */; };
FFF116E32BD2AF4800A33B06 /* CourtAvailabilitySettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF116E22BD2AF4800A33B06 /* CourtAvailabilitySettingsView.swift */; };
@ -553,6 +554,8 @@
FFDB1C722BB2CFE900F1E467 /* MySortDescriptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MySortDescriptor.swift; sourceTree = "<group>"; };
FFDDD40B2B93B2BB00C91A49 /* DeferredViewModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeferredViewModifier.swift; sourceTree = "<group>"; };
FFEF7F4D2BDE69130033D0F0 /* MenuWarningView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuWarningView.swift; sourceTree = "<group>"; };
FFF0241C2BF48B15001F14B4 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
FFF0241F2BF48B1A001F14B4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
FFF03C932BD91D0C00B516FC /* ButtonValidateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonValidateView.swift; sourceTree = "<group>"; };
FFF116E02BD2A9B600A33B06 /* DateInterval.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateInterval.swift; sourceTree = "<group>"; };
FFF116E22BD2AF4800A33B06 /* CourtAvailabilitySettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourtAvailabilitySettingsView.swift; sourceTree = "<group>"; };
@ -633,6 +636,7 @@
FFF8ACD02B9238A2008466FA /* Utils */,
FFF8ACD72B923F26008466FA /* Extensions */,
C425D4042B6D249E002A7B48 /* Assets.xcassets */,
FFF024192BF48AEE001F14B4 /* Localization */,
FF0EC54D2BB195CA0056B6D1 /* CSV */,
C425D4062B6D249E002A7B48 /* Preview Content */,
);
@ -1195,6 +1199,14 @@
path = Components;
sourceTree = "<group>";
};
FFF024192BF48AEE001F14B4 /* Localization */ = {
isa = PBXGroup;
children = (
FFF0241D2BF48B15001F14B4 /* Localizable.strings */,
);
path = Localization;
sourceTree = "<group>";
};
FFF8ACD02B9238A2008466FA /* Utils */ = {
isa = PBXGroup;
children = (
@ -1342,6 +1354,7 @@
knownRegions = (
en,
Base,
fr,
);
mainGroup = C425D3F42B6D249D002A7B48;
packageReferences = (
@ -1373,6 +1386,7 @@
FF0EC5532BB195E20056B6D1 /* CLASSEMENT-PADEL-MESSIEURS-2-09-2022.csv in Resources */,
FF0EC5542BB195E20056B6D1 /* CLASSEMENT-PADEL-MESSIEURS-2-04-2023.csv in Resources */,
FF0EC5552BB195E20056B6D1 /* CLASSEMENT PADEL MESSIEURS_2-08-2023.csv in Resources */,
FFF0241E2BF48B15001F14B4 /* Localizable.strings in Resources */,
FF0EC5562BB195E20056B6D1 /* CLASSEMENT-PADEL-MESSIEURS-2-10-2022.csv in Resources */,
FF0EC5572BB195E20056B6D1 /* CLASSEMENT-PADEL-DAMES-10-2022.csv in Resources */,
FF0EC5582BB195E20056B6D1 /* CLASSEMENT-PADEL-MESSIEURS-3-05-2023.csv in Resources */,
@ -1678,6 +1692,18 @@
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
FFF0241D2BF48B15001F14B4 /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
FFF0241C2BF48B15001F14B4 /* fr */,
FFF0241F2BF48B1A001F14B4 /* en */,
);
name = Localizable.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
C425D41F2B6D249E002A7B48 /* Debug */ = {
isa = XCBuildConfiguration;

@ -44,6 +44,12 @@ class Tournament : ModelObject, Storable {
var additionalEstimationDuration: Int = 0
var isDeleted: Bool = false
var isCanceled: Bool = false
var publishManually: Bool = false
var publishTeams: Bool = false
var publishWaitingList: Bool = false
var publishSummons: Bool = false
var publishGroupStages: Bool = false
var publishBrackets: Bool = false
@ObservationIgnored
var navigationPath: [Screen] = []
@ -82,9 +88,15 @@ class Tournament : ModelObject, Storable {
case _isDeleted = "isDeleted"
case _isCanceled = "localId"
case _payment = "globalId"
case _publishManually = "publishManually"
case _publishTeams = "publishTeams"
case _publishWaitingList = "publishWaitingList"
case _publishSummons = "publishSummons"
case _publishGroupStages = "publishGroupStages"
case _publishBrackets = "publishBrackets"
}
internal init(event: String? = nil, name: String? = nil, startDate: Date = Date(), endDate: Date? = nil, creationDate: Date = Date(), isPrivate: Bool = true, groupStageFormat: MatchFormat? = nil, roundFormat: MatchFormat? = nil, loserRoundFormat: MatchFormat? = nil, groupStageSortMode: GroupStageOrderingMode, groupStageCount: Int = 4, rankSourceDate: Date? = nil, dayDuration: Int = 1, teamCount: Int = 24, teamSorting: TeamSortingType? = nil, federalCategory: TournamentCategory, federalLevelCategory: TournamentLevel, federalAgeCategory: FederalTournamentAge, groupStageCourtCount: Int? = nil, closedRegistrationDate: Date? = nil, groupStageAdditionalQualified: Int = 0, courtCount: Int = 2, prioritizeClubMembers: Bool = false, qualifiedPerGroupStage: Int = 1, teamsPerGroupStage: Int = 4, entryFee: Double? = nil, additionalEstimationDuration: Int = 0, isDeleted: Bool = false) {
internal init(event: String? = nil, name: String? = nil, startDate: Date = Date(), endDate: Date? = nil, creationDate: Date = Date(), isPrivate: Bool = true, groupStageFormat: MatchFormat? = nil, roundFormat: MatchFormat? = nil, loserRoundFormat: MatchFormat? = nil, groupStageSortMode: GroupStageOrderingMode, groupStageCount: Int = 4, rankSourceDate: Date? = nil, dayDuration: Int = 1, teamCount: Int = 24, teamSorting: TeamSortingType? = nil, federalCategory: TournamentCategory, federalLevelCategory: TournamentLevel, federalAgeCategory: FederalTournamentAge, groupStageCourtCount: Int? = nil, closedRegistrationDate: Date? = nil, groupStageAdditionalQualified: Int = 0, courtCount: Int = 2, prioritizeClubMembers: Bool = false, qualifiedPerGroupStage: Int = 1, teamsPerGroupStage: Int = 4, entryFee: Double? = nil, additionalEstimationDuration: Int = 0, isDeleted: Bool = false, publishManually: Bool = false, publishTeams: Bool = false, publishWaitingList: Bool = false, publishSummons: Bool = false, publishGroupStages: Bool = false, publishBrackets: Bool = false) {
self.event = event
self.name = name
self.startDate = startDate
@ -148,6 +160,13 @@ class Tournament : ModelObject, Storable {
additionalEstimationDuration = try container.decode(Int.self, forKey: ._additionalEstimationDuration)
isDeleted = try container.decode(Bool.self, forKey: ._isDeleted)
isCanceled = try Tournament._decodeCanceled(container: container)
publishManually = try container.decodeIfPresent(Bool.self, forKey: ._publishManually) ?? false
publishTeams = try container.decodeIfPresent(Bool.self, forKey: ._publishTeams) ?? false
publishWaitingList = try container.decodeIfPresent(Bool.self, forKey: ._publishWaitingList) ?? false
publishSummons = try container.decodeIfPresent(Bool.self, forKey: ._publishSummons) ?? false
publishGroupStages = try container.decodeIfPresent(Bool.self, forKey: ._publishGroupStages) ?? false
publishBrackets = try container.decodeIfPresent(Bool.self, forKey: ._publishBrackets) ?? false
}
fileprivate static let _numberFormatter: NumberFormatter = NumberFormatter()

@ -0,0 +1,7 @@
/*
Localizable.strings
Padel Tournament
Created by razmig on 06/04/2023.
*/

@ -0,0 +1,7 @@
/*
Localizable.strings
Padel Tournament
Created by razmig on 06/04/2023.
*/

@ -334,6 +334,36 @@ struct NotFoundAreWalkOutTip: Tip {
}
}
struct TournamentPublishingTip: Tip {
var title: Text {
Text("Gestion de la publication")
}
var message: Text? {
let messageString = "Padel Club vous permet de publier votre tournoi et rendre accessible à tous les résultats des matchs et l'évolution de l'événement. Les informations seront accessible sur le site [Padel Club](\(URLs.padelClub))."
return Text(.init(messageString))
}
var image: Image? {
Image("PadelClub_logo_fondclair_transparent")
}
}
struct TournamentTVBroadcastTip: Tip {
var title: Text {
Text("Lien TV")
}
var message: Text? {
return Text("Padel Club vous propose un site spéficique à utiliser sur les écrans de votre club, présentant de manière intelligente l'évolution de votre tournoi.")
}
var image: Image? {
Image(systemName: "sparkles.tv")
}
}
struct TipStyleModifier: ViewModifier {
@Environment(\.colorScheme) var colorScheme
var tint: Color?

@ -11,6 +11,7 @@ enum URLs: String, Identifiable {
case subscriptions = "https://apple.co/2Th4vqI"
case main = "https://xlr.alwaysdata.net/"
case beachPadel = "https://beach-padel.app.fft.fr/beachja/index/"
case padelClub = "https://padelclub.app"
var id: String { return self.rawValue }

@ -373,7 +373,8 @@ struct MatchDetailView: View {
}
}
shareView
//todo
//shareView
// if let followUpMatch = match.followUpMatch {
// Section {

@ -51,11 +51,13 @@ struct UmpireView: View {
let currentPlayerData = dataStore.user.currentPlayerData()
Section {
if let currentPlayerData {
NavigationLink {
} label: {
ImportedPlayerView(player: currentPlayerData)
}
//todo palmares
ImportedPlayerView(player: currentPlayerData)
// NavigationLink {
//
// } label: {
// ImportedPlayerView(player: currentPlayerData)
// }
} else {
RowButtonView("Ma fiche joueur", systemImage: "person.bust") {
presentSearchView = true

@ -8,6 +8,7 @@
import SwiftUI
import CoreImage.CIFilterBuiltins
import LeStorage
import TipKit
extension String : Identifiable {
public var id: String { self }
@ -21,9 +22,58 @@ struct BroadcastView: View {
@State private var urlToShow: String?
@State private var tvMode: Bool = false
let tournamentPublishingTip = TournamentPublishingTip()
let tournamentTVBroadcastTip = TournamentTVBroadcastTip()
var body: some View {
@Bindable var tournament = tournament
List {
TipView(tournamentPublishingTip)
.tipStyle(tint: nil)
TipView(tournamentTVBroadcastTip)
.tipStyle(tint: nil)
if tournament.publishManually == false {
Section {
Text("En mode automatique, Padel Club détermine le meilleur moment pour publier les informations du tournoi.\n\n• La liste des équipes sera visible au maximum 2 jours après la clôture des inscriptions. À partir des p500, la liste d'attente à la clôture sera également publiée.\n\n• Les convocations ne seront visibles qu'à partir du premier jour du tournoi.\n\n• Les poules ne seront visibles qu'au premier jour des poules.\n\n• Le tableau ne sera visible qu'au premier jour du tableau.")
} header: {
Text("Mode Automatique")
} footer: {
FooterButtonView("désactiver le mode automatique") {
tournament.publishManually.toggle()
}
}
}
if tournament.publishManually == true {
Section {
Text("En mode manuel, vous devez indiquer à Padel Club le moment où vous souhaitez publier les informations du tournoi")
Toggle(isOn: $tournament.publishTeams) {
Text("Publier la liste des équipes")
Text("Les horaires de convocations ne seront pas publiés")
}
Toggle(isOn: $tournament.publishWaitingList) {
Text("Inclure les équipes en liste d'attente")
}
Toggle(isOn: $tournament.publishSummons) {
Text("Publier les convocations")
}
Toggle(isOn: $tournament.publishGroupStages) {
Text("Publier les poules")
}
Toggle(isOn: $tournament.publishBrackets) {
Text("Publier le tableau")
}
} header: {
Text("Mode Manuel")
} footer: {
FooterButtonView("activer le mode automatique") {
tournament.publishManually.toggle()
}
}
}
Section {
Toggle(isOn: $tournament.isPrivate) {
Text("Tournoi privé")
@ -69,7 +119,8 @@ struct BroadcastView: View {
}
}
.navigationTitle("Diffusion")
.headerProminence(.increased)
.navigationTitle("Publication")
.navigationBarTitleDisplayMode(.inline)
.toolbarBackground(.visible, for: .navigationBar)
.sheet(item: $urlToShow) { urlToShow in

@ -74,7 +74,11 @@ struct TournamentView: View {
TournamentInitView()
NavigationLink(value: Screen.broadcast) {
Text("Diffusion")
LabeledContent {
Text(tournament.publishManually ? "manuel" : "auto.")
} label: {
Text("Publication")
}
}
case .build:

Loading…
Cancel
Save