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

49 lines
1.8 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.
<% state = tournament_public_board_state(match) %>
<% live_session = tournament_public_live_session(match) %>
<% recording = tournament_public_recording(match) %>
<% score = tournament_public_score_label(match) %>
<tr class="tournament-board__row tournament-board__row--<%= state %>">
<td>
<% if match.scheduled_at %>
<%= match.scheduled_at.in_time_zone.strftime("%H:%M") %>
<% else %>
<% end %>
</td>
<td><%= match.court.presence || "—" %></td>
<td>
<div class="tournament-stream-plan__matchup">
<%= tournament_team_chip(match.home_participant, name: match.home_display_name) %>
<span class="tournament-stream-plan__vs"></span>
<%= tournament_team_chip(match.away_participant, name: match.away_display_name) %>
</div>
<% if match.tournament_group || match.tournament_round %>
<p class="tournament-board__phase">
<%= [match.tournament_group&.name, match.tournament_round&.name].compact.join(" · ") %>
</p>
<% end %>
</td>
<td>
<% if score.present? %>
<strong><%= score %></strong>
<% else %>
<% end %>
</td>
<td>
<span class="tournament-live-status tournament-live-status--<%= state %>">
<span class="tournament-live-status__dot" aria-hidden="true"></span>
<%= t("tournaments.page.state.#{state}") %>
</span>
</td>
<td class="tournament-board__actions">
<% if live_session %>
<%= link_to t("tournaments.page.watch_live"), public_live_path(live_session), class: "tournament-board__cta tournament-board__cta--live" %>
<% elsif recording %>
<%= link_to t("tournaments.page.watch_replay"), public_replay_path(recording.stream_session_id), class: "tournament-board__cta" %>
<% else %>
<span class="muted"><%= t("tournaments.page.no_media") %></span>
<% end %>
</td>
</tr>