Files
MatchLiveTv/backend/app/views/public/tournament_pages/_tab_tabellone.html.erb
T

61 lines
2.2 KiB
ERB

<% visible_rounds = @rounds.select { |round| (@matches_by_round[round.id] || []).any? } %>
<section class="team-public-section" id="tabellone" aria-labelledby="tournament-bracket-heading">
<h2 id="tournament-bracket-heading" class="section-heading visually-hidden"><%= t("tournaments.page.tabs.tabellone") %></h2>
<% @groups.each do |group| %>
<h3 class="tournament-board__day"><%= group.name %><%= t("tournaments.hub.standings") %></h3>
<div class="tournament-table-wrap">
<table class="data">
<thead>
<tr>
<th></th>
<th><%= t("tournaments.hub.played") %></th>
<th><%= t("tournaments.hub.won") %></th>
<th><%= t("tournaments.hub.lost") %></th>
<th><%= t("tournaments.hub.points") %></th>
</tr>
</thead>
<tbody>
<% @standings_by_group[group].each_with_index do |row, idx| %>
<tr>
<td><%= idx + 1 %>. <%= tournament_team_chip(row.participant) %></td>
<td><%= row.played %></td>
<td><%= row.won %></td>
<td><%= row.lost %></td>
<td><strong><%= row.points %></strong></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %>
<% visible_rounds.each do |round| %>
<h3 class="tournament-board__day"><%= round.name %></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_by_round[round.id].each do |match| %>
<%= render "public/tournament_pages/board_row", match: match %>
<% end %>
</tbody>
</table>
</div>
<% end %>
<% if @groups.none? && visible_rounds.none? %>
<p class="muted"><%= t("tournaments.page.bracket_empty") %></p>
<% end %>
</section>