Billing Stripe, link regia mobile e staff solo trasmissione.

Aggiunge fatturazione club, pagina regia condivisibile senza account, roster squadre e rimuove la modalità controller dall'app (v1.1.0).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-29 07:23:13 +02:00
parent 4083bc5dee
commit f4b7be0f80
156 changed files with 5033 additions and 2033 deletions

View File

@@ -3,44 +3,12 @@
<div class="wrap" style="padding-top:20px">
<h1>Abbonamento</h1>
<p>Società: <strong><%= @club.name %></strong> · Piano attuale: <strong><%= @entitlements.plan.name %></strong> (valido per tutte le squadre)</p>
<%= render "shared/club_subscription_status", club: @club, entitlements: @entitlements, subscription: @subscription %>
<div class="plans">
<% @plans.each do |plan| %>
<div class="plan-card <%= 'featured' if plan.slug == @entitlements.plan.slug %>">
<h3><%= plan.name %></h3>
<% if plan.slug == "free" %>
<div class="plan-price">€0</div>
<% elsif plan.slug == "premium_light" %>
<div class="plan-price" style="color:#e53935">€40/anno</div>
<p style="color:#888;font-size:0.85rem">oppure €5/mese</p>
<% else %>
<div class="plan-price">€200/anno</div>
<p style="color:#888;font-size:0.85rem">oppure €20/mese</p>
<% end %>
<ul>
<li>Staff trasmissione: <%= plan.max_staff_transmission || "illimitato" %> / anno per squadra</li>
<li>Staff regia: <%= plan.max_staff_regia || "illimitato" %> / anno per squadra</li>
<li>Partite: <%= plan.concurrent_streams_limit || "illimitate" %> in contemporanea (tutta la società)</li>
<li>Replay: <%= plan.recordings_enabled? ? "#{plan.recording_days} giorni" : "no" %></li>
<li>YouTube: <% if plan.slug == "premium_light" %>Match TV Light<% elsif plan.youtube_enabled? %>canale società<% else %>no<% end %></li>
</ul>
<% if plan.slug == @entitlements.plan.slug %>
<span class="btn btn-secondary" style="opacity:0.7">Piano attuale</span>
<% elsif plan.slug == "free" %>
<p style="color:#888;font-size:0.85rem">Contatta il supporto per downgrade.</p>
<% elsif MatchLiveTv.stripe_enabled? %>
<%= link_to "Attiva #{plan.name}", public_club_checkout_path(@club, plan: plan.slug), class: "btn btn-primary" %>
<% else %>
<p style="color:#888">Stripe non configurato</p>
<% end %>
</div>
<% end %>
</div>
<%= render "shared/stripe_secure_payment" %>
<%= render "shared/plan_cards", show_stripe_portal: true %>
<% if @entitlements.premium_active? && MatchLiveTv.stripe_enabled? %>
<p style="margin-top:20px"><%= button_to "Gestisci su Stripe", public_club_portal_path(@club), class: "btn btn-secondary" %></p>
<% end %>
<%= render "shared/billing_documents", club: @club, payments: @payments, invoices: @invoices %>
<p><%= link_to "← Società", public_club_path(@club) %></p>
<p style="margin-top:24px"><%= link_to "← Società", public_club_path(@club) %></p>
</div>

View File

@@ -10,6 +10,7 @@
<%= label_tag "club[sport]", "Sport principale" %>
<%= select_tag "club[sport]", options_for_select([["Pallavolo", "volleyball"], ["Calcio", "football"], ["Basket", "basketball"]], @club.sport) %>
<%= render "shared/branding_fields", record: @club, legend: "Logo e colori societari" %>
<%= render "shared/billing_profile_fields", record: @club %>
<%= submit_tag "Salva", class: "btn btn-primary" %>
<% end %>
</div>

View File

@@ -13,6 +13,7 @@
<%= label_tag "club[sport]", "Sport principale" %>
<%= select_tag "club[sport]", options_for_select([["Pallavolo", "volleyball"], ["Calcio", "football"], ["Basket", "basketball"]], params.dig(:club, :sport) || "volleyball") %>
<%= render "shared/branding_fields", record: Club.new(primary_color: "#e53935", secondary_color: "#ffffff"), legend: "Logo e colori societari" %>
<%= render "shared/billing_profile_fields", record: Club.new(billing_country: "IT") %>
<h2 class="form-section-title" style="margin-top:24px">Prima squadra</h2>
<%= label_tag "first_team[name]", "Nome squadra" %>
@@ -20,10 +21,11 @@
<%= label_tag :plan, "Piano iniziale (per tutta la società)" %>
<%= select_tag :plan, options_for_select([
["Free — 1 staff trasmissione + 1 regia per squadra, 1 live", "free"],
["Free — 1 responsabile trasmissione per squadra, 1 live", "free"],
["Premium Light — €40/anno o €5/mese", "premium_light"],
["Premium Full — €200/anno o €20/mese", "premium_full"]
], params[:plan] || "free") %>
<%= render "shared/stripe_secure_payment", compact: true %>
<%= submit_tag "Crea società", class: "btn btn-primary" %>
<% end %>
</div>

View File

@@ -21,7 +21,7 @@
<%= link_to "Modifica società", public_edit_club_path(@club), class: "btn btn-secondary" %>
<%= link_to "Abbonamento", public_club_billing_path(@club), class: "btn btn-primary" %>
<%= link_to "Nuova squadra", public_new_club_team_path(@club), class: "btn btn-secondary" %>
<%= link_to "Dirette live", public_live_index_path, class: "btn btn-secondary" %>
<%= link_to "Dirette live", public_live_index_path(club_id: @club.id), class: "btn btn-secondary" %>
</div>
<h2>Squadre</h2>
@@ -44,7 +44,9 @@
<% end %>
</td>
<td style="white-space:nowrap">
<%= link_to "Dashboard", public_team_dashboard_path(team) %>
<%= link_to "Dettagli", public_team_details_path(team) %>
·
<%= link_to "Partite", public_team_matches_path(team) %>
·
<%= link_to "Modifica", public_edit_team_path(team) %>
</td>
@@ -57,5 +59,5 @@
<% end %>
</div>
<p style="color:#888;margin-top:24px">Ogni squadra ha il proprio staff trasmissione/regia. Labbonamento vale per tutta la società.</p>
<p style="color:#888;margin-top:24px">Ogni squadra ha i propri responsabili trasmissione. Il punteggio da un altro telefono usa il link regia (senza account). Labbonamento vale per tutta la società.</p>
</div>