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

61 lines
1.8 KiB
Plaintext

%script{:src => "https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"}
.mx-20.flex.h-16.items-center.gap-16
.text-xl.font-bold.text-gray-900
Image: #{@image.name}
=link_to merged.image_copy_path(@image.id) do
%button.mx-40.button.change Copy
.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.mx-4.button.change 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