Files
MatchLiveTv/backend/app/views/public/teams/_youtube.html.erb
Emiliano Frascaro 9b40deeb61 Unifica admin società/squadre e YouTube Full con fallback MLTV.
Premium Full senza canale società usa il canale piattaforma come Light;
in app restano solo Match Live TV e YouTube Live.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 22:38:28 +02:00

52 lines
2.2 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 useranno il canale Match Live TV finché non ricolleghi il tuo." } } %>
<% else %>
<p>
Senza canale collegato, le dirette YouTube dallapp vanno sul canale ufficiale
<strong>Match Live TV</strong>.
Puoi collegare il canale della società quando vuoi per trasmettere sul tuo profilo.
</p>
<% if yt.selectable? %>
<p class="muted">YouTube pronto in app (canale Match Live TV).</p>
<% end %>
<% if ENV["YOUTUBE_CLIENT_ID"].present? %>
<%= link_to "Collega il tuo 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>