Aggiunge annunci in-app/sito, contatti e migliora UI copertina sul portale.

Include admin/API/banner nativi, form contatti e reset copertina standard con layout edit più ampio.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-20 15:30:49 +02:00
co-authored by Cursor
parent e502844b88
commit 5b723bf844
81 changed files with 2177 additions and 38 deletions
@@ -0,0 +1,69 @@
module Admin
class AnnouncementsController < Admin::BaseController
before_action :set_announcement, only: %i[edit update destroy]
def index
@announcements = AppAnnouncement.newest
end
def new
@announcement = AppAnnouncement.new(
kind: "info",
severity: "info",
status: "draft",
show_on_app: true,
show_on_web_public: true,
show_on_web_private: true,
dismissible: true
)
end
def create
@announcement = AppAnnouncement.new(announcement_params)
@announcement.created_by_admin = current_admin_account
if @announcement.save
redirect_to admin_announcements_path, notice: t("admin.flash.announcement_created")
else
flash.now[:alert] = @announcement.errors.full_messages.join(", ")
render :new, status: :unprocessable_entity
end
end
def edit; end
def update
if @announcement.update(announcement_params)
redirect_to admin_announcements_path, notice: t("admin.flash.announcement_updated")
else
flash.now[:alert] = @announcement.errors.full_messages.join(", ")
render :edit, status: :unprocessable_entity
end
end
def destroy
@announcement.destroy!
redirect_to admin_announcements_path, notice: t("admin.flash.announcement_destroyed")
end
private
def set_announcement
@announcement = AppAnnouncement.find(params[:id])
end
def announcement_params
params.require(:app_announcement).permit(
:kind, :severity, :status, :title, :body,
:action_url, :action_label, :dismissible, :starts_at, :ends_at,
:show_on_app, :show_on_web_public, :show_on_web_private
).tap do |permitted|
%i[dismissible show_on_app show_on_web_public show_on_web_private].each do |key|
permitted[key] = ActiveModel::Type::Boolean.new.cast(permitted[key])
end
%i[starts_at ends_at action_url action_label].each do |key|
permitted[key] = nil if permitted[key].blank?
end
end
end
end
end
@@ -0,0 +1,13 @@
module Api
module V1
class AnnouncementsController < BaseController
skip_before_action :authenticate_request!
def index
platform = params[:platform].to_s.presence
announcements = AppAnnouncement.for_app.newest
render json: announcements.map { |item| item.as_api_json(platform: platform) }
end
end
end
end
@@ -0,0 +1,46 @@
module Public
class ContactsController < WebBaseController
def show
@inquiry = empty_inquiry
end
def create
result = Contacts::SubmitInquiry.call(params: inquiry_params, ip: request.remote_ip)
if result.ok?
redirect_to public_contatti_path, notice: t("flash.contacts.sent")
return
end
@inquiry = inquiry_params
flash.now[:alert] = t("flash.contacts.#{result.error}")
render :show, status: result.error == :throttled ? :too_many_requests : :unprocessable_entity
end
private
def inquiry_params
{
name: params[:name].to_s,
email: params[:email].to_s,
club_name: params[:club_name].to_s,
topic: params[:topic].to_s,
message: params[:message].to_s,
website: params[:website].to_s,
accept_privacy: params[:accept_privacy].to_s
}
end
def empty_inquiry
{
name: "",
email: "",
club_name: "",
topic: "commercial",
message: "",
website: "",
accept_privacy: ""
}
end
end
end
@@ -9,6 +9,7 @@ module Public
protect_from_forgery with: :exception
before_action :set_site_locale
before_action :load_site_announcements
private
@@ -40,5 +41,27 @@ module Public
def logged_in?
current_user.present?
end
PRIVATE_WEB_CONTROLLERS = %w[
accounts clubs teams club_recordings club_billing
club_matches matches team_roster_members
].freeze
def load_site_announcements
@site_announcements = if skip_site_announcements?
AppAnnouncement.none
else
channel = private_web_area? ? :web_private : :web_public
AppAnnouncement.for_channel(channel).newest
end
end
def skip_site_announcements?
controller_name == "regia"
end
def private_web_area?
PRIVATE_WEB_CONTROLLERS.include?(controller_name)
end
end
end
@@ -8,6 +8,7 @@ module Public
{ loc: "#{base}/prezzi", changefreq: "monthly", priority: "0.9" },
{ loc: "#{base}/pallavolo-giovanile", changefreq: "monthly", priority: "0.85" },
{ loc: "#{base}/faq", changefreq: "monthly", priority: "0.8" },
{ loc: "#{base}/contatti", changefreq: "monthly", priority: "0.6" },
{ loc: "#{base}/live", changefreq: "hourly", priority: "0.85" },
{ loc: "#{base}/squadre", changefreq: "daily", priority: "0.85" },
{ loc: "#{base}/privacy", changefreq: "yearly", priority: "0.3" },
+27
View File
@@ -37,4 +37,31 @@ module AdminHelper
rescue ArgumentError, TypeError
nil
end
def announcement_status_badge(item)
case item.status
when "published" then item.severity == "critical" ? "live" : "ready"
when "archived" then "paused"
else "connecting"
end
end
def announcement_window_label(item)
start_label = item.starts_at&.in_time_zone&.strftime("%d/%m %H:%M")
end_label = item.ends_at&.in_time_zone&.strftime("%d/%m %H:%M")
if start_label && end_label
"#{start_label}#{end_label}"
elsif start_label
I18n.t("admin.announcements.window.from", time: start_label)
elsif end_label
I18n.t("admin.announcements.window.until", time: end_label)
else
I18n.t("admin.announcements.window.always")
end
end
def announcement_channels_label(item)
labels = item.selected_channels.map { |key| I18n.t("admin.announcements.channels.#{key}") }
labels.presence&.join(" · ") || I18n.t("admin.common.dash")
end
end
+1 -1
View File
@@ -1,6 +1,6 @@
module LegalHelper
def legal_last_updated
"3 giugno 2026"
"20 agosto 2026"
end
def cookie_policy_last_updated
+25
View File
@@ -0,0 +1,25 @@
class ContactMailer < ApplicationMailer
def inquiry(name:, email:, club_name:, topic:, message:)
@name = name
@email = email
@club_name = club_name.presence
@topic = topic
@message = message
mail(
to: recipient_for(topic),
reply_to: email,
subject: t("mailers.contact.subject.#{topic}", name: name)
)
end
private
def recipient_for(topic)
if topic == "privacy"
MatchLiveTv.privacy_controller_email
else
MatchLiveTv.support_email
end
end
end
+1
View File
@@ -2,6 +2,7 @@ class AdminAccount < ApplicationRecord
include PasswordComplexity
has_secure_password
has_many :app_announcements, foreign_key: :created_by_admin_id, dependent: :nullify, inverse_of: :created_by_admin
validates :username, presence: true, uniqueness: true
end
+93
View File
@@ -0,0 +1,93 @@
class AppAnnouncement < ApplicationRecord
KINDS = %w[info maintenance update].freeze
SEVERITIES = %w[info warning critical].freeze
STATUSES = %w[draft published archived].freeze
CHANNELS = {
app: :show_on_app,
web_public: :show_on_web_public,
web_private: :show_on_web_private
}.freeze
belongs_to :created_by_admin, class_name: "AdminAccount", optional: true
validates :kind, :severity, :status, :title, :body, presence: true
validates :kind, inclusion: { in: KINDS }
validates :severity, inclusion: { in: SEVERITIES }
validates :status, inclusion: { in: STATUSES }
validates :title, length: { maximum: 120 }
validates :body, length: { maximum: 2000 }
validates :action_label, length: { maximum: 40 }, allow_blank: true
validates :action_url, format: { with: /\Ahttps?:\/\/.+/i, allow_blank: true }
validate :ends_at_after_starts_at
validate :at_least_one_channel
scope :newest, -> { order(created_at: :desc) }
scope :published, -> { where(status: "published") }
scope :active_now, lambda {
now = Time.current
published
.where("starts_at IS NULL OR starts_at <= ?", now)
.where("ends_at IS NULL OR ends_at > ?", now)
}
def self.for_channel(channel)
column = CHANNELS[channel.to_sym]
raise ArgumentError, "unknown announcement channel: #{channel}" if column.blank?
active_now.where(column => true)
end
def self.for_app
for_channel(:app)
end
def published?
status == "published"
end
def selected_channels
CHANNELS.each_with_object([]) do |(key, column), keys|
keys << key if public_send(column)
end
end
def as_api_json(platform: nil)
{
id: id,
kind: kind,
severity: severity,
title: title,
body: body,
dismissible: dismissible,
action_url: resolved_action_url(platform),
action_label: action_label.presence,
starts_at: starts_at&.iso8601,
ends_at: ends_at&.iso8601
}
end
def resolved_action_url(platform)
return action_url if action_url.present?
return nil unless kind == "update"
case platform.to_s
when "android" then MatchLiveTv.play_store_url
when "ios" then MatchLiveTv.app_store_url
end
end
private
def at_least_one_channel
return if show_on_app? || show_on_web_public? || show_on_web_private?
errors.add(:base, :no_channel)
end
def ends_at_after_starts_at
return if starts_at.blank? || ends_at.blank?
return if ends_at > starts_at
errors.add(:ends_at, :invalid)
end
end
@@ -0,0 +1,102 @@
module Contacts
class SubmitInquiry
TOPICS = %w[commercial support privacy].freeze
LIMIT = 5
WINDOW = 1.hour
NAME_MAX = 120
CLUB_MAX = 160
MESSAGE_MIN = 10
MESSAGE_MAX = 4_000
Result = Struct.new(:ok, :error, keyword_init: true)
def self.call(params:, ip:)
new(params: params, ip: ip).call
end
def initialize(params:, ip:)
@params = params
@ip = ip.to_s.presence || "unknown"
end
def call
if honeypot_filled?
record_attempt
return Result.new(ok: true, error: nil)
end
return Result.new(ok: false, error: :throttled) if throttled?
error = validate
return Result.new(ok: false, error: error) if error
record_attempt
deliver
Result.new(ok: true, error: nil)
end
private
def honeypot_filled?
@params[:website].to_s.strip.present?
end
def throttled?
current_count >= LIMIT
end
def validate
return :privacy_required unless @params[:accept_privacy].to_s == "1"
return :invalid if name.blank? || name.length > NAME_MAX
return :invalid_email if email.blank? || email !~ URI::MailTo::EMAIL_REGEXP
return :invalid if club_name.length > CLUB_MAX
return :invalid unless TOPICS.include?(topic)
return :invalid_message if message.length < MESSAGE_MIN || message.length > MESSAGE_MAX
nil
end
def deliver
mail = ContactMailer.inquiry(
name: name,
email: email,
club_name: club_name,
topic: topic,
message: message
)
MatchLiveTv.deliver_mail(mail)
end
def record_attempt
Rails.cache.write(cache_key, current_count + 1, expires_in: WINDOW, raw: true)
end
def current_count
Rails.cache.read(cache_key, raw: true).to_i
end
def cache_key
"contacts:inquiry:#{@ip}"
end
def name
@params[:name].to_s.strip
end
def email
@params[:email].to_s.strip.downcase
end
def club_name
@params[:club_name].to_s.strip
end
def topic
@params[:topic].to_s.strip
end
def message
@params[:message].to_s.strip
end
end
end
@@ -0,0 +1,79 @@
<%= form_with model: announcement, url: (announcement.persisted? ? admin_announcement_path(announcement) : admin_announcements_path),
method: (announcement.persisted? ? :patch : :post), local: true, class: "admin-form" do |f| %>
<div class="admin-form-row">
<div>
<%= f.label :kind, t("admin.announcements.form.kind") %>
<%= f.select :kind, AppAnnouncement::KINDS.map { |k| [t("admin.announcements.kind.#{k}"), k] } %>
</div>
<div>
<%= f.label :severity, t("admin.announcements.form.severity") %>
<%= f.select :severity, AppAnnouncement::SEVERITIES.map { |k| [t("admin.announcements.severity.#{k}"), k] } %>
</div>
</div>
<div>
<%= f.label :status, t("admin.announcements.form.status") %>
<%= f.select :status, AppAnnouncement::STATUSES.map { |k| [t("admin.announcements.status.#{k}"), k] } %>
</div>
<fieldset class="admin-channels">
<legend><%= t("admin.announcements.form.channels") %></legend>
<label class="admin-checkbox">
<%= f.check_box :show_on_app %>
<span><%= t("admin.announcements.channels.app") %></span>
</label>
<label class="admin-checkbox">
<%= f.check_box :show_on_web_public %>
<span><%= t("admin.announcements.channels.web_public") %></span>
</label>
<label class="admin-checkbox">
<%= f.check_box :show_on_web_private %>
<span><%= t("admin.announcements.channels.web_private") %></span>
</label>
<p class="muted admin-form-hint"><%= t("admin.announcements.form.channels_hint") %></p>
</fieldset>
<div>
<%= f.label :title, t("admin.announcements.form.title") %>
<%= f.text_field :title, required: true, maxlength: 120 %>
</div>
<div>
<%= f.label :body, t("admin.announcements.form.body") %>
<%= f.text_area :body, required: true, rows: 5, maxlength: 2000 %>
</div>
<div class="admin-form-row">
<div>
<%= f.label :starts_at, t("admin.announcements.form.starts_at") %>
<%= f.datetime_field :starts_at, value: announcement.starts_at&.in_time_zone&.strftime("%Y-%m-%dT%H:%M") %>
</div>
<div>
<%= f.label :ends_at, t("admin.announcements.form.ends_at") %>
<%= f.datetime_field :ends_at, value: announcement.ends_at&.in_time_zone&.strftime("%Y-%m-%dT%H:%M") %>
</div>
</div>
<p class="muted admin-form-hint"><%= t("admin.announcements.form.window_hint") %></p>
<div>
<%= f.label :action_url, t("admin.announcements.form.action_url") %>
<%= f.url_field :action_url, placeholder: "https://" %>
</div>
<p class="muted admin-form-hint"><%= t("admin.announcements.form.action_url_hint") %></p>
<div>
<%= f.label :action_label, t("admin.announcements.form.action_label") %>
<%= f.text_field :action_label, maxlength: 40 %>
</div>
<label class="admin-checkbox">
<%= f.check_box :dismissible %>
<span><%= t("admin.announcements.form.dismissible") %></span>
</label>
<p class="muted admin-form-hint"><%= t("admin.announcements.form.dismissible_hint") %></p>
<div class="admin-form-actions">
<%= f.submit (announcement.persisted? ? t("admin.announcements.form.submit_update") : t("admin.announcements.form.submit_create")), class: "admin-btn admin-btn--primary" %>
<%= link_to t("admin.announcements.form.cancel"), admin_announcements_path, class: "admin-btn admin-btn--outline" %>
</div>
<% end %>
@@ -0,0 +1,9 @@
<% content_for :body_class, "admin-body" %>
<div class="admin-page-head">
<h2 class="admin-page-title"><%= t("admin.announcements.edit.title") %></h2>
</div>
<div class="panel">
<%= render "form", announcement: @announcement %>
</div>
@@ -0,0 +1,56 @@
<% content_for :body_class, "admin-body" %>
<div class="admin-page-head">
<h2 class="admin-page-title"><%= t("admin.announcements.index.title") %></h2>
<p class="muted admin-page-sub"><%= t("admin.announcements.index.lead") %></p>
</div>
<div class="panel" style="margin-bottom:1.5rem">
<div class="admin-toolbar">
<%= link_to t("admin.announcements.index.new"), new_admin_announcement_path, class: "admin-btn admin-btn--primary" %>
</div>
</div>
<div class="panel">
<h2><%= t("admin.announcements.index.table_title") %></h2>
<% if @announcements.any? %>
<div class="admin-table-wrap">
<table class="admin-table">
<thead>
<tr>
<th><%= t("admin.announcements.table.status") %></th>
<th><%= t("admin.announcements.table.kind") %></th>
<th><%= t("admin.announcements.table.title") %></th>
<th><%= t("admin.announcements.table.channels") %></th>
<th><%= t("admin.announcements.table.window") %></th>
<th></th>
</tr>
</thead>
<tbody>
<% @announcements.each do |item| %>
<tr>
<td>
<span class="badge badge--<%= announcement_status_badge(item) %>"><%= t("admin.announcements.status.#{item.status}") %></span>
</td>
<td class="muted"><%= t("admin.announcements.kind.#{item.kind}") %></td>
<td>
<strong><%= item.title %></strong>
<div class="muted" style="font-size:0.85rem;margin-top:0.25rem"><%= truncate(item.body, length: 90) %></div>
</td>
<td class="muted"><%= announcement_channels_label(item) %></td>
<td class="muted"><%= announcement_window_label(item) %></td>
<td class="admin-actions">
<%= link_to t("admin.announcements.actions.edit"), edit_admin_announcement_path(item), class: "admin-btn admin-btn--sm" %>
<%= button_to t("admin.announcements.actions.delete"), admin_announcement_path(item), method: :delete,
class: "admin-btn admin-btn--sm admin-btn--danger",
form: { data: { confirm: t("admin.announcements.actions.delete_confirm") } } %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% else %>
<p class="empty"><%= t("admin.announcements.index.none") %></p>
<% end %>
</div>
@@ -0,0 +1,9 @@
<% content_for :body_class, "admin-body" %>
<div class="admin-page-head">
<h2 class="admin-page-title"><%= t("admin.announcements.new.title") %></h2>
</div>
<div class="panel">
<%= render "form", announcement: @announcement %>
</div>
@@ -0,0 +1,13 @@
<p><strong><%= t("mailers.contact.heading") %></strong></p>
<p>
<%= t("mailers.contact.name") %> <%= @name %><br>
<%= t("mailers.contact.email") %> <%= @email %><br>
<%= t("mailers.contact.club") %> <%= @club_name.presence || t("mailers.contact.club_none") %><br>
<%= t("mailers.contact.topic") %> <%= t("mailers.contact.topic_labels.#{@topic}") %>
</p>
<p><%= t("mailers.contact.message") %></p>
<p style="white-space:pre-wrap"><%= @message %></p>
<p style="color:#666;font-size:12px"><%= t("mailers.contact.footer") %></p>
@@ -0,0 +1,11 @@
<%= t("mailers.contact.heading") %>
<%= t("mailers.contact.name") %> <%= @name %>
<%= t("mailers.contact.email") %> <%= @email %>
<%= t("mailers.contact.club") %> <%= @club_name.presence || t("mailers.contact.club_none") %>
<%= t("mailers.contact.topic") %> <%= t("mailers.contact.topic_labels.#{@topic}") %>
<%= t("mailers.contact.message") %>
<%= @message %>
<%= t("mailers.contact.footer") %>
+2 -1
View File
@@ -4,7 +4,7 @@
<title><%= t("admin.layout.title") %></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" href="/admin.css?v=4">
<link rel="stylesheet" href="/admin.css?v=6">
<% if content_for?(:replay_archive_styles) %>
<link rel="stylesheet" href="/marketing.css?v=42">
<% end %>
@@ -25,6 +25,7 @@
<%= link_to admin_ops_path, class: ("active" if controller_name == "ops") do %>
<%= t("admin.layout.nav.ops") %><% if ops_critical.positive? %> <span class="admin-nav-badge"><%= ops_critical %></span><% end %>
<% end %>
<%= link_to t("admin.layout.nav.announcements"), admin_announcements_path, class: ("active" if controller_name == "announcements") %>
<%= link_to t("admin.layout.nav.clubs"), admin_clubs_path, class: ("active" if controller_name.in?(%w[clubs teams club_recordings])) %>
<%= link_to t("admin.layout.nav.billing"), admin_billing_path, class: ("active" if controller_name.in?(%w[billing billing_invoices])) %>
<%= link_to t("admin.layout.nav.youtube"), admin_youtube_platform_path, class: ("active" if controller_name == "youtube") %>
+2 -1
View File
@@ -8,11 +8,12 @@
<%= render "shared/meta_tags" %>
<%= yield :head %>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==" crossorigin="anonymous" referrerpolicy="no-referrer">
<link rel="stylesheet" href="/marketing.css?v=64">
<link rel="stylesheet" href="/marketing.css?v=67">
</head>
<body data-confirm-i18n='<%= raw confirm_dialog_i18n_json %>'<% if MatchLiveTv.google_analytics_configured? %> data-ga-id="<%= MatchLiveTv.google_analytics_measurement_id %>"<% end %>>
<%= render "shared/cookie_banner" %>
<%= render(@app_store_review_chrome ? "shared/marketing_nav_app_store" : "shared/marketing_nav") %>
<%= render "shared/site_announcements" %>
<main>
<% if flash[:notice] %><div class="wrap"><div class="flash notice"><%= flash[:notice] %></div></div><% end %>
<% if flash[:alert] %><div class="wrap"><div class="flash alert"><%= flash[:alert] %></div></div><% end %>
@@ -6,13 +6,14 @@
<title><%= content_for?(:title) ? yield(:title) : "Match Live TV" %></title>
<%= render "shared/meta_tags" %>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==" crossorigin="anonymous" referrerpolicy="no-referrer">
<link rel="stylesheet" href="/marketing.css?v=64">
<link rel="stylesheet" href="/marketing.css?v=67">
<link rel="stylesheet" href="/live.css?v=26">
<%= yield :head %>
</head>
<body data-confirm-i18n='<%= raw confirm_dialog_i18n_json %>'<% if MatchLiveTv.google_analytics_configured? %> data-ga-id="<%= MatchLiveTv.google_analytics_measurement_id %>"<% end %>>
<%= render "shared/cookie_banner" %>
<%= render "shared/marketing_nav" %>
<%= render "shared/site_announcements" %>
<main class="live-main">
<%= yield %>
</main>
+1 -1
View File
@@ -1,7 +1,7 @@
<% content_for :title, t("club.edit.title", name: @club.name) %>
<% content_for :robots, "noindex, nofollow" %>
<div class="wrap" style="padding-top:20px;max-width:560px">
<div class="wrap wrap--portal" style="padding-top:20px">
<h1><%= t("club.edit.heading") %></h1>
<div class="card">
<%= form_with url: public_club_path(@club), method: :patch, multipart: true do %>
@@ -0,0 +1,124 @@
<% content_for :title, t("pages.contacts.meta_title") %>
<% content_for :meta_description, t("pages.contacts.meta_description") %>
<% content_for :canonical_url, seo_absolute_url(public_contatti_path) %>
<article class="contacts-page">
<header class="features-hero contacts-hero">
<div class="wrap">
<p class="features-hero__eyebrow"><%= t("pages.contacts.eyebrow") %></p>
<h1><%= t("pages.contacts.title") %></h1>
<p class="features-hero__lead"><%= t("pages.contacts.lead") %></p>
<p class="contacts-hero__meta"><%= t("pages.contacts.response_time") %></p>
</div>
</header>
<section class="section wrap" aria-label="<%= t("pages.contacts.title") %>">
<div class="contacts-channels">
<article class="feature-card">
<span class="feature-card__icon" aria-hidden="true"><i class="fa-solid fa-briefcase"></i></span>
<h2><%= t("pages.contacts.commercial_title") %></h2>
<p><%= t("pages.contacts.commercial_body") %></p>
<p class="contacts-channels__email">
<%= mail_to MatchLiveTv.support_email, MatchLiveTv.support_email %>
</p>
</article>
<article class="feature-card">
<span class="feature-card__icon feature-card__icon--blue" aria-hidden="true"><i class="fa-solid fa-life-ring"></i></span>
<h2><%= t("pages.contacts.support_title") %></h2>
<p>
<%= raw t(
"pages.contacts.support_body_html",
faq_link: link_to(t("pages.contacts.faq_link"), public_faq_path),
support_link: link_to(t("pages.contacts.support_link"), public_support_path)
) %>
</p>
<p class="contacts-channels__email">
<%= mail_to MatchLiveTv.support_email, MatchLiveTv.support_email %>
</p>
</article>
<article class="feature-card">
<span class="feature-card__icon feature-card__icon--gold" aria-hidden="true"><i class="fa-solid fa-shield-halved"></i></span>
<h2><%= t("pages.contacts.privacy_title") %></h2>
<p><%= t("pages.contacts.privacy_body") %></p>
<p class="contacts-channels__email">
<%= mail_to MatchLiveTv.privacy_controller_email, MatchLiveTv.privacy_controller_email %>
</p>
</article>
</div>
</section>
<section class="section wrap" aria-labelledby="contacts-company-title">
<div class="features-panel contacts-company">
<h2 id="contacts-company-title"><%= t("pages.contacts.company_title") %></h2>
<p class="features-panel__lead"><%= t("pages.contacts.company_lead") %></p>
<ul class="contacts-company__details">
<li><strong><%= MatchLiveTv.privacy_controller_name %></strong></li>
<li><%= t("pages.contacts.label_address") %>: <%= MatchLiveTv.privacy_controller_address %></li>
<% if MatchLiveTv.privacy_controller_vat.present? %>
<li><%= t("pages.contacts.label_vat") %>: <%= MatchLiveTv.privacy_controller_vat %></li>
<% end %>
</ul>
</div>
</section>
<section class="section wrap" aria-labelledby="contacts-form-title">
<div class="contacts-form-panel">
<h2 id="contacts-form-title"><%= t("pages.contacts.form_title") %></h2>
<p class="contacts-form-panel__lead"><%= t("pages.contacts.form_lead") %></p>
<%= form_with url: public_contatti_path, method: :post, local: true, class: "contacts-form" do %>
<div class="contacts-hp" aria-hidden="true">
<label for="website"><%= t("pages.contacts.honeypot_label") %></label>
<%= text_field_tag :website, @inquiry[:website], tabindex: -1, autocomplete: "off" %>
</div>
<%= label_tag :name, t("pages.contacts.name_label") %>
<%= text_field_tag :name, @inquiry[:name], required: true, maxlength: 120, autocomplete: "name" %>
<%= label_tag :email, t("pages.contacts.email_label") %>
<%= email_field_tag :email, @inquiry[:email], required: true, autocomplete: "email" %>
<%= label_tag :club_name, t("pages.contacts.club_label") %>
<%= text_field_tag :club_name, @inquiry[:club_name], maxlength: 160, autocomplete: "organization" %>
<%= label_tag :topic, t("pages.contacts.topic_label") %>
<%= select_tag :topic, options_for_select(
[
[t("pages.contacts.topic_commercial"), "commercial"],
[t("pages.contacts.topic_support"), "support"],
[t("pages.contacts.topic_privacy"), "privacy"]
],
@inquiry[:topic]
), required: true %>
<%= label_tag :message, t("pages.contacts.message_label") %>
<%= text_area_tag :message, @inquiry[:message], required: true, rows: 6, maxlength: 4000 %>
<label class="legal-accept">
<%= check_box_tag :accept_privacy, "1", @inquiry[:accept_privacy] == "1", required: true %>
<span class="legal-accept-text">
<%= raw t(
"pages.contacts.privacy_accept_html",
privacy_link: link_to(t("pages.contacts.privacy_link"), public_privacy_path, target: "_blank", rel: "noopener")
) %>
</span>
</label>
<%= submit_tag t("pages.contacts.submit"), class: "btn btn-primary" %>
<% end %>
</div>
</section>
<section class="section wrap features-cta" aria-labelledby="contacts-cta-title">
<div class="features-cta__box">
<h2 id="contacts-cta-title"><%= t("pages.contacts.cta_title") %></h2>
<p><%= t("pages.contacts.cta_body") %></p>
<div class="features-cta__actions">
<%= link_to t("pages.contacts.cta_faq"), public_faq_path, class: "btn btn-outline" %>
<%= link_to t("pages.contacts.cta_signup"), public_signup_path, class: "btn btn-primary" %>
</div>
</div>
</section>
</article>
@@ -83,6 +83,6 @@
<div class="card" style="margin-top:32px;text-align:center">
<h3 style="margin-top:0"><%= t("pages.pricing.different_title") %></h3>
<p style="color:#aaa;margin-bottom:16px"><%= t("pages.pricing.different_body") %></p>
<%= mail_to "info@matchlivetv.it", t("pages.pricing.contact_button"), class: "btn btn-primary" %>
<%= link_to t("pages.pricing.contact_button"), public_contatti_path, class: "btn btn-primary" %>
</div>
</div>
@@ -43,6 +43,7 @@
<li><%= raw t("legal.privacy.s3_item4_html") %></li>
<li><%= raw t("legal.privacy.s3_item5_html") %></li>
<li><%= raw t("legal.privacy.s3_item6_html") %></li>
<li><%= raw t("legal.privacy.s3_item7_html") %></li>
</ul>
</section>
@@ -107,6 +108,10 @@
<td><%= t("legal.privacy.s5_row6_purpose") %></td>
<td><%= t("legal.privacy.s5_row6_basis") %></td>
</tr>
<tr>
<td><%= t("legal.privacy.s5_row7_purpose") %></td>
<td><%= t("legal.privacy.s5_row7_basis") %></td>
</tr>
</tbody>
</table>
</div>
@@ -144,6 +149,7 @@
<li><%= raw t("legal.privacy.s8_item2_html") %></li>
<li><%= raw t("legal.privacy.s8_item3_html") %></li>
<li><%= raw t("legal.privacy.s8_item4_html", hours: MatchLiveTv.password_reset_expiry_hours) %></li>
<li><%= raw t("legal.privacy.s8_item5_html") %></li>
</ul>
</section>
+1 -1
View File
@@ -1,7 +1,7 @@
<% content_for :title, t("team.edit.title", name: @team.name) %>
<% content_for :robots, "noindex, nofollow" %>
<div class="wrap" style="padding-top:20px;max-width:560px">
<div class="wrap wrap--portal" style="padding-top:20px">
<h1><%= @team.name %></h1>
<p style="color:#888"><%= t("team.edit.club_label") %> <%= link_to @club.name, public_club_path(@club) %></p>
<div class="card">
+46 -19
View File
@@ -1,7 +1,9 @@
<% record = local_assigns[:record] %>
<% show_inherit_hint = local_assigns[:show_inherit_hint] %>
<% can_upload = local_assigns.fetch(:can_upload, false) %>
<% cover_src = record.effective_cover_url.presence || Streams::CoverResolver::DEFAULT_COVER_URL %>
<% default_cover = Streams::CoverResolver::DEFAULT_COVER_URL %>
<% cover_src = record.effective_cover_url.presence || default_cover %>
<% remove_id = "remove_cover_#{record.model_name.param_key}" %>
<fieldset class="branding-fields cover-fields">
<legend><%= t("club.branding.cover_legend") %></legend>
@@ -22,16 +24,25 @@
</div>
<% if can_upload %>
<%= file_field_tag "branding[cover_image]",
accept: "image/png,image/jpeg,image/webp",
data: { branding_cover_file: true },
class: "branding-file-input" %>
<% if record.cover_image_attached? %>
<label class="checkbox-label cover-remove-label">
<%= check_box_tag "remove_cover", "1", false, id: "remove_cover_#{record.model_name.param_key}" %>
<%= t("club.branding.cover_remove_label") %>
</label>
<% end %>
<div class="cover-actions">
<%= file_field_tag "branding[cover_image]",
accept: "image/png,image/jpeg,image/webp",
data: { branding_cover_file: true },
class: "branding-file-input" %>
<% if record.cover_image_attached? %>
<%= hidden_field_tag "remove_cover", "0", id: remove_id, data: { branding_cover_remove: true } %>
<button type="button"
class="btn btn-secondary cover-reset-btn"
data-branding-cover-reset
data-default-cover="<%= default_cover %>"
data-remove-input="#<%= remove_id %>">
<%= t("club.branding.cover_reset_button") %>
</button>
<p class="branding-hint cover-reset-hint" data-branding-cover-reset-hint hidden>
<%= t("club.branding.cover_reset_pending_hint") %>
</p>
<% end %>
</div>
<% else %>
<p class="muted"><%= t("club.branding.cover_requires_full") %></p>
<%= link_to t("club.branding.cover_see_plans"), public_prezzi_path, class: "btn btn-secondary btn-sm" %>
@@ -43,13 +54,29 @@
(function () {
var input = document.querySelector("[data-branding-cover-file]");
var img = document.querySelector("[data-branding-cover-img]");
if (!input || !img) return;
input.addEventListener("change", function () {
var file = input.files && input.files[0];
if (!file) return;
var reader = new FileReader();
reader.onload = function (e) { img.src = e.target.result; };
reader.readAsDataURL(file);
});
var resetBtn = document.querySelector("[data-branding-cover-reset]");
var removeInput = document.querySelector("[data-branding-cover-remove]");
var resetHint = document.querySelector("[data-branding-cover-reset-hint]");
if (input && img) {
input.addEventListener("change", function () {
var file = input.files && input.files[0];
if (!file) return;
if (removeInput) removeInput.value = "0";
if (resetHint) resetHint.hidden = true;
if (resetBtn) resetBtn.disabled = false;
var reader = new FileReader();
reader.onload = function (e) { img.src = e.target.result; };
reader.readAsDataURL(file);
});
}
if (resetBtn && img && removeInput) {
resetBtn.addEventListener("click", function () {
removeInput.value = "1";
img.src = resetBtn.getAttribute("data-default-cover");
if (input) input.value = "";
if (resetHint) resetHint.hidden = false;
resetBtn.disabled = true;
});
}
})();
</script>
@@ -5,6 +5,7 @@
<%= render "shared/store_badges", variant: "footer" %>
</div>
<div>
<%= link_to t("common.contacts"), public_contatti_path %> ·
<%= link_to t("common.support"), public_support_path %> ·
<%= link_to t("common.pricing"), public_prezzi_path %> ·
<%= link_to t("footer.live"), public_live_index_path %> ·
@@ -0,0 +1,45 @@
<% announcements = @site_announcements %>
<% if announcements.present? %>
<div class="site-announcements" role="region" aria-label="<%= t("announcement.region") %>">
<% announcements.each do |item| %>
<article class="site-announcement site-announcement--<%= item.kind %> site-announcement--<%= item.severity %>"
data-announcement-id="<%= item.id %>">
<div class="site-announcement__body">
<p class="site-announcement__title"><%= item.title %></p>
<div class="site-announcement__text"><%= simple_format(item.body) %></div>
<% if item.action_url.present? %>
<p class="site-announcement__action">
<%= link_to (item.action_label.presence || t("announcement.open")), item.action_url,
class: "site-announcement__link", target: "_blank", rel: "noopener noreferrer" %>
</p>
<% end %>
</div>
<% if item.dismissible? %>
<button type="button" class="site-announcement__dismiss" data-announcement-dismiss aria-label="<%= t("announcement.dismiss") %>">
×
</button>
<% end %>
</article>
<% end %>
</div>
<script>
(function () {
var key = "mltv.webDismissedAnnouncements";
var dismissed = [];
try { dismissed = JSON.parse(localStorage.getItem(key) || "[]"); } catch (e) {}
document.querySelectorAll(".site-announcement[data-announcement-id]").forEach(function (el) {
if (dismissed.indexOf(el.getAttribute("data-announcement-id")) !== -1) el.remove();
});
document.querySelectorAll("[data-announcement-dismiss]").forEach(function (btn) {
btn.addEventListener("click", function () {
var box = btn.closest("[data-announcement-id]");
if (!box) return;
var id = box.getAttribute("data-announcement-id");
if (dismissed.indexOf(id) === -1) dismissed.push(id);
localStorage.setItem(key, JSON.stringify(dismissed));
box.remove();
});
});
})();
</script>
<% end %>