Sha256: 2a9cb24dac3cb912e43dc604d504b954963fe8689f47229ea0a6fe47bd5b13a7

Contents?: true

Size: 761 Bytes

Versions: 32

Compression:

Stored size: 761 Bytes

Contents

module RefinerySettingsHelper
  def form_value_type
    @refinery_setting.form_value_type.presence || 'text_area'
  end

  def refinery_setting_title(f)
    if @refinery_setting.form_value_type == 'check_box'
      raw "<h3>#{@refinery_setting.name.to_s.titleize}?</h3>"
    else
      f.label :value
    end
  end

  def refinery_setting_field(f, help)
    case form_value_type
    when 'check_box'
      raw "#{f.check_box :value, :value => @refinery_setting.form_value}
           #{f.label :value, help.presence || t('enabled', :scope => 'admin.refinery_settings.form'),
                     :class => 'stripped'}"
    else
      f.text_area :value, :value => @refinery_setting.form_value,
                  :class => 'widest', :rows => 5
    end
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
refinerycms-settings-1.0.11 app/helpers/refinery_settings_helper.rb
refinerycms-settings-1.0.10 app/helpers/refinery_settings_helper.rb
refinerycms-settings-1.0.9 app/helpers/refinery_settings_helper.rb
refinerycms-settings-1.0.8 app/helpers/refinery_settings_helper.rb
refinerycms-settings-1.0.7 app/helpers/refinery_settings_helper.rb
refinerycms-settings-1.0.5 app/helpers/refinery_settings_helper.rb
refinerycms-settings-1.0.4 app/helpers/refinery_settings_helper.rb
refinerycms-settings-1.0.3 app/helpers/refinery_settings_helper.rb
refinerycms-settings-1.0.1 app/helpers/refinery_settings_helper.rb
refinerycms-settings-1.0.0 app/helpers/refinery_settings_helper.rb
refinerycms-settings-0.9.9.22 app/helpers/refinery_settings_helper.rb
refinerycms-settings-0.9.9.21 app/helpers/refinery_settings_helper.rb
refinerycms-settings-0.9.9.20 app/helpers/refinery_settings_helper.rb
refinerycms-settings-0.9.9.19 app/helpers/refinery_settings_helper.rb
refinerycms-settings-0.9.9.18 app/helpers/refinery_settings_helper.rb
refinerycms-settings-0.9.9.17 app/helpers/refinery_settings_helper.rb
refinerycms-settings-0.9.9.16 app/helpers/refinery_settings_helper.rb
refinerycms-settings-0.9.9.15 app/helpers/refinery_settings_helper.rb
refinerycms-settings-0.9.9.14 app/helpers/refinery_settings_helper.rb
refinerycms-settings-0.9.9.13 app/helpers/refinery_settings_helper.rb