merged/app/views/merged/cards/index.haml

50 lines
2.1 KiB
Plaintext

%p#notice= notice
.flex.flex-col.bg-white
.flex.items-center.justify-center.flex-1
.max-w-xl.px-4.py-8.mx-auto.text-center
%h1.text-2xl.font-bold.tracking-tight.text-gray-900
Page #{@section.page.name}
.flex.items-center.justify-center.flex-1
%h3.text-xl.font-bold.tracking-tight.text-gray-900
Cards for Section #{@section.index + 1}
.grid.grid-cols-4.gap-2.m-8
- @section.cards.each_with_index do |card , index|
.relative.block.border.border-gray-100
.p-4
%h3.mt-4.text-lg.font-bold Card #{index + 1}
%button.mt-4.rounded-lg.bg-yellow-500.p-4
=link_to( "Up" , "/index")
%button.mt-4.rounded-lg.bg-yellow-500.p-4
=link_to "Down" , "/index"
%button.mt-4.rounded-lg.bg-cyan-400.p-4
=link_to "New" , "/index"
%button.mt-4.rounded-lg.bg-red-400.p-4
=link_to "Delete" , "/index"
.p-4
%h3.mt-4.text-lg.font-bold Image
%button.ml-3.inline-block.rounded-lg.bg-blue-500.px-5.py-3.text-md.font-medium.text-white
=link_to "Change Image" , card_select_image_url(card.id)
%button.ml-3.inline-block.rounded-lg.bg-red-500.px-5.py-3.text-md.font-medium.text-white
= link_to( "Remove image" , card_set_image_path( card.id , image: ""))
.relative.block.border.border-gray-100
%h3.mt-4.text-lg.font-bold Image
-if( card.image.blank? )
%p No image
-else
= image_tag( "cms/" + card.image , class: "p-3")
.relative.block.border.border-gray-100
= form_tag( card_url(card.id) , {method: :patch } ) do
%h3.mt-4.text-lg.font-bold Header
= text_field_tag( :header , card.content["header"], class: "w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm")
%h3.mt-4.text-lg.font-bold Text
= text_area_tag( :text , card.content["text"], class: "w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm")
%button.ml-3.inline-block.rounded-lg.bg-blue-500.px-5.py-3.text-sm.font-medium.text-white{:type => "submit"}
Update
.relative.block.border.border-gray-100
%h3.mt-4.text-lg.font-bold Options
To be done