Aggiunge modulo Replay, Garage dev e YouTube a livello società.
Pipeline registrazione/upload con storage S3, archivio web e app, proxy replay per il browser, OAuth YouTube sulla pagina club (Premium Full) e footer legale. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
52
backend/app/views/public/clubs/_youtube.html.erb
Normal file
52
backend/app/views/public/clubs/_youtube.html.erb
Normal file
@@ -0,0 +1,52 @@
|
||||
<% return unless entitlements&.youtube_enabled? %>
|
||||
<% yt = Youtube::TeamStatus.new(entitlements_team) if entitlements_team %>
|
||||
<% cred = club.youtube_credential %>
|
||||
|
||||
<section class="card club-youtube" id="youtube">
|
||||
<h2>YouTube Live</h2>
|
||||
|
||||
<% if params[:youtube] == "connected" %>
|
||||
<p class="notice" style="color:#2e7d32;margin-bottom:12px">Canale YouTube della società collegato con successo.</p>
|
||||
<% end %>
|
||||
|
||||
<% if entitlements.plan.youtube_mode == "matchlivetv_light" %>
|
||||
<p>
|
||||
Con il piano <strong>Premium Light</strong> le dirette YouTube di tutte le squadre vanno sul canale ufficiale
|
||||
<strong>Match Live TV</strong>. Non serve collegare un canale della società.
|
||||
</p>
|
||||
<% if yt&.selectable? %>
|
||||
<p class="muted">Canale pronto · seleziona «YouTube Live» nell’app mobile.</p>
|
||||
<% else %>
|
||||
<p class="muted">Canale Match Live TV in configurazione lato server. Contatta il supporto se YouTube non compare in app.</p>
|
||||
<% end %>
|
||||
<% elsif entitlements.premium_full? %>
|
||||
<% if cred %>
|
||||
<p>
|
||||
Canale collegato per <strong>tutta la società</strong>:
|
||||
<strong><%= cred.channel_title.presence || cred.channel_id || "YouTube" %></strong>
|
||||
</p>
|
||||
<p class="muted">Tutte le squadre possono trasmettere su questo canale quando scelgono il canale società in app.</p>
|
||||
<%= button_to "Scollega canale", public_club_youtube_disconnect_path(club),
|
||||
method: :delete,
|
||||
class: "btn btn-secondary",
|
||||
form: { data: { turbo_confirm: "Scollegare il canale YouTube? Le dirette useranno il canale Match Live TV finché non ricolleghi il tuo." } } %>
|
||||
<% else %>
|
||||
<p>
|
||||
Senza canale collegato, le dirette YouTube dall’app vanno sul canale ufficiale
|
||||
<strong>Match Live TV</strong>.
|
||||
Collega qui il canale YouTube della società (vale per tutte le squadre).
|
||||
</p>
|
||||
<% if yt&.selectable? %>
|
||||
<p class="muted">YouTube pronto in app (canale Match Live TV finché non colleghi il tuo).</p>
|
||||
<% end %>
|
||||
<% if ENV["YOUTUBE_CLIENT_ID"].present? %>
|
||||
<%= link_to "Collega il canale YouTube della società", public_club_youtube_connect_path(club), class: "btn btn-primary" %>
|
||||
<% else %>
|
||||
<p class="muted">OAuth YouTube non ancora configurato sul server.</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p class="muted">YouTube sul canale della società richiede il piano Premium Full.</p>
|
||||
<%= link_to "Vedi piani", public_prezzi_path, class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</section>
|
||||
@@ -22,8 +22,38 @@
|
||||
<%= link_to "Abbonamento", public_club_billing_path(@club), class: "btn btn-primary" %>
|
||||
<%= link_to "Nuova squadra", public_new_club_team_path(@club), class: "btn btn-secondary" %>
|
||||
<%= link_to "Dirette live", public_live_index_path(club_id: @club.id), class: "btn btn-secondary" %>
|
||||
<% if @entitlements&.can_access_recordings? %>
|
||||
<%= link_to "Archivio Replay", public_club_recordings_path(@club), class: "btn btn-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= render "public/clubs/youtube",
|
||||
club: @club,
|
||||
entitlements: @entitlements,
|
||||
entitlements_team: @entitlements_team %>
|
||||
|
||||
<% if @replay_stats %>
|
||||
<h2>Replay</h2>
|
||||
<div class="card" style="display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:16px;padding:16px;margin-bottom:24px">
|
||||
<div>
|
||||
<div style="font-size:1.6rem;font-weight:700"><%= @replay_stats[:available_count] %></div>
|
||||
<div class="muted">disponibili</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-size:1.6rem;font-weight:700"><%= @replay_stats[:expiring_soon_count] %></div>
|
||||
<div class="muted">in scadenza (7 gg)</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-size:1.6rem;font-weight:700"><%= number_to_human_size(@replay_stats[:total_bytes]) %></div>
|
||||
<div class="muted">spazio occupato</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-size:1.6rem;font-weight:700"><%= @replay_stats[:total_views] %></div>
|
||||
<div class="muted">visualizzazioni</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<h2>Squadre</h2>
|
||||
<div class="card">
|
||||
<% if @teams.any? %>
|
||||
|
||||
Reference in New Issue
Block a user