Files
MatchLiveTv/backend/app/views/public/teams/_youtube.html.erb
Emiliano Frascaro 994c1e3c09 Integrazione YouTube Live: OAuth squadra, canale piattaforma Light e UI.
Collegamento da Dettagli squadra e admin per il refresh token Match Live TV; API e app mobile allineate ai piani Light/Full.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 19:36:56 +02:00

47 lines
2.0 KiB
Plaintext
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.
<% yt = Youtube::TeamStatus.new(team) %>
<% return unless entitlements.youtube_enabled? %>
<section class="card team-youtube" id="youtube">
<h2>YouTube Live</h2>
<% if params[:youtube] == "connected" %>
<p class="notice" style="color:#2e7d32;margin-bottom:12px">Canale YouTube collegato con successo.</p>
<% end %>
<% if entitlements.plan.youtube_mode == "matchlivetv_light" %>
<p>
Con il piano <strong>Premium Light</strong> la diretta va 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» nellapp 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? %>
<% cred = team.youtube_credential %>
<% if cred %>
<p>
Canale collegato:
<strong><%= cred.channel_title.presence || cred.channel_id || "YouTube" %></strong>
</p>
<%= button_to "Scollega canale", public_team_youtube_disconnect_path(team),
method: :delete,
class: "btn btn-secondary",
form: { data: { turbo_confirm: "Scollegare il canale YouTube? Le dirette future richiederanno un nuovo collegamento." } } %>
<% else %>
<p class="muted">
Collega il canale YouTube della società per trasmettere dallapp con la piattaforma «YouTube Live».
</p>
<% if ENV["YOUTUBE_CLIENT_ID"].present? %>
<%= link_to "Collega canale YouTube", public_team_youtube_connect_path(team), 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>