Files
MatchLiveTv/backend/app/views/shared/_branding_fields.html.erb
Emiliano Frascaro f4b7be0f80 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>
2026-05-29 07:23:13 +02:00

71 lines
4.0 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<% 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>
<% if show_inherit_hint %>
<p class="branding-hint">Lascia vuoto per usare logo e colori della società.</p>
<% end %>
<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 "#{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>