Show public scoreboard QR code for events
Some checks are pending
CI / scan_ruby (push) Waiting to run
CI / scan_js (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run

This commit is contained in:
sto
2026-08-25 09:37:31 +02:00
parent 00e14b7cff
commit 762ecc23f8
2 changed files with 12 additions and 0 deletions

View File

@@ -192,6 +192,15 @@ class ContestsController < ApplicationController
authorize @contest
render :scoreboard_not_started and return
end
host = Rails.application.config.action_controller.default_url_options[:host]
@qrcode = RQRCode::QRCode.new("https://#{host}/public/event/#{@event.friendly_id}?contest_id=#{@contest.id}").as_svg(
color: "000",
shape_rendering: "crispEdges",
module_size: 3,
standalone: true,
use_path: true,
viewbox: true
)
else
@contest = Contest.find_by(slug: params[:id])
unless @contest && @contest.public

View File

@@ -48,6 +48,9 @@ html
- if active_page("/public") == "active" && @is_scoreboard
- if active_page("/public/event/") == "active"
= @contest.event.name
- if @qrcode
.float-end style="width: 80px; height: 80px;"
= @qrcode.html_safe
= render "event_nav"
- else
= @contest.name