Display time per puzzle for marathon scoreboards
This commit is contained in:
@@ -68,6 +68,8 @@
|
||||
.form-floating
|
||||
= form.text_field :display_time_from_start, autocomplete: "off", class: "form-control", id: "time"
|
||||
= form.label :display_time_from_start, class: "required"
|
||||
.form-text
|
||||
= t("activerecord.attributes.completion.display_time_from_start_description")
|
||||
.row.mb-3 id="missing_pieces"
|
||||
.col
|
||||
.form-floating
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
h4
|
||||
= "Puzzle validated for #{@contestant.name}!"
|
||||
= "Puzzle validé pour #{@contestant.name} !"
|
||||
@@ -64,25 +64,33 @@ css:
|
||||
|
||||
- else
|
||||
.d-flex.flex-column style="height: calc(100vh - 180px)"
|
||||
.d-flex.flex-row.justify-content-center.mb-5
|
||||
- @contest.puzzles.each do |puzzle|
|
||||
= image_tag(puzzle.image, class: "img-fluid ms-3 me-3", style: "max-height: 220px") if puzzle.image.attached?
|
||||
|
||||
= render "selectors"
|
||||
|
||||
.d-flex.flex-column style="overflow-y: auto"
|
||||
.table-responsive-md
|
||||
table.table.table-striped.table-hover
|
||||
thead
|
||||
tr
|
||||
th
|
||||
th
|
||||
th
|
||||
th
|
||||
- @contest.puzzles.each do |puzzle|
|
||||
th scope="col"
|
||||
= image_tag(puzzle.image, class: "img-fluid", style: "max-height: 64px;") if puzzle.image.attached?
|
||||
tr
|
||||
th scope="col"
|
||||
= t("helpers.rank")
|
||||
th scope="col"
|
||||
= t("activerecord.attributes.contestant.name")
|
||||
- if @contest.puzzles.size > 1
|
||||
th scope="col"
|
||||
= t("activerecord.attributes.contestant.completions")
|
||||
th scope="col"
|
||||
= t("activerecord.attributes.contestant.display_time")
|
||||
- @contest.puzzles.each do |puzzle|
|
||||
th scope="col"
|
||||
= puzzle.name
|
||||
tbody
|
||||
- @contestants.each_with_index do |contestant, index|
|
||||
tr scope="row"
|
||||
@@ -90,8 +98,15 @@ css:
|
||||
= index + 1
|
||||
td
|
||||
= contestant.name
|
||||
- if @contest.puzzles.size > 1
|
||||
td
|
||||
= contestant.completions.where(remaining_pieces: nil).length
|
||||
td
|
||||
= contestant.completions.size > 0 && contestant.completions[-1].remaining_pieces ? "#{contestant.completions.map{|completion| completion.puzzle.pieces}.sum - contestant.completions[-1].remaining_pieces}p" : contestant.display_time
|
||||
- @contest.puzzles.each do |puzzle|
|
||||
td
|
||||
- contestant.completions.each do |completion|
|
||||
- if completion.puzzle == puzzle
|
||||
- if completion.completed
|
||||
= completion.display_relative_time
|
||||
- else
|
||||
= "#{puzzle.pieces - completion.remaining_pieces}p"
|
||||
@@ -47,6 +47,7 @@ en:
|
||||
contestant: Participant
|
||||
display_time: Time
|
||||
display_time_from_start: Time since start
|
||||
display_time_from_start_description: Format mm:ss or h:mm:ss
|
||||
display_relative_time: Time for this puzzle
|
||||
puzzle: Puzzle
|
||||
missing_pieces: Missing pieces
|
||||
@@ -284,7 +285,7 @@ en:
|
||||
rank: Rank
|
||||
lib:
|
||||
ranking:
|
||||
actual: First by time if completed, then by number of pieces assembled
|
||||
actual: First by number of pieces assembled, then by time
|
||||
theorical: By time only (projected time calculated with the ppm count)
|
||||
messages:
|
||||
index:
|
||||
|
||||
@@ -18,6 +18,7 @@ fr:
|
||||
contestant_id: Participant.e
|
||||
display_time: Temps
|
||||
display_time_from_start: Temps depuis le début
|
||||
display_time_from_start_description: Format mm:ss ou h:mm:ss
|
||||
display_relative_time: Temps pour ce puzzle
|
||||
puzzle: Puzzle
|
||||
missing_pieces: Pièces manquantes
|
||||
@@ -255,7 +256,7 @@ fr:
|
||||
rank: Rang
|
||||
lib:
|
||||
ranking:
|
||||
actual: Par temps d'abord, puis par nombre de pièces assemblées
|
||||
actual: Par nombre de pièces assemblées, puis par temps
|
||||
theorical: Par temps uniquement (temps projeté calculé à partir de la vitesse d'assemblage)
|
||||
messages:
|
||||
index:
|
||||
|
||||
Reference in New Issue
Block a user