Events: remaining fixes
This commit is contained in:
@@ -169,6 +169,7 @@ class ContestsController < ApplicationController
|
||||
end
|
||||
|
||||
def scoreboard
|
||||
@is_scoreboard = true
|
||||
if active_page("/public/event/") == "active"
|
||||
@event = Event.find_by(slug: params[:id])
|
||||
unless @event && @event.shared_scoreboard && !@event.contests.where(public: true).empty?
|
||||
@@ -187,6 +188,10 @@ class ContestsController < ApplicationController
|
||||
else
|
||||
@contest = @event.contests.where(public: true).first
|
||||
end
|
||||
if @contest.completions.empty? && @contest.start_time == nil
|
||||
authorize @contest
|
||||
render :scoreboard_not_started and return
|
||||
end
|
||||
else
|
||||
@contest = Contest.find_by(slug: params[:id])
|
||||
unless @contest && @contest.public
|
||||
@@ -195,6 +200,7 @@ class ContestsController < ApplicationController
|
||||
end
|
||||
end
|
||||
authorize @contest
|
||||
@is_scoreboard_started = true
|
||||
|
||||
I18n.locale = @contest.lang
|
||||
|
||||
|
||||
Reference in New Issue
Block a user