<commit_before>module Administration::SettingsHelper

  def section_tab(label, name, active=false)
    content_tag(:li, class: active ? 'active' : nil) do
      link_to label, "##{name}", data: { toggle: 'tab' }
    end
  end

  def setting_row(section, name, options={}, &block)
    if @setting = @settings[section][name]
      content_tag(:div, class: "form-group setting#{@setting.id}") do
        label_tag(@setting.id, setting_name(@setting), class: 'col-sm-2 control-label') +
        content_tag(:div, class: 'col-sm-10') do
          if block_given?
            capture(&block)
          else
            setting_field(options)
          end +
          setting_description(@setting)
        end
      end
    end
  end

  def setting_field(options={})
    @setting = @settings[options[:section]][options[:name]] if options[:section] and options[:name]
    if @setting.format == 'boolean'
      content_tag(:div, class: 'checkbox') do
        hidden_field_tag(@setting.id, false, id: '') + \
        check_box_tag(@setting.id, true, @setting.value?)
      end
    elsif @setting.format == 'list'
      text_area_tag(@setting.id, Array(@setting.value).join("\n"), rows: 3, cols: 40, class: 'form-control')
    elsif options[:options]
      select_tag(@setting.id, options_for_select(options[:options], @setting.value), class: 'form-control')
    else
      text_field_tag(@setting.id, @setting.value, size: 30, class: 'form-control')
    end
  end

  def setting_name(setting)
    I18n.t('name', scope: ['admin.settings', setting.section, setting.name], default: setting.name)
  end

  def setting_description(setting)
    content_tag(:span, class: 'help-block') do
      I18n.t('description', scope: ['admin.settings', setting.section, setting.name])
    end
  end

  def zoom_options
    (12..16).map{|zoom_level| [I18n.t('name', scope: ['admin.settings', 'System', "Zoom Level #{zoom_level}"]), zoom_level]}
  end

end<commit_msg>remove unnecessary zoom_options method<commit_after>module Administration::SettingsHelper

  def section_tab(label, name, active=false)
    content_tag(:li, class: active ? 'active' : nil) do
      link_to label, "##{name}", data: { toggle: 'tab' }
    end
  end

  def setting_row(section, name, options={}, &block)
    if @setting = @settings[section][name]
      content_tag(:div, class: "form-group setting#{@setting.id}") do
        label_tag(@setting.id, setting_name(@setting), class: 'col-sm-2 control-label') +
        content_tag(:div, class: 'col-sm-10') do
          if block_given?
            capture(&block)
          else
            setting_field(options)
          end +
          setting_description(@setting)
        end
      end
    end
  end

  def setting_field(options={})
    @setting = @settings[options[:section]][options[:name]] if options[:section] and options[:name]
    if @setting.format == 'boolean'
      content_tag(:div, class: 'checkbox') do
        hidden_field_tag(@setting.id, false, id: '') + \
        check_box_tag(@setting.id, true, @setting.value?)
      end
    elsif @setting.format == 'list'
      text_area_tag(@setting.id, Array(@setting.value).join("\n"), rows: 3, cols: 40, class: 'form-control')
    elsif options[:options]
      select_tag(@setting.id, options_for_select(options[:options], @setting.value), class: 'form-control')
    else
      text_field_tag(@setting.id, @setting.value, size: 30, class: 'form-control')
    end
  end

  def setting_name(setting)
    I18n.t('name', scope: ['admin.settings', setting.section, setting.name], default: setting.name)
  end

  def setting_description(setting)
    content_tag(:span, class: 'help-block') do
      I18n.t('description', scope: ['admin.settings', setting.section, setting.name])
    end
  end
  
end
{'fraction_non_alphanumeric': 0.15042598509052182, 'fraction_numerical': 0.007987220447284345, 'mean_word_length': 3.42, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5002670', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1170, 'n_words': 266}