Sito marketing, SEO, legal, live programmata e branding Match Live Tv.

Logo e favicon nel header, partite programmate su web e mobile, reset password,
pagine FAQ/sitemap, privacy/termini GDPR e icona Android «Match Live Tv».

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-26 23:17:15 +02:00
parent 3a5649f482
commit 471291b2c4
70 changed files with 1601 additions and 153 deletions

View File

@@ -12,6 +12,15 @@ module Public
.search_by_team_or_opponent(@query)
.order(Arel.sql("started_at DESC NULLS LAST"), created_at: :desc)
busy_match_ids = StreamSession.where.not(status: %w[ended error]).select(:match_id)
@upcoming_matches = Match
.scheduled_upcoming
.includes(:team)
.search_teams_or_opponents(@query)
.where.not(id: busy_match_ids)
.order(scheduled_at: :asc)
.limit(30)
@online_paths = Mediamtx::Client.new.online_path_names
end

View File

@@ -15,5 +15,11 @@ module Public
def terms
end
def faq
end
def pallavolo
end
end
end

View File

@@ -0,0 +1,52 @@
module Public
class PasswordResetsController < WebBaseController
def new
end
def create
user = User.find_by(email: params[:email]&.downcase&.strip)
if user
token = user.generate_password_reset!
UserMailer.password_reset(user, token).deliver_now
end
redirect_to public_login_path,
notice: "Se l'email è registrata, riceverai a breve un link per reimpostare la password."
end
def edit
@user = User.find_by_password_reset_token(params[:token])
if @user.nil? || @user.password_reset_expired?
redirect_to new_public_password_reset_path,
alert: "Link non valido o scaduto. Richiedi un nuovo reset password."
return
end
@token = params[:token]
end
def update
@user = User.find_by_password_reset_token(params[:token])
if @user.nil? || @user.password_reset_expired?
redirect_to new_public_password_reset_path,
alert: "Link non valido o scaduto. Richiedi un nuovo reset password."
return
end
if params[:password].blank? || params[:password].length < 8
flash.now[:alert] = "La password deve avere almeno 8 caratteri"
@token = params[:token]
return render :edit, status: :unprocessable_entity
end
if params[:password] != params[:password_confirmation]
flash.now[:alert] = "Le password non coincidono"
@token = params[:token]
return render :edit, status: :unprocessable_entity
end
@user.update!(password: params[:password])
@user.clear_password_reset!
redirect_to public_login_path, notice: "Password aggiornata. Ora puoi accedere."
end
end
end

View File

@@ -6,6 +6,12 @@ module Public
end
def create
unless params[:accept_terms] == "1"
@user = User.new(user_params.merge(role: "coach"))
flash.now[:alert] = "Devi accettare linformativa privacy e i termini di servizio per registrarti."
return render :new, status: :unprocessable_entity
end
@user = User.new(user_params.merge(role: "coach"))
if @user.save
session[:user_id] = @user.id

View File

@@ -2,6 +2,8 @@ module Public
class SiteBaseController < ActionController::Base
layout "marketing"
include ::SeoHelper
include ::LegalHelper
helper_method :current_user, :logged_in?
private

View File

@@ -0,0 +1,21 @@
module Public
class SitemapController < ActionController::Base
def show
base = MatchLiveTv.app_public_url.chomp("/")
@entries = [
{ loc: "#{base}/", changefreq: "weekly", priority: "1.0" },
{ loc: "#{base}/funzionalita", changefreq: "monthly", priority: "0.9" },
{ 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}/live", changefreq: "hourly", priority: "0.85" },
{ loc: "#{base}/privacy", changefreq: "yearly", priority: "0.3" },
{ loc: "#{base}/termini", changefreq: "yearly", priority: "0.3" }
]
respond_to do |format|
format.xml { render layout: false }
end
end
end
end