Improve public scoreboard UI + make it responsive
All checks were successful
CI / scan_ruby (push) Successful in 19s
CI / scan_js (push) Successful in 13s
CI / lint (push) Successful in 13s
CI / test (push) Successful in 43s

This commit is contained in:
sto
2025-06-26 10:53:21 +02:00
parent d28f888ee2
commit 1b34d10dee
3 changed files with 133 additions and 47 deletions

View File

@@ -1,2 +1,20 @@
module ContestsHelper
def pad(n)
if n > 9
return n.to_s
end
"0" + n.to_s
end
def display_time(time)
h = time / 3600
m = (time % 3600) / 60
s = (time % 3600) % 60
if h > 0
return h.to_s + ":" + pad(m) + ":" + pad(s)
elsif m > 0
return m.to_s + ":" + pad(s)
end
s.to_s
end
end