sto a33f3ff4de
All checks were successful
CI / scan_ruby (push) Successful in 15s
CI / scan_js (push) Successful in 12s
CI / lint (push) Successful in 13s
CI / test (push) Successful in 28s
Display more participant info on contest dashboard
2025-06-18 07:46:45 +02:00

118 lines
4.1 KiB
Plaintext

.row.mb-4
.col
css:
.badges { margin-top: -18px; position: absolute; }
.badges
- @badges.each do |badge|
span.badge.text-bg-info.me-2
= badge
.row
.col.alert.alert-success
= t("contests.show.public_scoreboard")
= link_to root_url + "public/#{@contest.slug}", root_url + "public/#{@contest.slug}"
.row.mb-4
.col.alert.alert-success
|> URL for the public scoreboard extension:
= link_to "#{message_url}?token=#{@contest.generate_token_for(:token)}"
.row.mb-4
.col-6
.row
.col
h4
= t("puzzles.plural").capitalize
a.ms-3.btn.btn-sm.btn-primary href=new_contest_puzzle_path(@contest) style="margin-top: -3px"
| + #{t("helpers.buttons.add")}
table.table.table-striped.table-hover
thead
tr
th scope="col"
= t("activerecord.attributes.puzzle.image")
th scope="col"
= t("activerecord.attributes.puzzle.name")
th scope="col"
= t("activerecord.attributes.puzzle.brand")
tbody
- @puzzles.each do |puzzle|
tr.align-middle scope="row"
td
= image_tag(puzzle.image, class: "img-fluid", style: "max-width: 140px;") if puzzle.image.attached?
td
= puzzle.name
td
= puzzle.brand
td
a.btn.btn-sm.btn-secondary href=edit_contest_puzzle_path(@contest, puzzle)
= t("helpers.buttons.edit")
- if @messages
.row.mt-5
.col
h4 = t("messages.plural").capitalize
- if !@puzzles.size
.row
.col.alert.alert-danger
| You first need to add a puzzle before converting messages to completions
table.table.table-striped.table-hover
thead
tr
th scope="col"
= t("activerecord.attributes.message.time")
th scope="col"
= t("activerecord.attributes.message.author")
th scope="col"
= t("activerecord.attributes.message.text")
tbody
- @messages.each do |message|
tr.align-middle scope="row"
td
= message.display_time
td
= message.author
td
= message.text
td
- if @puzzles.size
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-6
.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")}
table.table.table-striped.table-hover
thead
tr
th scope="col"
| 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")