Files
puzzle-scoreboard/app/views/puzzles/index.html.slim
sto 51e55f0828
All checks were successful
CI / scan_ruby (push) Successful in 16s
CI / scan_js (push) Successful in 13s
CI / lint (push) Successful in 14s
CI / test (push) Successful in 36s
Add hidden setting to puzzles
#19
2025-12-04 11:35:41 +01:00

40 lines
1.7 KiB
Plaintext

.row.mb-4 style="height: calc(100vh - 280px)"
.col.d-flex.flex-column style="height: 100%"
.row.mb-4
.col
a.btn.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
= t("activerecord.attributes.puzzle.image")
th
= t("activerecord.attributes.puzzle.name")
th
= t("activerecord.attributes.puzzle.brand")
th
= t("activerecord.attributes.puzzle.pieces")
th
= t("activerecord.attributes.puzzle.hidden")
tbody
- @puzzles.each do |puzzle|
tr.align-middle scope="row"
td
= image_tag(puzzle.image, class: "img-fluid", style: "max-height: 128px;") if puzzle.image.attached?
td
= puzzle.name
td
= puzzle.brand
td
= puzzle.pieces
td
- if puzzle.hidden?
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-square" viewBox="0 0 16 16">
<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/>
<path d="M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"/>
</svg>
td
a.btn.btn-sm.btn-secondary href=edit_contest_puzzle_path(@contest, puzzle)
= t("helpers.buttons.edit")