Files
MatchLiveTv/backend/app/views/public/tournament_pages/_tab_risultati.html.erb
T
eminuxandCursor b09e83db09 Allinea stato e titolo replay del tabellone al risultato reale.
Una gara con punteggio non resta più «In programma» solo perché l'orario è futuro, e i replay usano le squadre del match invece della squadra di trasmissione.

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

66 lines
2.9 KiB
ERB

<section class="team-public-section" id="risultati" aria-labelledby="tournament-results-heading">
<h2 id="tournament-results-heading" class="section-heading visually-hidden"><%= t("tournaments.page.tabs.risultati") %></h2>
<p class="results-hint"><%= t("tournaments.page.board_hint") %></p>
<% if @matches.any? %>
<% tournament_matches_grouped_by_date(@matches).each do |date, matches| %>
<h3 class="tournament-board__day">
<%= date ? l(date, format: :long) : t("tournaments.hub.stream_plan_unscheduled") %>
</h3>
<div class="tournament-table-wrap">
<table class="data tournament-board">
<thead>
<tr>
<th><%= t("tournaments.hub.datetime") %></th>
<th><%= t("tournaments.hub.court") %></th>
<th><%= t("tournaments.hub.stream_plan_match") %></th>
<th><%= t("tournaments.page.score") %></th>
<th><%= t("tournaments.hub.stream_plan_live_col") %></th>
<th></th>
</tr>
</thead>
<tbody>
<% matches.each do |match| %>
<%= render "public/tournament_pages/board_row", match: match %>
<% end %>
</tbody>
</table>
</div>
<% end %>
<% else %>
<p class="muted"><%= t("tournaments.hub.no_matches") %></p>
<% end %>
</section>
<% if @recordings.any? %>
<section class="team-public-section">
<h2 class="section-heading section-heading--spaced"><%= t("tournaments.page.section_replays") %></h2>
<div class="replay-grid">
<% @recordings.each do |rec| %>
<% match = rec.stream_session.match %>
<%= link_to public_replay_path(rec.stream_session_id), class: "replay-card" do %>
<div class="replay-card__media">
<% if rec.thumbnail_url %>
<img src="<%= rec.thumbnail_url %>" alt="" class="replay-card__thumb" loading="lazy" width="320" height="180">
<% else %>
<div class="replay-card__thumb replay-card__thumb--placeholder" aria-hidden="true">
<span class="replay-card__placeholder-icon"></span>
</div>
<% end %>
<% if rec.duration_label.present? %>
<span class="replay-card__duration"><%= rec.duration_label %></span>
<% end %>
<span class="replay-card__play" aria-hidden="true"></span>
</div>
<div class="replay-card__body">
<% phase = [match.tournament_round&.name, match.tournament_group&.name].compact.first %>
<strong class="replay-card__title"><%= match.matchup_label %></strong>
<p class="replay-card__meta">
<%= [phase, rec.recorded_at_or_fallback && l(rec.recorded_at_or_fallback, format: :short)].compact.join(" · ") %>
</p>
</div>
<% end %>
<% end %>
</div>
</section>
<% end %>