- content_for( :merged_menu ) do = render "merged/sections/sections_pagination" , section: @section .text-xl.text-gray-900 Cards for Section #{@section.index} - = link_to @section.header , merged.section_path( @section.id) , class: "underline" = link_to( "New Card" , merged.new_section_card_path(@section.id) , class: "p-2 border border-gray-200 bg-cyan-100 font-bold rounded-lg hover:bg-sky-100") = render "layouts/merged_header" - template = find_template(@section) = render( template , section: @section) - @section.cards.each_with_index do |card , index| .flex.gap-10.px-20.py-10{class: (card.index%2)==1 ? 'bg-cyan-50' : 'bg-red-50' , id: "card_#{card.id}"} .basis-96 .p-4 %h3.mt-4.text-lg.font-bold Card #{index + 1}:#{card.header} .flex.flex-wrap = blue_button( "Up" , merged.card_move_path(card.id , dir: :up) ) = blue_button( "Down" , merged.card_move_path(card.id , dir: :down) ) = form_tag( merged.card_path(card.id) , {method: :delete } ) do =submit_button( "Delete" , true) .p-4 %h3.mt-4.text-lg.font-bold Image = yellow_button("Change Image" , merged.images_path(card_id: card.id) ) = red_button("Remove image", merged.card_set_image_path( card.id , image: "") ) .basis-96 %h3.mt-4.text-lg.font-bold Image -if( card.image.blank? ) %p No image -else = image_for( card, "p-3") .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 %label.block .text-lg.font-bold Header = text_field_tag( :header , card.header, class: "block w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm") %label.block .mt-4.text-lg.font-bold Text = text_area_tag( :text , card.text, rows: 5 , class: "w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm" ) =submit_button( "Update") .basis-72.grow .mt-4.text-lg.font-bold Options = form_tag( merged.card_path(card.id) , {method: :patch , class: "mx-auto mt-8 mb-0 max-w space-y-4" }) do - card.option_definitions.each do |option| =render "merged/sections/option_form_#{option.type}" , section: card , option: option -if card.option_definitions.empty? %p No options -else = submit_button("Update")