sto 6afde8a971
Some checks failed
CI / scan_ruby (push) Failing after 13s
CI / scan_js (push) Successful in 11s
CI / lint (push) Successful in 12s
CI / test (push) Successful in 28s
Turn puzzles into table
2025-05-11 21:09:57 +02:00

76 lines
2.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.mb-4
.col
.float-end
a.btn.btn-primary href=edit_contest_path(@contest)
| Edit contest
p
= t("contests.show.public_scoreboard")
= link_to root_url + "public/#{@contest.slug}", root_url + "public/#{@contest.slug}"
.row.mb-4
.col-6
.row
.col
h4 = t("puzzles.plural").capitalize
table.table.table-striped.table-hover
thead
tr
th scope="col"
| Image
th scope="col"
| Title
th scope="col"
| 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)
| Edit
.row
.col
a.btn.btn-primary href=new_contest_puzzle_path(@contest)
= t("contests.show.add_puzzle")
.col-6
.row
.col
h4 = t("contestants.plural").capitalize
table.table.table-striped.table-hover
thead
tr
th scope="col"
| Name
th scope="col"
| Completed puzzles
tbody
- @contestants.each do |contestant|
tr scope="row"
td
= contestant.name
td
= contestant.completions.length
td
a.btn.btn-sm.btn-secondary href=edit_contest_contestant_path(@contest, contestant)
| Open
a.btn.btn-sm.btn-secondary.ms-2 href=new_contest_completion_path(@contest, contestant_id: contestant.id)
| Add completion
.row.mt-4
.col
a.btn.btn-primary href=new_contest_contestant_path(@contest)
= t("contests.show.add_participant")