Sha256: 0922fbd9b8142331c0d098f85906e23f8b12ee3c2ad02fdaaa727337e1e9c088

Contents?: true

Size: 589 Bytes

Versions: 29

Compression:

Stored size: 589 Bytes

Contents

module Locomotive
  class SimpleImageInput < ImageInput

    def file_input
      @builder.file_field(attribute_name, input_html_options.merge(accept: 'image/*')) +
      @builder.hidden_field(:"remove_#{attribute_name}", class: 'remove', value: '0') +
      @builder.hidden_field(:"remote_#{attribute_name}_url", class: 'remote-url', value: '')
    end

    def browse_button_html
      <<-EOF
      <span class="file-browse">#{text(:browse)}</span>
      EOF
    end

    def file
      self.object.send(attribute_name.to_sym)
    end

    def file_url
      file.url
    end

  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
locomotivecms-4.2.0.alpha2 app/inputs/locomotive/simple_image_input.rb
locomotivecms-4.2.0.alpha1 app/inputs/locomotive/simple_image_input.rb
locomotivecms-4.1.1 app/inputs/locomotive/simple_image_input.rb
locomotivecms-4.1.0 app/inputs/locomotive/simple_image_input.rb
locomotivecms-4.1.0.rc1 app/inputs/locomotive/simple_image_input.rb
locomotivecms-4.0.3 app/inputs/locomotive/simple_image_input.rb
locomotivecms-4.0.2 app/inputs/locomotive/simple_image_input.rb
locomotivecms-4.0.1 app/inputs/locomotive/simple_image_input.rb
locomotivecms-4.0.0 app/inputs/locomotive/simple_image_input.rb
locomotivecms-4.0.0.rc0 app/inputs/locomotive/simple_image_input.rb
locomotivecms-4.0.0.alpha3 app/inputs/locomotive/simple_image_input.rb
locomotivecms-3.4.1 app/inputs/locomotive/simple_image_input.rb
locomotivecms-4.0.0.alpha2 app/inputs/locomotive/simple_image_input.rb
locomotivecms-4.0.0.alpha1 app/inputs/locomotive/simple_image_input.rb
locomotivecms-3.4.0 app/inputs/locomotive/simple_image_input.rb
locomotivecms-3.3.0 app/inputs/locomotive/simple_image_input.rb
locomotivecms-3.3.0.rc3 app/inputs/locomotive/simple_image_input.rb
locomotivecms-3.3.0.rc2 app/inputs/locomotive/simple_image_input.rb
locomotivecms-3.1.2 app/inputs/locomotive/simple_image_input.rb
locomotivecms-3.2.1 app/inputs/locomotive/simple_image_input.rb