Sha256: 9b6433b2590af8b93403542c7f7b8c11708314557bef585e317f1fb6aa8afb6d
Contents?: true
Size: 1.57 KB
Versions: 12
Compression:
Stored size: 1.57 KB
Contents
require_relative '../helpers/indented_grid' Coprl::Presenters.define(:file_inputs) do helpers Demo::Helpers::IndentedGrid attach :top_nav attach :component_drawer page_title 'File Inputs' indented_grid do file_input name: :event_image, preview: [:preview_id, :filename] do grid do column 6 do card do image 'https://dev-doc-images.s3.amazonaws.com/grace-hopper.png', id: :preview_id, width: 512, height: 176 text id: :filename text 'Drag and drop or click this button to upload' button icon: :cloud_upload end end column 6 do end end end title 'Simple' file_input name: :upload title 'With image preview' file_input preview: :image_id, accept: 'image/png, image/jpeg, image/gif, image/svg+xml' image 'img/demo/grace-hopper.png', height: 100, width: 100, id: :image_id title 'With image button preview' file_input preview: :button_id, accept: 'image/png, image/jpeg, image/gif, image/svg+xml' button type: :image, id: :button_id do image 'img/demo/grace-hopper-wide.png' end text 'Note: it binds to the button id, not the nested image id.' title 'With text_area preview' file_input preview: :text_area_id, accept: 'text/plain, text/markdown' text_area id: :text_area_id title 'With image and file_name preview' file_input preview: [:text_area_id2, :filename_id], accept: 'text/plain, text/markdown' subtitle2 id: :filename_id text_area id: :text_area_id2 attach :code, file: __FILE__ end end
Version data entries
12 entries across 12 versions & 1 rubygems