From ee476ab81b297c1b923cdb67a23610e4c6bea75a Mon Sep 17 00:00:00 2001 From: sto Date: Fri, 27 Jun 2025 13:15:53 +0200 Subject: [PATCH] Improve dashboard display --- app/views/contests/show.html.slim | 88 +++++++++++------------ app/views/layouts/authenticated.html.slim | 2 +- config/locales/fr.yml | 2 +- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/app/views/contests/show.html.slim b/app/views/contests/show.html.slim index 0e45950..0b5a50e 100644 --- a/app/views/contests/show.html.slim +++ b/app/views/contests/show.html.slim @@ -33,7 +33,42 @@ javascript: =< t("contests.show.copy_extension_url") .row.mb-4 style="height: calc(100vh - 280px)" - .col-7.d-flex.flex-column style="height: 100%" + .col-6.d-flex.flex-column style="height: 100%" + .row + .col + h4 + = t("contestants.plural").capitalize + a.ms-3.btn.btn-sm.btn-primary href=new_contest_contestant_path(@contest) style="margin-top: -3px" + | + #{t("helpers.buttons.add")} + a.ms-2.btn-sm.btn.btn-primary href=contest_import_path(@contest) style="margin-top: -3px" + | #{t("helpers.buttons.import")} + .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") + 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 + td + = contestant.completions.length + td + = contestant.display_time + td + a.btn.btn-sm.btn-secondary href=edit_contest_contestant_path(@contest, contestant) + = t("helpers.buttons.open") + .col-6.d-flex.flex-column style="height: 100%" .row .col h4 @@ -102,46 +137,11 @@ javascript: td = message.text td - - if @puzzles.size > 0 - a.btn.btn-sm.btn-secondary href=contest_message_convert_path(@contest, message) style="white-space: nowrap;" - = t("helpers.buttons.add_completion") - - else - a.btn.btn-sm.btn-secondary.disabled href=contest_message_convert_path(@contest, message) style="white-space: nowrap;" - = t("helpers.buttons.add_completion") - td - = link_to t("helpers.buttons.delete"), contest_message_path(@contest, message), data: { turbo_method: :delete }, class: "btn btn-sm btn-danger" - .col-5.d-flex.flex-column style="height: 100%" - .row - .col - h4 - = t("contestants.plural").capitalize - a.ms-3.btn.btn-sm.btn-primary href=new_contest_contestant_path(@contest) style="margin-top: -3px" - | + #{t("helpers.buttons.add")} - a.ms-3.btn-sm.btn.btn-primary href=contest_import_path(@contest) style="margin-top: -3px" - | #{t("helpers.buttons.import")} - .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") - 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 - td - = contestant.completions.length - td - = contestant.display_time - td - a.btn.btn-sm.btn-secondary href=edit_contest_contestant_path(@contest, contestant) - = t("helpers.buttons.open") + .d-inline-flex + - if @puzzles.size > 0 + a.btn.btn-sm.btn-secondary href=contest_message_convert_path(@contest, message) style="white-space: nowrap;" + = t("helpers.buttons.add_completion") + - else + a.btn.btn-sm.btn-secondary.disabled href=contest_message_convert_path(@contest, message) style="white-space: nowrap;" + = t("helpers.buttons.add_completion") + = link_to t("helpers.buttons.delete"), contest_message_path(@contest, message), data: { turbo_method: :delete }, class: "btn btn-sm btn-danger ms-2" diff --git a/app/views/layouts/authenticated.html.slim b/app/views/layouts/authenticated.html.slim index ebc5487..8019ed5 100644 --- a/app/views/layouts/authenticated.html.slim +++ b/app/views/layouts/authenticated.html.slim @@ -46,7 +46,7 @@ html h1.mb-4 = @title - if @action_path - a.ms-4.btn.btn-primary href=@action_path style="margin-top: -4px" + a.ms-4.btn.btn-primary href=@action_path style="margin-top: -6px" = @action_name = yield \ No newline at end of file diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 0d3441e..a2b4f84 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -155,7 +155,7 @@ fr: team: "équipes" buttons: add: "Ajouter" - add_completion: "Ajouter une complétion" + add_completion: "Convertir" back: "⬅ Revenir au concours" back_to_contestant: "⬅ Revenir au/à la participant.e" confirm: "Confirmer"