merged/app/views/merged/sections/select_image.haml

16 lines
926 B
Plaintext

.grid.grid-cols-6.gap-2.m-8
.relative.block.border.border-gray-100
%h3.mt-4.text-lg.font-bold Add new image or select (click)
= form_tag(merged.images_path, multipart: true) do
= text_field_tag 'filename'
%h5.mt-4.text-lg.font-bold Name is optional
%p will be taken from uploaded file
= hidden_field_tag :redirect , section_set_image_url(@section.id,image: "NEW")
= file_field_tag 'image_file'
.inline-block.rounded.border.border-indigo-600.bg-indigo-600.px-12.py-3.text-sm.font-medium.text-white.hover:bg-transparent.hover:text-indigo-600.focus:outline-none.focus:ring.active:text-indigo-500{:href => merged.new_image_path}
= submit_tag 'Submit'
-@images.each do |name , image|
.relative.block.border.border-gray-100
= link_to( section_set_image_path( image: name)) do
=image_tag("#{image_root}/#{name}" , class: "h-56 w-full object-contain lg:h-72")