Aggiunge i tornei con hub, pagina pubblica e tabellone per semifinali e finali.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-05 15:05:57 +02:00
co-authored by Cursor
parent d52434fb2e
commit a1f4c24a43
124 changed files with 6979 additions and 91 deletions
@@ -0,0 +1,82 @@
<% content_for :title, t("tournaments.page.title", name: @tournament.name, club: @club.name) %>
<% content_for :robots, @tournament.published? ? "index, follow" : "noindex, nofollow" %>
<% content_for :canonical_url, seo_absolute_url(public_tournament_page_path(@tournament.slug)) if @tournament.published? %>
<div class="wrap team-public-page tournament-public">
<p class="results-hint" style="margin-bottom:8px">
<%= link_to t("tournaments.page.back_to_list"), public_tournament_pages_path, class: "back-link" %>
</p>
<header class="roster-hero card team-public-hero tournament-public-hero" style="--club-primary:<%= @tournament.effective_primary_color %>;--club-secondary:<%= @tournament.effective_secondary_color %>">
<% logo = @tournament.effective_logo_url %>
<% if logo.present? %>
<%= image_tag logo, alt: "", class: "tournament-public-hero__logo", width: 56, height: 56 %>
<% else %>
<div class="tournament-public-hero__logo tournament-public-hero__logo--fallback" aria-hidden="true">
<%= @tournament.name.to_s.first %>
</div>
<% end %>
<div class="roster-hero__intro">
<p class="roster-hero__club"><%= @club.name %></p>
<h1 class="roster-hero__title"><%= @tournament.name %></h1>
<p class="team-public-meta">
<%= @tournament.sport_label %>
· <%= l(@tournament.starts_on) %> <%= l(@tournament.ends_on) %>
<% if @tournament.venue.present? %> · <%= @tournament.venue %><% end %>
</p>
<% if @owner_preview %>
<p class="muted" style="margin:6px 0 0"><%= t("tournaments.page.draft_banner") %></p>
<% end %>
</div>
<% if @owner_manage %>
<%= link_to t("tournaments.index.open"), public_tournament_path(@tournament), class: "btn btn-secondary tournament-public-hero__manage" %>
<% end %>
</header>
<% if @live_sessions.any? %>
<section class="team-public-section" aria-labelledby="tournament-live-heading">
<h2 id="tournament-live-heading" class="section-heading"><%= t("tournaments.page.section_live") %></h2>
<div class="live-grid">
<% @live_sessions.each do |session| %>
<% match = session.match %>
<% on_air = @online_paths.include?(session.mediamtx_path_name) %>
<article class="live-card">
<%= live_match_card_heading(match, link_team: false) %>
<p class="meta">
<% if match.court_or_location.present? %><%= match.court_or_location %> · <% end %>
Match Live TV
</p>
<% if session.score_state %>
<p class="card-score">
<span class="card-sets"><%= live_score_sets_label(session.score_state, match) %></span>
<% if live_score_partials_label(session.score_state).present? %>
<span class="card-partials"><%= t("score.partials_prefix", value: live_score_partials_label(session.score_state)) %></span>
<% end %>
<span class="card-points"><%= session.score_state.home_points %> - <%= session.score_state.away_points %></span>
</p>
<% end %>
<div class="badges">
<% if on_air %>
<span class="badge badge-on-air"><%= t("live.index.badge_on_air") %></span>
<% elsif session.paused? %>
<span class="badge badge-connecting"><%= t("live.index.badge_paused") %></span>
<% else %>
<span class="badge badge-live"><%= t("live.index.badge_live") %></span>
<% end %>
</div>
<%= link_to t("tournaments.page.watch_live"), public_live_path(session), class: "btn-watch" %>
</article>
<% end %>
</div>
</section>
<% end %>
<nav class="tournament-public-tabs" aria-label="<%= t("tournaments.page.tabs_label") %>">
<% %w[risultati tabellone].each do |tab| %>
<%= link_to t("tournaments.page.tabs.#{tab}"), public_tournament_page_path(@tournament.slug, tab: tab),
class: "btn #{@tab == tab ? 'btn-primary' : 'btn-secondary'}" %>
<% end %>
</nav>
<%= render "public/tournament_pages/tab_#{@tab}" %>
</div>