Integrate shared scoreboard links in contests
This commit is contained in:
@@ -169,7 +169,7 @@ class ContestsController < ApplicationController
|
||||
end
|
||||
|
||||
def scoreboard
|
||||
if active_page("/public/event")
|
||||
if active_page("/public/event/") == "active"
|
||||
@event = Event.find_by(slug: params[:id])
|
||||
unless @event && @event.shared_scoreboard && !@event.contests.where(public: true).empty?
|
||||
skip_authorization
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
.col
|
||||
h4.mb-3
|
||||
= t("contests.index.manage_contests")
|
||||
a.ms-3.btn.btn-primary href="/events"
|
||||
= t("events.show.back_to_events")
|
||||
.float-end
|
||||
a.btn.btn-primary.mb-4 href=new_contest_path
|
||||
= t("contests.index.new_contest")
|
||||
@@ -9,7 +11,7 @@
|
||||
.alert.alert-primary role="alert"
|
||||
= t("contests.index.message")
|
||||
|
||||
.row.row-cols-1.row-cols-md-3.g-4
|
||||
.mt-3.row.row-cols-1.row-cols-md-3.g-4
|
||||
- @contests.each do |contest|
|
||||
.col
|
||||
css:
|
||||
|
||||
@@ -91,6 +91,14 @@ html
|
||||
startAutoRefresh(200);
|
||||
- elsif active_page("/contests") == "active"
|
||||
= @contest.name
|
||||
- if @contest.event && @contest.event.shared_scoreboard
|
||||
- if @contest.public
|
||||
a.ms-4.btn.btn-success href="/public/event/#{@contest.event.slug}?contest_id=#{@contest.id}" style="margin-top: -6px;"
|
||||
= t("events.show.open_shared_scoreboard")
|
||||
- else
|
||||
a.ms-4.btn.btn-success.disabled style="margin-top: -6px;"
|
||||
= t("contests.show.shared_scoreboard_disabled")
|
||||
- else
|
||||
- if @contest.public
|
||||
a.ms-4.btn.btn-success href="/public/#{@contest.slug}" style="margin-top: -6px;"
|
||||
= t("contests.show.open_public_scoreboard")
|
||||
|
||||
@@ -247,6 +247,7 @@ en:
|
||||
open_public_scoreboard: Open public scoreboard
|
||||
offline_form_disabled: The offline form is disabled
|
||||
public_scoreboard_disabled: The public scoreboard is disabled
|
||||
shared_scoreboard_disabled: The public scoreboard is disabled for this contest
|
||||
url_copied: URL copied to the clipboard
|
||||
stopwatch:
|
||||
info: This stopwatch is used for display in the public scoreboard, when allowed in the settings
|
||||
|
||||
@@ -218,6 +218,7 @@ fr:
|
||||
open_public_scoreboard: Ouvrir le classement public
|
||||
offline_form_disabled: Le formulaire hors-ligne n'est pas activé
|
||||
public_scoreboard_disabled: Le classement public n'est pas activé
|
||||
shared_scoreboard_disabled: Le classement public n'est pas activé pour cette épreuve
|
||||
url_copied: L’URL a été copiée dans le presse-papier
|
||||
stopwatch:
|
||||
info: Ce chronomètre est utilisé pour être affiché dans le classement public, quand autorisé dans les paramètres
|
||||
|
||||
Reference in New Issue
Block a user