|
|
|
|
@ -58,22 +58,25 @@ struct BroadcastView: View { |
|
|
|
|
Text("Liste des équipes") |
|
|
|
|
} footer: { |
|
|
|
|
if Date() < tournament.publishedTeamsDate() { |
|
|
|
|
HStack { |
|
|
|
|
Spacer() |
|
|
|
|
FooterButtonView(tournament.publishTeams ? "masquer sur le site" : "publier maintenant") { |
|
|
|
|
tournament.publishTeams.toggle() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
|
LabeledContent { |
|
|
|
|
if tournament.areTeamsPublished() { |
|
|
|
|
if tournament.areSummonsPublished() { |
|
|
|
|
Image(systemName:"checkmark").foregroundStyle(.green) |
|
|
|
|
} else { |
|
|
|
|
Text(tournament.publishedTeamsDate().formatted()) |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
if tournament.areTeamsPublished() { |
|
|
|
|
Text("Publiée") |
|
|
|
|
if tournament.areSummonsPublished() { |
|
|
|
|
Text("Publiées") |
|
|
|
|
} else { |
|
|
|
|
Text("Publication prévue") |
|
|
|
|
} |
|
|
|
|
@ -82,11 +85,14 @@ struct BroadcastView: View { |
|
|
|
|
Text("Convocations") |
|
|
|
|
} footer: { |
|
|
|
|
if Date() < tournament.publishedTeamsDate() { |
|
|
|
|
HStack { |
|
|
|
|
Spacer() |
|
|
|
|
FooterButtonView(tournament.publishSummons ? "masquer sur le site" : "publier maintenant") { |
|
|
|
|
tournament.publishSummons.toggle() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if let publishedGroupStagesDate = tournament.publishedGroupStagesDate() { |
|
|
|
|
Section { |
|
|
|
|
@ -99,7 +105,7 @@ struct BroadcastView: View { |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
if areGroupStagesPublished { |
|
|
|
|
Text("Publiée") |
|
|
|
|
Text("Publiées") |
|
|
|
|
} else { |
|
|
|
|
Text("Publication prévue") |
|
|
|
|
} |
|
|
|
|
@ -108,12 +114,15 @@ struct BroadcastView: View { |
|
|
|
|
Text("Poules") |
|
|
|
|
} footer: { |
|
|
|
|
if Date() < publishedGroupStagesDate { |
|
|
|
|
HStack { |
|
|
|
|
Spacer() |
|
|
|
|
FooterButtonView(tournament.publishGroupStages ? "masquer sur le site" : "publier maintenant") { |
|
|
|
|
tournament.publishGroupStages.toggle() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if let publishedBracketsDate = tournament.publishedBracketsDate() { |
|
|
|
|
Section { |
|
|
|
|
@ -126,7 +135,7 @@ struct BroadcastView: View { |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
if areBracketsPublished { |
|
|
|
|
Text("Publiée") |
|
|
|
|
Text("Publié") |
|
|
|
|
} else { |
|
|
|
|
Text("Publication prévue") |
|
|
|
|
} |
|
|
|
|
@ -135,12 +144,15 @@ struct BroadcastView: View { |
|
|
|
|
Text("Tableau") |
|
|
|
|
} footer: { |
|
|
|
|
if Date() < publishedBracketsDate { |
|
|
|
|
HStack { |
|
|
|
|
Spacer() |
|
|
|
|
FooterButtonView(tournament.publishBrackets ? "masquer sur le site" : "publier maintenant") { |
|
|
|
|
tournament.publishBrackets.toggle() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//todo waitinglist & info |
|
|
|
|
|
|
|
|
|
@ -149,7 +161,7 @@ struct BroadcastView: View { |
|
|
|
|
Text("Tournoi privé") |
|
|
|
|
} |
|
|
|
|
} footer: { |
|
|
|
|
let footerString = "Le tournoi sera masqué sur le site [Padel Club]\(URLs.main.rawValue)" |
|
|
|
|
let footerString = "Le tournoi sera masqué sur le site [Padel Club](\(URLs.main.rawValue))" |
|
|
|
|
Text(.init(footerString)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -204,7 +216,7 @@ struct BroadcastView: View { |
|
|
|
|
UIPasteboard.general.string = urlToShow |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.onChange(of: tournament.isPrivate) { |
|
|
|
|
.onChange(of: [tournament.isPrivate, tournament.publishTeams, tournament.publishSummons, tournament.publishBrackets, tournament.publishGroupStages]) { |
|
|
|
|
_save() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|