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>
This commit is contained in:
2026-07-24 00:38:50 +02:00
co-authored by Cursor
parent fb7068f86c
commit b88f44ab1c
158 changed files with 9444 additions and 1536 deletions
@@ -1,43 +1,43 @@
<%# locals: (club:, subscription:, return_to: nil) %>
<section class="admin-comped-card" style="margin-bottom:24px;padding:16px;border:1px solid #3d3520;border-radius:8px;background:#2a2618">
<h2 style="margin:0 0 8px;font-size:1.1rem">Abbonamento omaggio</h2>
<h2 style="margin:0 0 8px;font-size:1.1rem"><%= t("admin.comped.title") %></h2>
<p style="color:#bbb;font-size:0.9rem;margin:0 0 14px">
Sponsor o promozione: assegna Premium Light/Full senza pagamento Stripe. Revocabile in qualsiasi momento.
<%= t("admin.comped.description") %>
</p>
<% sub = subscription %>
<% if sub&.admin_comped? %>
<p style="margin:0 0 12px">
<strong>Attivo:</strong> <%= sub.plan.name %>
<strong><%= t("admin.comped.active_label") %></strong> <%= sub.plan.name %>
<% if sub.admin_comped_reason.present? %>
· <%= sub.admin_comped_reason %>
<% end %>
<% if sub.admin_comped_at.present? %>
<br><span style="color:#888;font-size:0.85rem">Dal <%= l(sub.admin_comped_at, format: :long) %>
<% if sub.admin_comped_by.present? %> · admin <%= sub.admin_comped_by.username %><% end %>
<br><span style="color:#888;font-size:0.85rem"><%= t("admin.comped.since_label_html", date: l(sub.admin_comped_at, format: :long)) %>
<% if sub.admin_comped_by.present? %> <%= t("admin.comped.by_admin", username: sub.admin_comped_by.username) %><% end %>
</span>
<% end %>
<% if sub.stripe_subscription_id.present? %>
<br><span style="color:#888;font-size:0.85rem">Nota: esiste anche un abbonamento Stripe collegato; lomaggio ha priorità sul piano.</span>
<br><span style="color:#888;font-size:0.85rem"><%= t("admin.comped.stripe_note") %></span>
<% end %>
</p>
<%= button_to "Revoca omaggio (torna Free o ripristina Stripe)",
<%= button_to t("admin.comped.revoke_button"),
revoke_comped_admin_club_path(club, return_to: return_to),
method: :delete,
class: "admin-btn admin-btn--secondary",
form: { data: { turbo_confirm: "Revocare labbonamento omaggio per #{club.name}?" } } %>
form: { data: { turbo_confirm: t("admin.comped.revoke_confirm", club: club.name) } } %>
<% else %>
<p style="margin:0 0 12px;color:#888">
Piano attuale: <strong><%= sub&.plan&.name || "Free" %></strong>
<%= t("admin.comped.current_plan", plan: sub&.plan&.name || t("admin.common.free_plan")) %>
<% if sub&.stripe_subscription_id.present? %>
· pagamento Stripe attivo
<%= t("admin.comped.stripe_active") %>
<% end %>
</p>
<%= form_with url: grant_comped_admin_club_path(club), method: :post, local: true, class: "admin-comped-form" do %>
<%= hidden_field_tag :return_to, return_to if return_to.present? %>
<div style="display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end">
<label style="display:flex;flex-direction:column;gap:4px;font-size:0.85rem">
Piano
<%= t("admin.comped.plan_label") %>
<%= select_tag :plan_slug,
options_for_select(
[["Premium Light", "premium_light"], ["Premium Full", "premium_full"]]
@@ -46,10 +46,10 @@
class: "admin-input" %>
</label>
<label style="display:flex;flex-direction:column;gap:4px;font-size:0.85rem;flex:1;min-width:200px">
Motivo (es. sponsor 2026)
<%= text_field_tag :reason, nil, placeholder: "Sponsor, promozione…", class: "admin-input", style: "width:100%" %>
<%= t("admin.comped.reason_label") %>
<%= text_field_tag :reason, nil, placeholder: t("admin.comped.reason_placeholder"), class: "admin-input", style: "width:100%" %>
</label>
<%= submit_tag "Concedi omaggio", class: "admin-btn admin-btn--primary" %>
<%= submit_tag t("admin.comped.grant_button"), class: "admin-btn admin-btn--primary" %>
</div>
<% end %>
<% end %>
+13 -14
View File
@@ -1,17 +1,16 @@
<h2>Società e squadre</h2>
<h2><%= t("admin.clubs.index.title") %></h2>
<p style="color:#888;margin-bottom:16px">
Abbonamenti omaggio (sponsor / promozioni) e stato YouTube per squadra.
Pagamenti Stripe: <%= link_to "Fatturazione", admin_billing_path %>.
<%= t("admin.clubs.index.subtitle_html", billing_link: link_to(t("admin.clubs.index.billing_link"), admin_billing_path)) %>
</p>
<table class="admin-table">
<thead>
<tr>
<th>Società</th>
<th>Piano</th>
<th>Squadre</th>
<th>Omaggio</th>
<th>Stripe</th>
<th><%= t("admin.clubs.index.table.club") %></th>
<th><%= t("admin.clubs.index.table.plan") %></th>
<th><%= t("admin.clubs.index.table.teams") %></th>
<th><%= t("admin.clubs.index.table.comped") %></th>
<th><%= t("admin.clubs.index.table.stripe") %></th>
<th></th>
</tr>
</thead>
@@ -20,20 +19,20 @@
<% sub = club.subscription %>
<tr>
<td><strong><%= club.name %></strong></td>
<td><%= sub&.plan&.name || "Free" %></td>
<td><%= sub&.plan&.name || t("admin.common.free_plan") %></td>
<td><%= club.teams.size %></td>
<td>
<% if sub&.admin_comped? %>
<span style="color:#ffb74d"></span>
<span style="color:#ffb74d"><%= t("admin.common.yes") %></span>
<% if sub.admin_comped_reason.present? %> · <%= sub.admin_comped_reason %><% end %>
<% else %>
<%= t("admin.common.dash") %>
<% end %>
</td>
<td><%= sub&.stripe_subscription_id.present? ? "Sì" : "—" %></td>
<td><%= sub&.stripe_subscription_id.present? ? t("admin.common.yes") : t("admin.common.dash") %></td>
<td>
<%= link_to "Gestisci", admin_club_path(club) %>
· <%= link_to "Fatture", admin_billing_path(club_id: club.id) %>
<%= link_to t("admin.clubs.index.manage"), admin_club_path(club) %>
· <%= link_to t("admin.clubs.index.invoices"), admin_billing_path(club_id: club.id) %>
</td>
</tr>
<% end %>
+14 -14
View File
@@ -1,36 +1,36 @@
<p style="margin-bottom:16px"><%= link_to "← Società e squadre", admin_clubs_path %></p>
<p style="margin-bottom:16px"><%= link_to t("admin.clubs.show.back"), admin_clubs_path %></p>
<h2><%= @club.name %></h2>
<p style="color:#888">
Sport: <%= @club.sport %>
· <%= link_to "Archivio replay", admin_club_recordings_path(@club) %>
· <%= link_to "Pagamenti e fatture", admin_billing_path(club_id: @club.id) %>
· <%= link_to "Canale YouTube piattaforma", admin_youtube_platform_path %>
<%= t("admin.clubs.show.sport_label", sport: @club.sport) %>
· <%= link_to t("admin.clubs.show.recordings_archive"), admin_club_recordings_path(@club) %>
· <%= link_to t("admin.clubs.show.billing_link"), admin_billing_path(club_id: @club.id) %>
· <%= link_to t("admin.clubs.show.youtube_platform_link"), admin_youtube_platform_path %>
</p>
<%= render "admin/clubs/comped_form", club: @club, subscription: @subscription, return_to: admin_club_path(@club) %>
<% cred = @club.youtube_credential %>
<p style="margin-top:16px">
<strong>YouTube società:</strong>
<strong><%= t("admin.clubs.show.youtube_club_label") %></strong>
<% if cred %>
<%= cred.channel_title.presence || cred.channel_id %> (collegato)
<%= cred.channel_title.presence || cred.channel_id %> <%= t("admin.clubs.show.youtube_connected") %>
<% elsif @teams.any? { |t| t.entitlements.premium_full? } %>
<span class="muted">Premium Full — canale società non collegato (usa Match Live TV)</span>
<span class="muted"><%= t("admin.clubs.show.youtube_premium_full_not_connected") %></span>
<% else %>
<span class="muted"></span>
<span class="muted"><%= t("admin.common.dash") %></span>
<% end %>
</p>
<h3 style="font-size:1rem;margin-top:28px">Squadre</h3>
<h3 style="font-size:1rem;margin-top:28px"><%= t("admin.clubs.show.teams_title") %></h3>
<% if @teams.empty? %>
<p class="muted">Nessuna squadra registrata.</p>
<p class="muted"><%= t("admin.clubs.show.no_teams") %></p>
<% else %>
<table class="admin-table">
<thead>
<tr>
<th>Squadra</th>
<th>Sport</th>
<th><%= t("admin.clubs.show.table.team") %></th>
<th><%= t("admin.clubs.show.table.sport") %></th>
<th></th>
</tr>
</thead>
@@ -39,7 +39,7 @@
<tr>
<td><strong><%= team.name %></strong></td>
<td><%= team.sport %></td>
<td><%= link_to "Partite e dettagli", admin_team_path(team) %> · <%= link_to "Replay", admin_club_recordings_path(@club, team_id: team.id) %></td>
<td><%= link_to t("admin.clubs.show.matches_and_details"), admin_team_path(team) %> · <%= link_to t("admin.clubs.show.replay"), admin_club_recordings_path(@club, team_id: team.id) %></td>
</tr>
<% end %>
</tbody>