diff --git a/app/views/contestants/_form.html.slim b/app/views/contestants/_form.html.slim index a48ba44..5864770 100644 --- a/app/views/contestants/_form.html.slim +++ b/app/views/contestants/_form.html.slim @@ -29,66 +29,72 @@ .row.mt-5 .col h3 Completions - .row - .col - .alert.alert-info - = t("contestants.edit.completions_note") - table.table.table-striped.table-hover - thead - tr - th scope="col" - = t("activerecord.attributes.completion.completed") - - if @contest.puzzles.size > 1 + - if @contest.puzzles.length == 0 + .row + .col + .alert.alert-warning + = t("contestants.edit.no_puzzles_note") + - else + .row + .col + .alert.alert-info + = t("contestants.edit.completions_note") + table.table.table-striped.table-hover + thead + tr th scope="col" - = t("activerecord.attributes.completion.display_time_from_start") - th scope="col" - = t("activerecord.attributes.completion.display_relative_time") - - else - th scope="col" - = t("activerecord.attributes.completion.display_time") - th scope="col" - = t("activerecord.attributes.completion.projected_time") - th scope="col" - = t("activerecord.attributes.completion.missing_pieces") - th scope="col" - = t("activerecord.attributes.completion.remaining_pieces") - th scope="col" - = t("activerecord.attributes.completion.puzzle") - tbody - - @completions.each do |completion| - tr scope="row" - td - - if completion.completed - - - - - td - = display_time(completion.time_seconds) + = t("activerecord.attributes.completion.completed") - if @contest.puzzles.size > 1 - td - = completion.display_relative_time + th scope="col" + = t("activerecord.attributes.completion.display_time_from_start") + th scope="col" + = t("activerecord.attributes.completion.display_relative_time") - else + th scope="col" + = t("activerecord.attributes.completion.display_time") + th scope="col" + = t("activerecord.attributes.completion.projected_time") + th scope="col" + = t("activerecord.attributes.completion.missing_pieces") + th scope="col" + = t("activerecord.attributes.completion.remaining_pieces") + th scope="col" + = t("activerecord.attributes.completion.puzzle") + tbody + - @completions.each do |completion| + tr scope="row" td - = display_time(completion.projected_time) - td - = completion.missing_pieces - td - = completion.remaining_pieces - td - - if !completion.puzzle.brand.blank? - | #{completion.puzzle.name} - #{completion.puzzle.brand} + - if completion.completed + + + + + td + = display_time(completion.time_seconds) + - if @contest.puzzles.size > 1 + td + = completion.display_relative_time - else - | #{completion.puzzle.name} - td - a.btn.btn-sm.btn-secondary.me-2 href=edit_contest_completion_path(@contest, completion, contestant_id: contestant.id) - = t("helpers.buttons.edit") - = link_to t("helpers.buttons.delete"), contest_completion_path(contest, completion, contestant_id: contestant.id), - data: { turbo_method: :delete }, class: "btn btn-sm btn-secondary" - .row - .col - a.btn.btn-primary href=new_contest_completion_path(@contest, contestant_id: contestant.id) - = t("helpers.buttons.add") + td + = display_time(completion.projected_time) + td + = completion.missing_pieces + td + = completion.remaining_pieces + td + - if !completion.puzzle.brand.blank? + | #{completion.puzzle.name} - #{completion.puzzle.brand} + - else + | #{completion.puzzle.name} + td + a.btn.btn-sm.btn-secondary.me-2 href=edit_contest_completion_path(@contest, completion, contestant_id: contestant.id) + = t("helpers.buttons.edit") + = link_to t("helpers.buttons.delete"), contest_completion_path(contest, completion, contestant_id: contestant.id), + data: { turbo_method: :delete }, class: "btn btn-sm btn-secondary" + .row + .col + a.btn.btn-primary href=new_contest_completion_path(@contest, contestant_id: contestant.id) + = t("helpers.buttons.add") - if contestant.offline.present? .row.mt-5.mb-2 diff --git a/config/locales/en.yml b/config/locales/en.yml index d9cd44d..0195588 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -217,6 +217,7 @@ en: end_image: End image notice: Participant updated not_finished: Not yet finished + no_puzzles_note: No puzzles were added yet offline_participation: Offline participation start_image: Start image title: Participant diff --git a/config/locales/fr.yml b/config/locales/fr.yml index cb6499c..47ea94e 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -188,6 +188,7 @@ fr: end_image: Image de fin notice: Participant.e modifié.e not_finished: Non terminé + no_puzzles_note: Aucun puzzle n'a été défini encore pour ce concours offline_participation: Participation hors-ligne start_image: Image de début title: Participant.e