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

@@ -1,5 +1,9 @@
<% record = local_assigns[:record] %>
<% show_inherit_hint = local_assigns[:show_inherit_hint] %>
<% param_key = record.model_name.param_key %>
<% primary = record.primary_color.presence || record.effective_primary_color %>
<% secondary = record.secondary_color.presence || record.effective_secondary_color %>
<% logo_src = record.effective_logo_url.presence %>
<fieldset class="branding-fields">
<legend><%= local_assigns[:legend] || "Identità visiva" %></legend>
@@ -8,26 +12,59 @@
<p class="branding-hint">Lascia vuoto per usare logo e colori della società.</p>
<% end %>
<%= label_tag "branding[logo_file]", "Logo (immagine)" %>
<%= file_field_tag "branding[logo_file]", accept: "image/png,image/jpeg,image/webp" %>
<% if record.effective_logo_url.present? %>
<p class="branding-preview">
<%= image_tag record.effective_logo_url, alt: "", width: 64, height: 64, style: "border-radius:8px" %>
</p>
<% end %>
<%= label_tag "#{record.model_name.param_key}[logo_url]", "Logo (URL alternativo)" %>
<%= text_field_tag "#{record.model_name.param_key}[logo_url]", record.logo_url, placeholder: "https://…" %>
<%= label_tag "#{record.model_name.param_key}[primary_color]", "Colore principale" %>
<div class="color-field">
<%= color_field_tag "#{record.model_name.param_key}[primary_color]", record.primary_color.presence || record.effective_primary_color %>
<span class="color-swatch" style="background:<%= record.effective_primary_color %>"></span>
<div class="branding-logo-block">
<%= label_tag "branding[logo_file]", "Logo (immagine)" %>
<div class="branding-logo-preview" data-branding-logo-preview>
<%= image_tag logo_src.presence || "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
alt: "Anteprima logo",
class: "branding-logo-preview__img",
data: { branding_logo_img: true },
width: 96,
height: 96,
hidden: logo_src.blank? %>
<span class="branding-logo-preview__placeholder" data-branding-logo-placeholder <%= "hidden" if logo_src.present? %>>
Nessun logo — scegli un file per lanteprima
</span>
</div>
<%= file_field_tag "branding[logo_file]", accept: "image/png,image/jpeg,image/webp", data: { branding_logo_file: true }, class: "branding-file-input" %>
</div>
<%= label_tag "#{record.model_name.param_key}[secondary_color]", "Colore secondario" %>
<div class="color-field">
<%= color_field_tag "#{record.model_name.param_key}[secondary_color]", record.secondary_color.presence || record.effective_secondary_color %>
<span class="color-swatch" style="background:<%= record.effective_secondary_color %>"></span>
<%= label_tag "#{param_key}[logo_url]", "Logo (URL alternativo)" %>
<%= text_field_tag "#{param_key}[logo_url]", record.logo_url, placeholder: "https://…", class: "branding-url-input" %>
<%= label_tag "#{param_key}[primary_color]", "Colore principale" %>
<div class="branding-color-row" data-branding-color-row="primary">
<%= color_field_tag "#{param_key}[primary_color]", primary, data: { color_picker: true }, class: "branding-color-picker", title: "Scegli colore" %>
<%= text_field_tag nil, primary, data: { color_hex: true }, class: "branding-hex-input", placeholder: "#e53935", autocomplete: "off", spellcheck: false %>
<span class="color-swatch branding-color-swatch" data-color-swatch aria-hidden="true"></span>
<div class="branding-color-presets" aria-label="Colori rapidi">
<% %w[#e53935 #1565c0 #2e7d32 #ff9800 #212121 #ffffff].each do |hex| %>
<button type="button" class="branding-preset" data-color-preset="<%= hex %>" style="background:<%= hex %>" title="<%= hex %>"></button>
<% end %>
</div>
</div>
<%= label_tag "#{param_key}[secondary_color]", "Colore secondario" %>
<div class="branding-color-row" data-branding-color-row="secondary">
<%= color_field_tag "#{param_key}[secondary_color]", secondary, data: { color_picker: true }, class: "branding-color-picker", title: "Scegli colore" %>
<%= text_field_tag nil, secondary, data: { color_hex: true }, class: "branding-hex-input", placeholder: "#ffffff", autocomplete: "off", spellcheck: false %>
<span class="color-swatch branding-color-swatch" data-color-swatch aria-hidden="true"></span>
<div class="branding-color-presets" aria-label="Colori rapidi">
<% %w[#ffffff #f5f5f5 #212121 #ffd54f #90caf9 #e53935].each do |hex| %>
<button type="button" class="branding-preset" data-color-preset="<%= hex %>" style="background:<%= hex %>" title="<%= hex %>"></button>
<% end %>
</div>
</div>
<div class="branding-live-preview" data-branding-live-preview>
<span class="branding-live-preview__label">Anteprima intestazione</span>
<div class="branding-live-preview__header" data-preview-header style="--preview-primary:<%= primary %>;--preview-secondary:<%= secondary %>">
<span class="branding-live-preview__logo" data-preview-logo>
<% if logo_src %>
<%= image_tag logo_src, alt: "", width: 40, height: 40, style: "border-radius:8px;object-fit:contain" %>
<% end %>
</span>
<span class="branding-live-preview__name"><%= record.try(:name).presence || "Nome società / squadra" %></span>
</div>
</div>
</fieldset>