image copy
This commit is contained in:
@ -1,31 +1,29 @@
|
||||
|
||||
%section.image
|
||||
.flex.justify-between.mx-20
|
||||
%button.my-3.bg-cyan-200{class: button_classes }
|
||||
=link_to "Copy" , merged.image_copy_path(@image.id)
|
||||
.flex.justify-between
|
||||
%div.justify-self-start.ml-20.mr-10
|
||||
%b Scale {{scaled_x}} x {{scaled_y}}
|
||||
%br/
|
||||
%input{":min": 20 , ":max": 100 , ":step": 0.1 , :type => "range",
|
||||
"v-bind:value": "scale" , "v-on:input" => "handle_scale($event)"}/
|
||||
|
||||
= form_tag( merged.image_path , {method: :patch } ) do
|
||||
%input{ hidden: true , id: :scale_id , name: :scale , "v-bind:value": "scale" }
|
||||
%button.my-3.bg-cyan-200{class: button_classes , name: :type , value: 'scale'} Scale {{scale}} %
|
||||
|
||||
%div.justify-self-start.mx-20
|
||||
%b Scale {{scaled_x}} x {{scaled_y}}
|
||||
%br/
|
||||
%input{":min": 20 , ":max": 100 , ":step": 0.1 , :type => "range",
|
||||
"v-bind:value": "scale" , "v-on:input" => "handle_scale($event)"}/
|
||||
|
||||
= form_tag( merged.image_path , {method: :patch } ) do
|
||||
%input{ hidden: true , id: :width_id , name: :size_x , "v-bind:value": "size_x" }
|
||||
%input{ hidden: true , id: :height_id , name: :size_y , "v-bind:value": "size_y" }
|
||||
%input{ hidden: true , id: :off_x_id , name: :off_x , "v-bind:value": "off_x" }
|
||||
%input{ hidden: true , id: :off_y_id , name: :off_y , "v-bind:value": "off_y" }
|
||||
%button.my-3.bg-cyan-200{class: button_classes , name: :type , value: 'resize'} Crop
|
||||
= form_tag( merged.image_scale_path(image_id: image.id) ) do
|
||||
%input{ hidden: true , id: :scale_id , name: :scale , "v-bind:value": "scale" }
|
||||
%button.my-3.bg-cyan-200{class: button_classes} Scale {{scale}} %
|
||||
|
||||
%div.mt-2
|
||||
%b.pr-2 Ratio
|
||||
%br/
|
||||
%em {{ratio}} : 1
|
||||
|
||||
= form_tag( merged.image_crop_path(image_id: image.id) ) do
|
||||
%input{ hidden: true , id: :width_id , name: :size_x , "v-bind:value": "size_x" }
|
||||
%input{ hidden: true , id: :height_id , name: :size_y , "v-bind:value": "size_y" }
|
||||
%input{ hidden: true , id: :off_x_id , name: :off_x , "v-bind:value": "off_x" }
|
||||
%input{ hidden: true , id: :off_y_id , name: :off_y , "v-bind:value": "off_y" }
|
||||
%button.my-3.bg-cyan-200{class: button_classes } Crop
|
||||
|
||||
%div.mt-2.ml-32
|
||||
%b.pr-2 Fix ratio to
|
||||
%select{ "@change": "set_ratio"}
|
||||
|
@ -2,6 +2,9 @@
|
||||
.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
|
||||
@ -9,23 +12,26 @@
|
||||
|
||||
= render "layouts/merged_header"
|
||||
|
||||
.flex.gap-2.m-20
|
||||
%p
|
||||
.font-bold.mr-2 Name
|
||||
= @image.name
|
||||
%p
|
||||
.mr-2.font-bold Type
|
||||
= @image.type
|
||||
%p
|
||||
.font-bold Size
|
||||
= @image.size
|
||||
%p
|
||||
.font-bold Tags
|
||||
= @image.tags
|
||||
%p
|
||||
.font-bold Ratio
|
||||
= @image.ratio.round(2)
|
||||
= @image.aspect_ratio
|
||||
.flex.m-20
|
||||
.left.flex.gap-2.mt-3
|
||||
%p
|
||||
.mr-2.font-bold Type
|
||||
= @image.type
|
||||
%p
|
||||
.font-bold Size
|
||||
= @image.size
|
||||
%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-2.m-20
|
||||
|
Reference in New Issue
Block a user