Aggiunge i18n IT/EN/FR/DE/ES, pagine pubbliche squadre e UX archivio.
Il selettore lingua funziona sul web e sulle app native; su Android la preferenza è persistita e applicata al riavvio. Incluse anche eliminazione replay a scope e campi pagina pubblica squadra. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,12 +9,26 @@ module ApplicationHelper
|
||||
PLAN_ICONS[plan.slug] || "fa-solid fa-circle"
|
||||
end
|
||||
|
||||
# Data/ora nel fuso dell'app (Europe/Rome) e nella lingua del sito.
|
||||
# Data/ora nel fuso dell'app (Europe/Rome) e nella lingua corrente.
|
||||
def l_local(date_or_time, format: :long)
|
||||
return nil if date_or_time.blank?
|
||||
|
||||
value = date_or_time.respond_to?(:in_time_zone) ? date_or_time.in_time_zone : date_or_time
|
||||
I18n.with_locale(:it) { I18n.l(value, format: format) }
|
||||
I18n.l(value, format: format)
|
||||
end
|
||||
|
||||
def og_locale_tag
|
||||
{
|
||||
it: "it_IT",
|
||||
en: "en_US",
|
||||
fr: "fr_FR",
|
||||
de: "de_DE",
|
||||
es: "es_ES"
|
||||
}.fetch(I18n.locale.to_sym, "it_IT")
|
||||
end
|
||||
|
||||
def html_lang
|
||||
I18n.locale.to_s
|
||||
end
|
||||
|
||||
def sport_catalog_options(selected = nil)
|
||||
|
||||
@@ -50,13 +50,18 @@ module Public
|
||||
end
|
||||
end
|
||||
|
||||
def live_match_card_heading(match)
|
||||
def live_match_card_heading(match, link_team: true)
|
||||
team = match.team
|
||||
club_name = team.club&.name.presence || "Società"
|
||||
team_label = if link_team && team.slug.present?
|
||||
link_to(team.name, public_team_page_path(team.slug), class: "live-card__team-link")
|
||||
else
|
||||
team.name
|
||||
end
|
||||
content_tag(:h3, class: "live-card__title") do
|
||||
safe_join([
|
||||
content_tag(:span, club_name, class: "live-card__club"),
|
||||
content_tag(:span, "#{team.name} vs #{match.opponent_name}", class: "live-card__matchup")
|
||||
content_tag(:span, safe_join([team_label, " vs ", match.opponent_name]), class: "live-card__matchup")
|
||||
])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
module Public
|
||||
module TeamPagesHelper
|
||||
def team_page_meta_description(team, club)
|
||||
"Segui #{team.name} (#{club.name}): dirette live, calendario partite e replay su Match Live TV."
|
||||
end
|
||||
|
||||
def filter_params_for_canonical
|
||||
params.permit(:q, :sport, :live, :replays).to_h.compact_blank
|
||||
end
|
||||
|
||||
def team_page_structured_data(team, club)
|
||||
{
|
||||
"@context" => "https://schema.org",
|
||||
"@type" => "SportsTeam",
|
||||
"name" => team.name,
|
||||
"sport" => team.sport_label,
|
||||
"url" => seo_absolute_url(public_team_page_path(team.slug)),
|
||||
"memberOf" => {
|
||||
"@type" => "SportsOrganization",
|
||||
"name" => club.name
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user