Turn contest dashboard into tabs for easier navigation
Some checks failed
CI / scan_ruby (push) Successful in 20s
CI / scan_js (push) Successful in 14s
CI / lint (push) Successful in 13s
CI / test (push) Failing after 50s

This commit is contained in:
sto
2025-11-13 12:06:12 +01:00
parent 0f31265f7b
commit 97ea17b7c2
17 changed files with 265 additions and 239 deletions

View File

@@ -5,7 +5,7 @@ class MessagesController < ApplicationController
skip_before_action :require_authentication, only: %i[ create connect cors_preflight_check ]
before_action :cors_set_access_control_headers, only: %i[ create connect cors_preflight_check ]
before_action :set_contest, only: %i[ convert destroy ]
before_action :set_contest, only: %i[ convert destroy index ]
before_action :set_data, only: %i[ convert ]
def self.local_prefixes
@@ -68,6 +68,14 @@ class MessagesController < ApplicationController
end
end
def index
authorize @contest
@title = @contest.name
@messages = @contest.messages.order(:time_seconds)
@puzzles = @contest.puzzles
end
def convert
authorize @contest
@@ -76,6 +84,7 @@ class MessagesController < ApplicationController
@completion = Completion.new()
@completion.display_time_from_start = @message.display_time
@completion.completed = true
render "completions/new"
end