Fix refresh
All checks were successful
CI / scan_ruby (push) Successful in 17s
CI / scan_js (push) Successful in 13s
CI / lint (push) Successful in 13s
CI / test (push) Successful in 28s

This commit is contained in:
sto 2025-07-16 10:53:33 +02:00
parent 537f32ab8b
commit 916c7af738
2 changed files with 5 additions and 8 deletions

View File

@ -81,7 +81,11 @@ class ContestsController < ApplicationController
filter_contestants_per_category
@puzzles = @contest.puzzles.order(:id)
@action_name = t("helpers.buttons.refresh")
@action_path = "/public/#{@contest.friendly_id}"
if params.key?(:category)
@action_path = "/public/#{@contest.friendly_id}?category=#{params[:category]}"
else
@action_path = "/public/#{@contest.friendly_id}"
end
render :scoreboard
end

View File

@ -1,10 +1,3 @@
javascript:
function refresh() {
const el = document.querySelector('input[type="checkbox"]');
if (el.checked) location.replace("/public/#{@contest.friendly_id}?refresh=1")
setTimeout(refresh, 5000);
}
css:
@media (max-width: 800px) {
a.btn { display: none; }