From 6afde8a971dd1c20b12c1fcf6c22f8da53dd0b82 Mon Sep 17 00:00:00 2001 From: sto Date: Sun, 11 May 2025 21:09:57 +0200 Subject: [PATCH] Turn puzzles into table --- app/views/contests/show.html.slim | 32 +++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/app/views/contests/show.html.slim b/app/views/contests/show.html.slim index 7f3aa5f..053ab60 100644 --- a/app/views/contests/show.html.slim +++ b/app/views/contests/show.html.slim @@ -21,19 +21,27 @@ .row .col h4 = t("puzzles.plural").capitalize - .row.row-cols-1.row-cols-md-3.g-4.mb-4 - - @puzzles.each do |puzzle| - .col - css: - .card:hover { background-color: lightblue; } - .card.h-100 - .card-header + 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 - = image_tag puzzle.image if puzzle.image.attached? - .card-body - p.card-text - = puzzle.brand - a.stretched-link href=edit_contest_puzzle_path(@contest, puzzle) + 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)