Files
MatchLiveTv/backend/app/views/public/teams/details.html.erb
T
eminuxandCursor db8b14ba4e Snellisci l'invito a trasmettere e invia l'email automatica.
Il form invito è sulla pagina squadra, genera il link e manda la mail; in caso di errore SMTP resta la copia manuale.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-15 20:02:25 +02:00

109 lines
5.5 KiB
ERB

<% content_for :title, t("team.details.title", name: @team.name) %>
<% content_for :meta_description, t("team.details.meta_description", name: @team.name) %>
<% content_for :robots, "noindex, nofollow" %>
<% total_people = @roster_by_category.values.sum(&:size) %>
<div class="wrap team-roster-page">
<nav class="team-dashboard-nav" aria-label="<%= t('team.details.nav_aria') %>">
<% if @can_manage %>
<%= link_to "← #{@club.name}", public_club_path(@club), class: "team-dashboard-nav__club" %>
<span class="team-dashboard-nav__sep">·</span>
<%= link_to t("team.details.edit_team"), public_edit_team_path(@team) %>
<% else %>
<span class="team-dashboard-nav__club"><%= @club.name %></span>
<% end %>
</nav>
<header class="roster-hero card">
<div class="roster-hero__intro">
<p class="roster-hero__club"><%= @club.name %></p>
<h1 class="roster-hero__title"><%= @team.name %></h1>
<p class="team-details-meta">
<%= t("team.details.plan_label") %> <strong><%= @entitlements.plan.name %></strong> <%= t("team.details.plan_scope_club") %>
· <%= t("team.details.staff_label") %> <strong><%= @entitlements.staff_count_for("transmission") %> / <%= @entitlements.max_staff_transmission || "∞" %></strong>
· <%= t("team.details.active_matches_label") %> <strong><%= @entitlements.concurrent_streams_used %><% if @entitlements.concurrent_streams_limit %> / <%= @entitlements.concurrent_streams_limit %><% else %> (<%= t("team.details.unlimited") %>)<% end %></strong>
</p>
<% if @team.description.present? %>
<div class="roster-hero__desc"><%= simple_format @team.description %></div>
<% elsif @can_manage %>
<p class="roster-hero__desc roster-hero__desc--muted">
<%= t("team.details.no_description") %>
<%= link_to t("team.details.add_description_link"), public_edit_team_path(@team) %>.
</p>
<% end %>
<div class="roster-stats">
<span class="roster-stat"><strong><%= total_people %></strong> <%= t("team.details.roster_count_label") %></span>
<% TeamRosterMember::DISPLAY_ORDER.each do |cat| %>
<% count = @roster_by_category[cat].size %>
<% next if count.zero? %>
<span class="roster-stat"><%= count %> <%= TeamRosterMember.category_label(cat).downcase %></span>
<% end %>
</div>
</div>
<div class="roster-hero__media">
<% if @team.team_photo_url.present? %>
<%= image_tag @team.team_photo_url, alt: @team.name, class: "roster-hero__photo" %>
<% elsif @can_manage %>
<div class="roster-hero__photo roster-hero__photo--empty">
<span><%= t("team.details.no_photo") %></span>
<%= link_to t("team.details.add_photo_link"), public_edit_team_path(@team), class: "btn btn-secondary", style: "margin-top:8px;padding:8px 14px;font-size:0.85rem" %>
</div>
<% end %>
</div>
</header>
<div class="team-details-actions">
<% if @can_manage %>
<%= link_to t("club.back_to_club"), public_club_path(@club), class: "btn btn-secondary" %>
<%= link_to t("team.details.public_page"), public_team_page_path(@team.slug), class: "btn btn-secondary", target: "_blank", rel: "noopener" %>
<%= link_to t("team.details.streaming_managers"), "#responsabili-trasmissione", class: "btn btn-secondary" %>
<% end %>
<% if current_user.can_stream_for?(@team) %>
<%= link_to t("team.details.schedule_matches"), public_team_matches_path(@team), class: "btn btn-primary" %>
<% end %>
<%= link_to t("team.details.live_streams"), public_live_index_path(club_id: @club.id), class: "btn btn-secondary" %>
</div>
<div class="roster-layout<%= " roster-layout--readonly" unless @can_manage %>">
<section class="roster-main" aria-label="Organico">
<% TeamRosterMember::DISPLAY_ORDER.each do |category| %>
<% members = @roster_by_category[category] %>
<section class="roster-section card">
<header class="roster-section__head">
<h2 class="roster-section__title"><%= TeamRosterMember.category_label(category) %></h2>
<span class="roster-section__count"><%= members.size %></span>
</header>
<% if members.any? %>
<div class="roster-list">
<% members.each do |person| %>
<%= render "shared/roster_person_card", person: person, team: @team, editable: @can_manage %>
<% end %>
</div>
<% else %>
<p class="roster-section__empty"><%= t("team.details.no_people_in_category") %></p>
<% end %>
</section>
<% end %>
</section>
<% if @can_manage %>
<aside class="roster-sidebar" aria-label="<%= t('roster.member_form.new_heading') %>">
<%= render "shared/roster_member_form", member: @roster_member, team: @team %>
</aside>
<% end %>
</div>
<% if @can_manage && @entitlements.premium_full? && @entitlements.youtube_enabled? %>
<p class="muted" style="margin:16px 0">
<%= raw t("team.details.youtube_hint_html", club_link: link_to(@club.name, public_club_path(@club))) %>
</p>
<% end %>
<%= render "public/teams/streaming_staff", team: @team, club: @club, can_manage: @can_manage,
entitlements: @entitlements, owner_membership: @owner_membership,
staff_memberships: @staff_memberships, pending_invitations: @pending_invitations,
recordings: @recordings %>
<p class="team-details-footer"><%= t("team.details.footer_note") %></p>
</div>