Show public scoreboard QR code for events
This commit is contained in:
@@ -192,6 +192,15 @@ class ContestsController < ApplicationController
|
|||||||
authorize @contest
|
authorize @contest
|
||||||
render :scoreboard_not_started and return
|
render :scoreboard_not_started and return
|
||||||
end
|
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
|
else
|
||||||
@contest = Contest.find_by(slug: params[:id])
|
@contest = Contest.find_by(slug: params[:id])
|
||||||
unless @contest && @contest.public
|
unless @contest && @contest.public
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ html
|
|||||||
- if active_page("/public") == "active" && @is_scoreboard
|
- if active_page("/public") == "active" && @is_scoreboard
|
||||||
- if active_page("/public/event/") == "active"
|
- if active_page("/public/event/") == "active"
|
||||||
= @contest.event.name
|
= @contest.event.name
|
||||||
|
- if @qrcode
|
||||||
|
.float-end style="width: 80px; height: 80px;"
|
||||||
|
= @qrcode.html_safe
|
||||||
= render "event_nav"
|
= render "event_nav"
|
||||||
- else
|
- else
|
||||||
= @contest.name
|
= @contest.name
|
||||||
|
|||||||
Reference in New Issue
Block a user