<% content_for :title, "Modifica squadra — #{@team.name}" %> <% content_for :robots, "noindex, nofollow" %>

<%= @team.name %>

Società: <%= link_to @club.name, public_club_path(@club) %>

<%= form_with url: public_team_path(@team), method: :patch, multipart: true do %> <%= label_tag "team[name]", "Nome squadra" %> <%= text_field_tag "team[name]", @team.name, required: true %> <%= label_tag "team[sport]", "Sport" %> <%= select_tag "team[sport]", sport_catalog_options(@team.sport_key) %> <%= label_tag "team[description]", "Descrizione squadra" %> <%= text_area_tag "team[description]", @team.description, rows: 5, placeholder: "Presentazione della squadra, palmarès, obiettivi della stagione…" %>
<%= label_tag "team[photo_file]", "Foto di squadra (gruppo o stemma)" %> <% if @team.team_photo_url.present? %>
<%= image_tag @team.team_photo_url, alt: "Foto squadra", class: "team-profile-photo-preview", width: 200 %>
<% end %> <%= file_field_tag "team[photo_file]", accept: "image/png,image/jpeg,image/webp", class: "branding-file-input" %>
<%= render "shared/branding_fields", record: @team, show_inherit_hint: true, legend: "Branding squadra (override)" %> <%= label_tag "team[slug]", "Indirizzo pagina pubblica" %>

Genitori e tifosi trovano la squadra su <%= MatchLiveTv.app_public_url.chomp("/") %>/squadre/<%= @team.slug %>

<%= text_field_tag "team[slug]", @team.slug, pattern: "[a-z0-9]+(-[a-z0-9]+)*", title: "Solo lettere minuscole, numeri e trattini" %> <%= label_tag "team[roster_public]", class: "checkbox-label", style: "display:flex;align-items:center;gap:8px;margin-top:16px" do %> <%= hidden_field_tag "team[roster_public]", "0" %> <%= check_box_tag "team[roster_public]", "1", @team.roster_public?, id: "team_roster_public" %> Mostra l'organico sulla pagina pubblica <% end %>

Se attivo, giocatori e staff sono visibili a chiunque abbia il link. Puoi lasciarlo disattivato per privacy.

Colori società:

<%= submit_tag "Salva squadra", class: "btn btn-primary" %> <% end %>

<%= link_to "← Dettagli squadra", public_team_details_path(@team) %>