Sha256: 603898163a9764ad5d943b7257a928224acb18ea68b66544303d7e322aada99c

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

Coprl::Presenters.define(:image_crop, namespace: :plugins) do
  helpers Demo::Helpers::IndentedGrid
  attach :top_nav
  attach :plugin_drawer
  plugin :image_crop

  page_title 'Image Crop'

  indented_grid do
    title 'Drag and drop with cropper preview'
    grid do
      column 6 do
        image_crop id: :event_image,
                   aspect_ratio: 1.0,
                   image: 'https://cdn.mos.cms.futurecdn.net/4f6d31c116fdada59a5cb16d136e3068-970-80.jpg' do
        end
      end
      column 6 do
        file_input name: :event_file_name, preview: :event_image, accept: 'image/png, image/jpeg, image/gif, image/svg+xml' do
          grid do
            column 12 do
              card do
                text 'Drop it here'
                button icon: :cloud_upload
              end
            end
          end
        end
      end
      event :change do
        replaces :context_list, ':context_list'
      end
    end
  end

  # image_crop do
  #   event :change do
  #     replaces :context_list, ':context_list'
  #   end
  # end
  attach 'context_list'
  attach :code, file: __FILE__
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
coprl-3.0.0.beta.2 app/demo/plugins/image_crop.pom
coprl-3.0.0.beta.1 app/demo/plugins/image_crop.pom