Nasconde dall'hub le partite con risultato già inserito.
Restano avviabili solo le gare in ritardo senza punteggio, non quelle già terminate dal portale. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,7 +16,7 @@ module Public
|
||||
Tournaments::Entitlements.new(@club).assert_writable!
|
||||
match = @tournament.matches.find(params[:match_id])
|
||||
attrs = match_params
|
||||
if match.played? || match.result_status.to_s.start_with?("walkover")
|
||||
if match.result_recorded?
|
||||
attrs = attrs.except(:home_participant_id, :away_participant_id)
|
||||
end
|
||||
match.update!(attrs)
|
||||
|
||||
@@ -100,7 +100,7 @@ module Public
|
||||
def tournament_public_board_state(match)
|
||||
return :live if tournament_public_live_session(match)
|
||||
return :replay if tournament_public_recording(match)
|
||||
return :ended if match.played? || match.result_status.to_s.start_with?("walkover") || match.home_score.present?
|
||||
return :ended if match.result_recorded?
|
||||
return :scheduled if match.scheduled_upcoming?
|
||||
|
||||
:waiting
|
||||
@@ -129,7 +129,7 @@ module Public
|
||||
end
|
||||
|
||||
def tournament_match_sides_locked?(match)
|
||||
match.played? || match.result_status.to_s.start_with?("walkover")
|
||||
match.result_recorded?
|
||||
end
|
||||
|
||||
def tournament_phase_label(match)
|
||||
|
||||
@@ -94,10 +94,15 @@ class Match < ApplicationRecord
|
||||
opponent_primary_color.presence || DEFAULT_OPPONENT_COLOR
|
||||
end
|
||||
|
||||
def result_recorded?
|
||||
played? || result_status.to_s.start_with?("walkover") || (home_score.present? && away_score.present?)
|
||||
end
|
||||
|
||||
def coach_hub_visible?
|
||||
active = active_stream_session
|
||||
return true if active&.resumable?
|
||||
return true if active&.idle?
|
||||
return false if result_recorded?
|
||||
return false if stream_completed?
|
||||
return true if scheduled_on_calendar?
|
||||
return true if tournament_open_for_late_stream?
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</div>
|
||||
<div class="tournament-match-row__score">
|
||||
<span class="tournament-match-row__label"><%= t("tournaments.hub.result") %></span>
|
||||
<% if match.played? || match.result_status.to_s.start_with?("walkover") %>
|
||||
<% if match.result_recorded? %>
|
||||
<p data-swap-played-score><%= match.home_score %>–<%= match.away_score %></p>
|
||||
<% else %>
|
||||
<span class="tournament-match-form__score">
|
||||
|
||||
Reference in New Issue
Block a user