Turn puzzles into table
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

This commit is contained in:
sto 2025-05-11 21:09:57 +02:00
parent 70005468c6
commit 6afde8a971

View File

@ -21,19 +21,27 @@
.row .row
.col .col
h4 = t("puzzles.plural").capitalize h4 = t("puzzles.plural").capitalize
.row.row-cols-1.row-cols-md-3.g-4.mb-4 table.table.table-striped.table-hover
- @puzzles.each do |puzzle| thead
.col tr
css: th scope="col"
.card:hover { background-color: lightblue; } | Image
.card.h-100 th scope="col"
.card-header | 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 = puzzle.name
= image_tag puzzle.image if puzzle.image.attached? td
.card-body = puzzle.brand
p.card-text td
= puzzle.brand a.btn.btn-sm.btn-secondary href=edit_contest_puzzle_path(@contest, puzzle)
a.stretched-link href=edit_contest_puzzle_path(@contest, puzzle) | Edit
.row .row
.col .col
a.btn.btn-primary href=new_contest_puzzle_path(@contest) a.btn.btn-primary href=new_contest_puzzle_path(@contest)