merged/app/views/merged/images/show.haml

64 lines
1.9 KiB
Plaintext

.mx-20.flex.h-16.items-center.gap-16
.text-xl.font-bold.text-gray-900
Image: #{@image.name}
%button.mx-40.hover:bg-cyan-200{class: button_classes }
=link_to "Copy" , merged.image_copy_path(@image.id)
- if Rails.env.development?
= javascript_include_tag "merged/vue.js"
-else
= javascript_include_tag "merged/vue.min.js"
.flex.m-20
.left.flex.gap-2.mt-3
%p
.mr-2.font-bold Type
= @image.type
%p
.font-bold Size
= "#{@image.size}k"
%p
.font-bold Ratio
= @image.ratio.round(2)
= @image.aspect_ratio
= form_tag( merged.image_path , class: "ml-20 flex" , method: :patch) do
.font-bold.mt-3.mx-4 Name:
= text_field_tag( "name" , @image.name, class: "rounded border-gray-200 text-sm shadow-sm")
.font-bold.mt-3.mx-4 Tags:
= text_field_tag( "tags" , @image.tags, class: "rounded border-gray-200 text-sm shadow-sm")
%button.bg-cyan-200.mx-4{class: button_classes } Update
=render "editor" , image: @image
.flex.gap-10.m-20
-if @used
.grid.grid-cols-2.gap-10
.grid.grid-cols-3.gap-10
%p.col-span-3.font-bold
Sections using the image
-@sections.each do |section|
%p
= link_to section.header , merged.section_path(section)
%p
%em on Page
%p
= link_to section.page.name , merged.page_sections_path(section.page)
.grid.grid-cols-3.gap-10
%p.col-span-3.font-bold
Cards using the image
-@cards.each do |card|
%p
= link_to card.header , merged.section_cards_path(card.section)
%p
%em on Page
%p
= link_to card.section.page.name , merged.page_sections_path(card.section.page)
-else
%p.align-center Not used, you may delete
%p
= form_tag( merged.image_path(@image.id) , {method: :delete } ) do
%button.button.remove{type: :submit} Delete