Files
MatchLiveTv/backend/app/views/public/teams/_streaming_staff.html.erb
T
eminuxandCursor b88f44ab1c Completa i18n IT/EN/FR/DE/ES su sito pubblico, area autenticata e admin.
Tutte le view marketing, legali, viewer, dashboard e admin usano t(); mailer utente-facing e flash localizzati; admin con LocaleResolver e selettore lingua.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 00:38:50 +02:00

117 lines
5.5 KiB
ERB

<% 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><%= t("team.streaming_staff.self_account_heading", email: current_user.email) %></h2>
<p class="muted">
<%= raw t("team.streaming_staff.self_account_hint") %>
</p>
<div class="team-details-actions">
<%= button_to t("team.streaming_staff.self_assign_submit"), public_team_assign_self_staff_path(team), method: :post, params: { staff_kind: "transmission" }, class: "btn btn-primary" %>
</div>
</div>
<% end %>
<% end %>
<h2><%= t("team.streaming_staff.staff_heading") %></h2>
<div class="card">
<% if staff_memberships.any? %>
<table class="data">
<thead><tr><th><%= t("team.streaming_staff.col_name") %></th><th><%= t("team.streaming_staff.col_email") %></th><th><%= t("team.streaming_staff.col_role") %></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"> <%= t("team.streaming_staff.you_suffix") %></span><% end %>
</td>
<td><%= ut.user.email %></td>
<td><%= t("team.streaming_staff.role_transmission") %></td>
<% if can_manage %>
<td>
<% if ut.user_id == current_user.id && team.club.owned_by?(current_user) %>
<%= button_to t("team.streaming_staff.clear_self_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: t("team.streaming_staff.clear_self_staff_confirm"), confirm_kind: "delete" } } %>
<% elsif ut.role == "member" %>
<%= button_to t("team.streaming_staff.revoke"), 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: t("team.streaming_staff.revoke_confirm", name: ut.user.name), confirm_kind: "delete" } } %>
<% end %>
</td>
<% end %>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p class="muted">
<%= t("team.streaming_staff.no_staff") %>
<% if can_manage %><%= link_to t("team.streaming_staff.invite_someone"), public_team_invite_path(team) %>.<% end %>
</p>
<% end %>
</div>
<% if can_manage %>
<h2><%= t("team.streaming_staff.pending_invitations_heading") %></h2>
<div class="card">
<% if pending_invitations.any? %>
<table class="data">
<thead><tr><th><%= t("team.streaming_staff.col_email_short") %></th><th><%= t("team.streaming_staff.col_expires") %></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 t("team.streaming_staff.cancel_invitation"), public_team_destroy_invitation_path(team, inv), method: :delete, class: "btn btn-secondary", style: "padding:4px 10px;font-size:0.8rem", form: { data: { confirm_kind: "delete" } } %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p class="muted"><%= t("team.streaming_staff.no_pending") %></p>
<% end %>
</div>
<% end %>
<% if entitlements.can_access_recordings? %>
<h2><%= t("team.streaming_staff.archive_heading") %></h2>
<div class="card">
<% if recordings.any? %>
<table class="data">
<thead><tr><th><%= t("team.streaming_staff.col_match") %></th><th><%= t("team.streaming_staff.col_date") %></th><th><%= t("team.streaming_staff.col_duration") %></th><th><%= t("team.streaming_staff.col_expiry") %></th><th><%= t("team.streaming_staff.col_status") %></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 t("team.streaming_staff.watch"), rec.replay_url, target: "_blank", rel: "noopener" %>
<% else %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<p style="margin-top:12px">
<%= link_to t("team.streaming_staff.manage_all_replays"), public_club_recordings_path(team.club) %>
</p>
<% else %>
<p class="muted"><%= t("team.streaming_staff.no_recordings") %></p>
<% end %>
</div>
<% end %>
</section>