Merge branch 'main'

sync3
Razmig Sarkissian 2 months ago
commit 6320697c7e
  1. 8
      PadelClub.xcodeproj/project.pbxproj
  2. 7
      PadelClub/Data/Federal/FederalPlayer.swift
  3. 2
      PadelClub/Views/Cashier/Event/EventCreationView.swift
  4. 11
      PadelClub/Views/Cashier/Event/EventTournamentsView.swift
  5. 27
      PadelClub/Views/Match/MatchDetailView.swift
  6. 2
      PadelClub/Views/Tournament/Screen/TableStructureView.swift

@ -3117,7 +3117,7 @@
CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
@ -3144,7 +3144,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.46;
MARKETING_VERSION = 1.2.48;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -3165,7 +3165,7 @@
CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
DEVELOPMENT_TEAM = BQ3Y44M3Q6;
@ -3190,7 +3190,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.46;
MARKETING_VERSION = 1.2.48;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

@ -80,7 +80,12 @@ class FederalPlayer: Decodable {
let ageSportif = try container.decodeIfPresent(Int.self, forKey: .ageSportif)
if let ageSportif {
birthYear = Calendar.current.component(.year, from: Date()) - ageSportif
let month = Calendar.current.component(.month, from: Date())
if month > 8 {
birthYear = Calendar.current.component(.year, from: Date()) + 1 - ageSportif
} else {
birthYear = Calendar.current.component(.year, from: Date()) - ageSportif
}
}
clubCode = try container.decodeIfPresent(String.self, forKey: .codeClub) ?? ""
club = try container.decodeIfPresent(String.self, forKey: .nomClub) ?? ""

@ -154,7 +154,7 @@ struct EventCreationView: View {
tournament.courtCount = selectedClub?.courtCount ?? 2
tournament.startDate = startingDate
tournament.dayDuration = duration
tournament.initSettings(templateTournament: templateTournament)
tournament.initSettings(templateTournament: templateTournament, overrideTeamCount: false)
}
do {

@ -35,6 +35,14 @@ struct EventTournamentsView: View {
} label: {
TournamentCellView(tournament: tournament)
.contextMenu {
NavigationLink {
TournamentSettingsView()
.environment(tournament)
} label: {
Label("Paramètres", systemImage: "gearshape.fill")
}
Button {
navigation.openTournamentInOrganizer(tournament)
} label: {
@ -134,8 +142,7 @@ struct EventTournamentsView: View {
newTournament.courtCount = event.eventCourtCount()
newTournament.startDate = event.eventStartDate()
newTournament.dayDuration = event.eventDayDuration()
newTournament.initSettings(templateTournament: Tournament.getTemplateTournament())
newTournament.initSettings(templateTournament: Tournament.getTemplateTournament(), overrideTeamCount: false)
dataStore.tournaments.addOrUpdate(instance: newTournament)
self.newTournament = nil

@ -361,6 +361,33 @@ struct MatchDetailView: View {
Text("Remise-à-zéro")
}
Menu {
Button("Effacer le nom") {
match.name = nil
tournamentStore?.matches.addOrUpdate(instance: match)
}
if let tournament = match.currentTournament() {
Menu {
ForEach(tournament.generateSeedGroups(base: 16, teamCount: 8), id: \.self) { seedGroup in
Button {
match.name = seedGroup.localizedInterval()
tournamentStore?.matches.addOrUpdate(instance: match)
} label: {
Text(seedGroup.localizedInterval())
}
}
} label: {
Text("Choisir un nom")
}
}
} label: {
Text("[Site] Nom du match")
if let name = match.name {
Text("(\(name))")
}
}
if match.teamScores.isEmpty == false {
Divider()
Menu {

@ -265,7 +265,7 @@ struct TableStructureView: View {
}
}
if tournament.rounds().isEmpty, tournament.state() == .build {
if tournament.rounds().isEmpty {
Section {
RowButtonView("Ajouter un tableau", role: .destructive) {
tournament.buildBracket(minimalBracketTeamCount: 4)

Loading…
Cancel
Save