Files
MatchLiveTv/backend/app/views/public/replay/index.html.erb
eminuxandCursor b88f44ab1c Completa i18n IT/EN/FR/DE/ES su sito pubblico, area autenticata e admin.
Tutte le view marketing, legali, viewer, dashboard e admin usano t(); mailer utente-facing e flash localizzati; admin con LocaleResolver e selettore lingua.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 00:38:50 +02:00

94 lines
4.2 KiB
ERB

<% content_for :title, t("replay.index.meta_title") %>
<% content_for :meta_description, t("replay.index.meta_description") %>
<div class="wrap replay-index">
<%= link_to t("replay.index.back_to_live"), public_live_index_path, class: "back-link" %>
<h1><%= t("replay.index.title") %></h1>
<p class="results-hint"><%= t("replay.index.hint") %></p>
<%= form_with url: public_replay_index_path, method: :get, local: true, class: "search-form" do %>
<% if params[:club_id].present? %>
<%= hidden_field_tag :club_id, params[:club_id] %>
<% end %>
<input
type="search"
name="q"
value="<%= @query %>"
placeholder="<%= t("replay.index.search_placeholder") %>"
aria-label="<%= t("replay.index.search_aria_label") %>"
autocomplete="off"
/>
<button type="submit" class="btn btn-primary"><%= t("replay.index.search_button") %></button>
<% if @query.present? || params[:club_id].present? %>
<%= link_to t("replay.index.reset_link"), public_replay_index_path, class: "btn btn-secondary" %>
<% end %>
<% end %>
<% if @clubs.many? %>
<%= form_with url: public_replay_index_path, method: :get, local: true, class: "replay-filter-form" do %>
<% if @query.present? %>
<%= hidden_field_tag :q, @query %>
<% end %>
<label for="club_id" class="muted"><%= t("replay.index.club_filter_label") %></label>
<select name="club_id" id="club_id" class="input" onchange="this.form.submit()">
<option value=""><%= t("replay.index.club_filter_all") %></option>
<% @clubs.each do |club| %>
<option value="<%= club.id %>"<%= " selected" if params[:club_id].to_s == club.id.to_s %>><%= club.name %></option>
<% end %>
</select>
<% end %>
<% end %>
<% if @query.present? %>
<% club_suffix = @filter_club ? t("replay.index.results_hint_club_suffix", name: @filter_club.name) : "" %>
<p class="results-hint">
<%= t("replay.index.results_hint", query: @query, club_suffix: club_suffix, count: @recordings.size) %>
</p>
<% end %>
<% if @recordings.any? %>
<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 %>
<span class="replay-card__duration"><%= rec.duration_label %></span>
<span class="replay-card__play" aria-hidden="true"></span>
</div>
<div class="replay-card__body">
<strong class="replay-card__title"><%= rec.title_or_default %></strong>
<p class="replay-card__meta">
<%= match.team.club.name %> · <%= l_local(rec.recorded_at_or_fallback) %>
<% if rec.source_platform_label != "—" %>
· <span class="badge badge-wait" style="font-size:0.65rem;vertical-align:middle"><%= rec.source_platform_label %></span>
<% end %>
</p>
<p class="replay-card__meta replay-card__meta--sub">
<%= rec.views_label %>
</p>
</div>
<% end %>
<% end %>
</div>
<% else %>
<div class="empty-state">
<% if @query.present? || params[:club_id].present? %>
<p><strong><%= t("replay.index.empty_filtered_title") %></strong><%= t("replay.index.empty_filtered_suffix") %></p>
<p><%= link_to t("replay.index.empty_filtered_show_all"), public_replay_index_path, class: "btn btn-secondary" %></p>
<% else %>
<p><strong><%= t("replay.index.empty_default_title") %></strong></p>
<p><%= t("replay.index.empty_default_body") %></p>
<%= link_to t("replay.index.empty_default_live_link"), public_live_index_path, class: "btn btn-secondary", style: "margin-top:12px;display:inline-block" %>
<% end %>
</div>
<% end %>
</div>