Files
MatchLiveTv/backend/app/views/public/tournament_pages/show.html.erb
T
eminuxandCursor c3ef8e91a6 Rende usabili calendario, overlay ospite e stato diretta del cartellone.
Il calendario non deve più scorrere in orizzontale, il logo a destra non copre il nome e una diretta YouTube o in collegamento compare come In diretta.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 09:55:08 +02:00

87 lines
4.2 KiB
ERB
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<% 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>
<% watch = tournament_public_watch_target(session) %>
<% if watch %>
<% url, label, html_opts = watch %>
<%= link_to label, url, { class: "btn-watch" }.merge(html_opts) %>
<% end %>
</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>