Sha256: c0817b7621f7097cefd55fce2aa98aaf29b077934ea6720da9ee05d94eafb4c2

Contents?: true

Size: 580 Bytes

Versions: 39

Compression:

Stored size: 580 Bytes

Contents

module Locomotive
  class ToggleInput < ::SimpleForm::Inputs::Base

    include Locomotive::SimpleForm::Inputs::FasterTranslate

    def input(wrapper_options)
      template.content_tag(:div, class: 'toggle-wrapper') do
        @builder.check_box attribute_name, data: {
          'on-text'   => text(:on_text),
          'off-text'  => text(:off_text),
          'on-color'  => 'success',
          'off-color' => 'danger',
          'size'      => 'small'
        }
      end
    end

    def text(name)
      I18n.t(name, scope: 'locomotive.inputs.toggle')
    end

  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

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