<% content_for :title, "#{@team.name} — Dashboard" %> <% content_for :meta_description, "Dashboard squadra #{@team.name} su Match Live TV." %> <% content_for :robots, "noindex, nofollow" %>

<%= link_to @club.name, public_club_path(@club) %> · <%= link_to "Modifica squadra", public_edit_team_path(@team) %>

<% if @team.effective_logo_url.present? %> <%= image_tag @team.effective_logo_url, alt: "", width: 40, height: 40, style: "border-radius:8px" %> <% end %> <%= @team.name %>

Piano: <%= @entitlements.plan.name %> (società) · Staff trasmissione: <%= @entitlements.staff_count_for("transmission") %> / <%= @entitlements.max_staff_transmission || "∞" %> · Staff regia: <%= @entitlements.staff_count_for("regia") %> / <%= @entitlements.max_staff_regia || "∞" %> · Partite attive: <%= @entitlements.concurrent_streams_used %><% if @entitlements.concurrent_streams_limit %> / <%= @entitlements.concurrent_streams_limit %><% else %> (illimitate)<% end %>

<%= link_to "Abbonamento società", public_club_billing_path(@club), class: "btn btn-primary" %> <%= link_to "Aggiungi staff", public_team_invite_path(@team), class: "btn btn-secondary" %> <%= link_to "Dirette live", public_live_index_path, class: "btn btn-secondary" %>
<% owner_staff = @owner_membership&.staff_kind %> <% can_self_transmission = owner_staff != "transmission" && owner_staff != "regia" %> <% can_self_regia = owner_staff != "regia" && owner_staff != "transmission" %> <% if can_self_transmission || can_self_regia %>

Il tuo account (<%= current_user.email %>)

Puoi usare le stesse credenziali nell’app mobile. Trasmissione e regia devono essere email diverse — non puoi coprire entrambi i ruoli con questo account.

<% if can_self_transmission %> <%= button_to "Sono io — staff trasmissione", public_team_assign_self_staff_path(@team), method: :post, params: { staff_kind: "transmission" }, class: "btn btn-primary" %> <% end %> <% if can_self_regia %> <%= button_to "Sono io — staff regia", public_team_assign_self_staff_path(@team), method: :post, params: { staff_kind: "regia" }, class: "btn btn-secondary" %> <% end %>
<% end %>

Staff attivo

<% if @staff_memberships.any? %> <% @staff_memberships.each do |ut| %> <% end %>
NomeEmailRuolo
<%= ut.user.name %> <% if ut.role == "owner" %> (tu)<% end %> <%= ut.user.email %> <%= ut.staff_kind == "regia" ? "Regia" : "Trasmissione" %> <% if ut.role == "owner" %> <%= button_to "Rimuovi ruolo staff", public_team_clear_self_staff_path(@team), method: :delete, class: "btn btn-secondary", style: "padding:4px 10px;font-size:0.8rem", form: { data: { turbo_confirm: "Rimuovere il ruolo staff dal tuo account?" } } %> <% else %> <%= button_to "Revoca", public_team_remove_member_path(@team, ut.user), method: :delete, class: "btn btn-secondary", style: "padding:4px 10px;font-size:0.8rem", form: { data: { turbo_confirm: "Revocare l'accesso a #{ut.user.name}?" } } %> <% end %>
<% else %>

Nessun membro staff. Usa i pulsanti sopra per il tuo account o <%= link_to "invita qualcuno", public_team_invite_path(@team) %>.

<% end %>

Staff in attesa

<% if @pending_invitations.any? %> <% @pending_invitations.each do |inv| %> <% end %>
EmailRuoloScade
<%= inv.email %> <%= inv.staff_kind == "regia" ? "Regia" : "Trasmissione" %> <%= l inv.expires_at, format: :short %> <%= button_to "Annulla", public_team_destroy_invitation_path(@team, inv), method: :delete, class: "btn btn-secondary", style: "padding:4px 10px;font-size:0.8rem" %>
<% else %>

Nessuna richiesta in sospeso.

<% end %>
<% if @entitlements.can_access_recordings? && @recordings.any? %>

Archivio gare

<% @recordings.each do |rec| %> <% end %>
PartitaReplay
<%= rec.stream_session.match.team.name %> vs <%= rec.stream_session.match.opponent_name %> <%= link_to "Guarda", rec.replay_url %>
<% end %>

Usa l'app mobile con le stesse credenziali per avviare partite e dirette.