diff --git a/app/views/completions/_form.html.slim b/app/views/completions/_form.html.slim index 2ca8e1a..70b9d23 100644 --- a/app/views/completions/_form.html.slim +++ b/app/views/completions/_form.html.slim @@ -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 diff --git a/app/views/contestants/public_completion_updated.html.slim b/app/views/contestants/public_completion_updated.html.slim index 9f3aece..e0f0c47 100644 --- a/app/views/contestants/public_completion_updated.html.slim +++ b/app/views/contestants/public_completion_updated.html.slim @@ -1,2 +1,2 @@ h4 - = "Puzzle validated for #{@contestant.name}!" \ No newline at end of file + = "Puzzle validé pour #{@contestant.name} !" \ No newline at end of file diff --git a/app/views/contests/scoreboard.html.slim b/app/views/contests/scoreboard.html.slim index 537636b..b22a5f3 100644 --- a/app/views/contests/scoreboard.html.slim +++ b/app/views/contests/scoreboard.html.slim @@ -64,34 +64,49 @@ 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.table.table-striped.table-hover - thead - tr - th scope="col" - = t("helpers.rank") - th scope="col" - = t("activerecord.attributes.contestant.name") - - if @contest.puzzles.size > 1 + .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") th scope="col" = t("activerecord.attributes.contestant.completions") - th scope="col" - = t("activerecord.attributes.contestant.display_time") - tbody - - @contestants.each_with_index do |contestant, index| - tr scope="row" - td - = index + 1 - td - = contestant.name - - if @contest.puzzles.size > 1 + 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" + td + = index + 1 + td + = contestant.name 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 \ No newline at end of file + 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" \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index e96367d..8171174 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 333ed63..2c253e0 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -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: