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>
118 lines
4.8 KiB
Plaintext
118 lines
4.8 KiB
Plaintext
<% team = local_assigns[:team] %>
|
||
<% can_manage = local_assigns[:can_manage] %>
|
||
<% owner_membership = local_assigns[:owner_membership] %>
|
||
<% staff_memberships = local_assigns[:staff_memberships] %>
|
||
<% pending_invitations = local_assigns[:pending_invitations] %>
|
||
<% recordings = local_assigns[:recordings] %>
|
||
<% entitlements = local_assigns[:entitlements] %>
|
||
|
||
<section class="team-streaming-staff">
|
||
<% if can_manage %>
|
||
<% if owner_membership&.staff_kind.blank? %>
|
||
<div class="card team-streaming-staff__self">
|
||
<h2>Il tuo account (<%= current_user.email %>)</h2>
|
||
<p class="muted">
|
||
Puoi gestire la trasmissione dall’app. Per il punteggio da un altro telefono, condividi il
|
||
<strong>link regia</strong> durante la diretta (non serve un secondo account).
|
||
</p>
|
||
<div class="team-details-actions">
|
||
<%= button_to "Sono io — responsabile trasmissione", public_team_assign_self_staff_path(team), method: :post, params: { staff_kind: "transmission" }, class: "btn btn-primary" %>
|
||
</div>
|
||
</div>
|
||
<% end %>
|
||
<% end %>
|
||
|
||
<h2>Responsabili trasmissione (app)</h2>
|
||
<div class="card">
|
||
<% if staff_memberships.any? %>
|
||
<table class="data">
|
||
<thead><tr><th>Nome</th><th>Email</th><th>Ruolo</th><% if can_manage %><th></th><% end %></tr></thead>
|
||
<tbody>
|
||
<% staff_memberships.each do |ut| %>
|
||
<tr>
|
||
<td>
|
||
<%= ut.user.name %>
|
||
<% if ut.user_id == current_user.id %><span class="muted"> (tu)</span><% end %>
|
||
</td>
|
||
<td><%= ut.user.email %></td>
|
||
<td>Trasmissione</td>
|
||
<% if can_manage %>
|
||
<td>
|
||
<% if ut.user_id == current_user.id && team.club.owned_by?(current_user) %>
|
||
<%= 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?" } } %>
|
||
<% elsif ut.role == "member" %>
|
||
<%= 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 %>
|
||
</td>
|
||
<% end %>
|
||
</tr>
|
||
<% end %>
|
||
</tbody>
|
||
</table>
|
||
<% else %>
|
||
<p class="muted">
|
||
Nessun responsabile trasmissione.
|
||
<% if can_manage %><%= link_to "Invita qualcuno", public_team_invite_path(team) %>.<% end %>
|
||
</p>
|
||
<% end %>
|
||
</div>
|
||
|
||
<% if can_manage %>
|
||
<h2>Inviti in attesa</h2>
|
||
<div class="card">
|
||
<% if pending_invitations.any? %>
|
||
<table class="data">
|
||
<thead><tr><th>Email</th><th>Scade</th><th></th></tr></thead>
|
||
<tbody>
|
||
<% pending_invitations.each do |inv| %>
|
||
<tr>
|
||
<td><%= inv.email %></td>
|
||
<td><%= l inv.expires_at, format: :short %></td>
|
||
<td>
|
||
<%= button_to "Annulla", public_team_destroy_invitation_path(team, inv), method: :delete, class: "btn btn-secondary", style: "padding:4px 10px;font-size:0.8rem" %>
|
||
</td>
|
||
</tr>
|
||
<% end %>
|
||
</tbody>
|
||
</table>
|
||
<% else %>
|
||
<p class="muted">Nessuna richiesta in sospeso.</p>
|
||
<% end %>
|
||
</div>
|
||
<% end %>
|
||
|
||
<% if entitlements.can_access_recordings? %>
|
||
<h2>Archivio replay</h2>
|
||
<div class="card">
|
||
<% if recordings.any? %>
|
||
<table class="data">
|
||
<thead><tr><th>Partita</th><th>Data</th><th>Durata</th><th>Scadenza</th><th>Stato</th><th></th></tr></thead>
|
||
<tbody>
|
||
<% recordings.each do |rec| %>
|
||
<tr>
|
||
<td><%= rec.title_or_default %></td>
|
||
<td><%= l_local(rec.recorded_at_or_fallback) %></td>
|
||
<td><%= rec.duration_label %></td>
|
||
<td><%= rec.expires_at ? l_local(rec.expires_at) : "—" %></td>
|
||
<td><%= rec.status_label %></td>
|
||
<td>
|
||
<% if rec.replay_url %>
|
||
<%= link_to "Guarda", rec.replay_url, target: "_blank", rel: "noopener" %>
|
||
<% else %>
|
||
—
|
||
<% end %>
|
||
</td>
|
||
</tr>
|
||
<% end %>
|
||
</tbody>
|
||
</table>
|
||
<p style="margin-top:12px">
|
||
<%= link_to "Gestisci tutti i replay", public_club_recordings_path(team.club) %>
|
||
</p>
|
||
<% else %>
|
||
<p class="muted">Nessun replay ancora. Al termine delle dirette Premium le registrazioni compaiono qui.</p>
|
||
<% end %>
|
||
</div>
|
||
<% end %>
|
||
</section>
|