Display time per puzzle for marathon scoreboards
This commit is contained in:
@@ -68,6 +68,8 @@
|
|||||||
.form-floating
|
.form-floating
|
||||||
= form.text_field :display_time_from_start, autocomplete: "off", class: "form-control", id: "time"
|
= form.text_field :display_time_from_start, autocomplete: "off", class: "form-control", id: "time"
|
||||||
= form.label :display_time_from_start, class: "required"
|
= 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"
|
.row.mb-3 id="missing_pieces"
|
||||||
.col
|
.col
|
||||||
.form-floating
|
.form-floating
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
h4
|
h4
|
||||||
= "Puzzle validated for #{@contestant.name}!"
|
= "Puzzle validé pour #{@contestant.name} !"
|
||||||
@@ -64,25 +64,33 @@ css:
|
|||||||
|
|
||||||
- else
|
- else
|
||||||
.d-flex.flex-column style="height: calc(100vh - 180px)"
|
.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"
|
= render "selectors"
|
||||||
|
|
||||||
.d-flex.flex-column style="overflow-y: auto"
|
.d-flex.flex-column style="overflow-y: auto"
|
||||||
|
.table-responsive-md
|
||||||
table.table.table-striped.table-hover
|
table.table.table-striped.table-hover
|
||||||
thead
|
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
|
tr
|
||||||
th scope="col"
|
th scope="col"
|
||||||
= t("helpers.rank")
|
= t("helpers.rank")
|
||||||
th scope="col"
|
th scope="col"
|
||||||
= t("activerecord.attributes.contestant.name")
|
= t("activerecord.attributes.contestant.name")
|
||||||
- if @contest.puzzles.size > 1
|
|
||||||
th scope="col"
|
th scope="col"
|
||||||
= t("activerecord.attributes.contestant.completions")
|
= t("activerecord.attributes.contestant.completions")
|
||||||
th scope="col"
|
th scope="col"
|
||||||
= t("activerecord.attributes.contestant.display_time")
|
= t("activerecord.attributes.contestant.display_time")
|
||||||
|
- @contest.puzzles.each do |puzzle|
|
||||||
|
th scope="col"
|
||||||
|
= puzzle.name
|
||||||
tbody
|
tbody
|
||||||
- @contestants.each_with_index do |contestant, index|
|
- @contestants.each_with_index do |contestant, index|
|
||||||
tr scope="row"
|
tr scope="row"
|
||||||
@@ -90,8 +98,15 @@ css:
|
|||||||
= index + 1
|
= index + 1
|
||||||
td
|
td
|
||||||
= contestant.name
|
= contestant.name
|
||||||
- if @contest.puzzles.size > 1
|
|
||||||
td
|
td
|
||||||
= contestant.completions.where(remaining_pieces: nil).length
|
= contestant.completions.where(remaining_pieces: nil).length
|
||||||
td
|
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
|
= 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
|
contestant: Participant
|
||||||
display_time: Time
|
display_time: Time
|
||||||
display_time_from_start: Time since start
|
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
|
display_relative_time: Time for this puzzle
|
||||||
puzzle: Puzzle
|
puzzle: Puzzle
|
||||||
missing_pieces: Missing pieces
|
missing_pieces: Missing pieces
|
||||||
@@ -284,7 +285,7 @@ en:
|
|||||||
rank: Rank
|
rank: Rank
|
||||||
lib:
|
lib:
|
||||||
ranking:
|
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)
|
theorical: By time only (projected time calculated with the ppm count)
|
||||||
messages:
|
messages:
|
||||||
index:
|
index:
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ fr:
|
|||||||
contestant_id: Participant.e
|
contestant_id: Participant.e
|
||||||
display_time: Temps
|
display_time: Temps
|
||||||
display_time_from_start: Temps depuis le début
|
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
|
display_relative_time: Temps pour ce puzzle
|
||||||
puzzle: Puzzle
|
puzzle: Puzzle
|
||||||
missing_pieces: Pièces manquantes
|
missing_pieces: Pièces manquantes
|
||||||
@@ -255,7 +256,7 @@ fr:
|
|||||||
rank: Rang
|
rank: Rang
|
||||||
lib:
|
lib:
|
||||||
ranking:
|
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)
|
theorical: Par temps uniquement (temps projeté calculé à partir de la vitesse d'assemblage)
|
||||||
messages:
|
messages:
|
||||||
index:
|
index:
|
||||||
|
|||||||
Reference in New Issue
Block a user