From 322a9b64a9b651aa3353fb67eac1f6cee0de6489 Mon Sep 17 00:00:00 2001 From: Torsten Date: Fri, 30 Dec 2022 22:25:32 +0200 Subject: [PATCH] add image details on card index --- app/views/merged/cards/index.haml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/views/merged/cards/index.haml b/app/views/merged/cards/index.haml index 9cc4b77..fdd8205 100644 --- a/app/views/merged/cards/index.haml +++ b/app/views/merged/cards/index.haml @@ -32,11 +32,17 @@ = card.updated_by .basis-96 - %h3.mt-4.text-lg.font-bold Image - -if( card.image.blank? ) - %p No image - -else - = image_for( card, "p-3") + = link_to(merged.images_path(card_id: card.id)) do + -if card.image + %h3.mt-4.text-lg.font-bold Image #{card.image.name} + .flex.align-center.justify-between.mb-4 + .text-lg.font-bold.mt-2.mx-2 + = card.image.size.to_s + "k" + %strong.inline-block.rounded.bg-yellow-200.px-3.py-1.text-md.font-medium + = card.image.aspect_ratio + = image_for( card ) + -else + %h3.mt-4.text-lg.font-bold No Image .basis-72.grow %h3.mt-4.text-lg.font-bold Fields = form_tag( merged.card_path(card.id) , {method: :patch , class: "mx-auto mt-8 mb-0 max-w space-y-4" } ) do