finish image selection on section, polish image index
This commit is contained in:
@ -1,14 +1,24 @@
|
||||
%section
|
||||
%a.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 => new_cms_image_path}
|
||||
Add Image
|
||||
|
||||
.grid.grid-cols-6.gap-4.m-8
|
||||
.relative.block.border.border-gray-100
|
||||
%h3.mt-4.text-lg.font-bold Add new image
|
||||
= form_tag({action: :create}, multipart: true) do
|
||||
= text_field_tag 'filename'
|
||||
%h5.mt-4.text-lg.font-bold Name is optional
|
||||
%p will be taken from uploaded file
|
||||
= 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 => new_cms_image_path}
|
||||
= submit_tag 'Submit'
|
||||
-@images.each do |name , image|
|
||||
.relative.block.border.border-gray-100
|
||||
=image_tag("cms/#{name}" , class: "h-56 w-full object-contain lg:h-72")
|
||||
.p-6
|
||||
.p-3
|
||||
%strong.inline-block.bg-yellow-400.px-3.py-1.text-md.font-medium
|
||||
= "#{image.size}k"
|
||||
%strong.inline-block.bg-yellow-400.px-3.py-1.text-md.font-medium
|
||||
= image.created_at.to_date
|
||||
%h3.mt-4.text-lg.font-bold
|
||||
= image.name
|
||||
%strong.inline-block.bg-yellow-400.px-3.py-1.text-xs.font-medium
|
||||
=image.type
|
||||
%h3.mt-4.text-lg.font-bold= image.name
|
||||
|
||||
%p.mt-2.text-sm.text-gray-700
|
||||
= "#{image.created_at.to_date} ---- #{image.updated_at.to_date}"
|
||||
|
@ -1,4 +0,0 @@
|
||||
= form_tag({action: :create}, multipart: true) do
|
||||
= text_field_tag 'filename'
|
||||
= file_field_tag 'image_file'
|
||||
= submit_tag 'Submit'
|
Reference in New Issue
Block a user