Improve dashboard display
All checks were successful
CI / scan_ruby (push) Successful in 17s
CI / scan_js (push) Successful in 13s
CI / lint (push) Successful in 13s
CI / test (push) Successful in 34s

This commit is contained in:
sto 2025-06-27 13:15:53 +02:00
parent 0599def237
commit ee476ab81b
3 changed files with 46 additions and 46 deletions

View File

@ -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"

View File

@ -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

View File

@ -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"