Implement shared scoreboard UI
This commit is contained in:
@@ -3,7 +3,7 @@ module ContestantsConcern
|
||||
|
||||
def ranked_contestants(contest)
|
||||
if contest.ranking_mode == "actual"
|
||||
contest.contestants.sort_by { |contestant| [
|
||||
contest.contestants.includes([ :completions, :offline ]).sort_by { |contestant| [
|
||||
-contestant.completions.where(remaining_pieces: nil).size,
|
||||
(contestant.completions.where(remaining_pieces: nil).size == @contest.puzzles.length ? 1 : 0) * contestant.time_seconds,
|
||||
contestant.completions.size > 0 && contestant.completions[-1].remaining_pieces ? contestant.completions[-1].remaining_pieces : 1000000,
|
||||
|
||||
7
app/views/application/_event_nav.html.slim
Normal file
7
app/views/application/_event_nav.html.slim
Normal file
@@ -0,0 +1,7 @@
|
||||
.mt-2.row style="font-size: 16px;"
|
||||
.col
|
||||
ul.nav.nav-tabs.mb-4
|
||||
- @contest.event.contests.where(public: true).each do |contest|
|
||||
li.nav-item
|
||||
a.nav-link class="#{contest == @contest ? "active" : ""}" href="/public/event/#{@contest.event.slug}?contest_id=#{contest.id}"
|
||||
= contest.name
|
||||
@@ -1,5 +1,5 @@
|
||||
.row
|
||||
.mt-3.col-6.d-flex.flex-column style="height: calc(100vh - 310px)"
|
||||
.row style="width: 100%;"
|
||||
.mt-3.col-6.d-flex.flex-column style="height: calc(100vh - 260px)"
|
||||
.d-flex.flex-column style="overflow-y: auto"
|
||||
table.table.table-striped.table-hover
|
||||
thead
|
||||
|
||||
@@ -46,8 +46,12 @@ html
|
||||
h1.mb-4
|
||||
- if @contest && @contest.id.present?
|
||||
- if active_page("/public") == "active" && @action_path
|
||||
= @contest.name
|
||||
.float-end style="margin-top: -5px;" id="scoreboard-switches"
|
||||
- if active_page("/public/event/") == "active"
|
||||
= @contest.event.name
|
||||
= render "event_nav"
|
||||
- else
|
||||
= @contest.name
|
||||
.float-end style="margin-top: #{active_page("/public/event/") == "active" ? "-18px" : "-5px"};" id="scoreboard-switches"
|
||||
.d-inline-flex.align-items-center
|
||||
.ms-4.form-check.form-switch style="font-size: 16px; font-weight: 300;"
|
||||
input.form-check-input type="checkbox" id="refresh-checkbox"
|
||||
|
||||
Reference in New Issue
Block a user