<commit_before>:ruby
  require 'rails_admin/config/fields/types/datetime.rb'
  query = params[:query]
  params = request.params.except(:authenticity_token, :action, :controller, :utf8, :bulk_export, :_pjax)
  params.delete(:query) if params[:query].blank?
  params.delete(:sort_reverse) unless params[:sort_reverse] == 'true'
  sort_reverse = params[:sort_reverse]
  sort = params[:sort]
  params.delete(:sort) if params[:sort] == @model_config.list.sort_by.to_s

  export_action = RailsAdmin::Config::Actions.find(:export, { controller: self.controller, abstract_model: @abstract_model })
  export_action = nil unless export_action && authorized?(export_action.authorization_key, @abstract_model)

  description = RailsAdmin.config(@abstract_model.model_name).description
  properties = @model_config.list.with(controller: self.controller, view: self, object: @abstract_model.model.new).visible_fields
  # columns paginate
  @filterable_fields = @model_config.list.fields.select(&:filterable?)
  sets = get_column_sets(properties)
  properties = sets[params[:set].to_i] || []
  other_left = ((params[:set].to_i - 1) >= 0) && sets[params[:set].to_i - 1].present?
  other_right = sets[params[:set].to_i + 1].present?
  @index = 0
  @ordered_filters = (params[:f] || @model_config.list.filters).inject({}) { |memo, filter|
    field_name = filter.is_a?(Array) ? filter.first : filter
  (filter.is_a?(Array) ? filter.last : { (@index += 1) => { "v" => '' } }) .each do |index, filter_hash|
      unless filter_hash['disabled']
        memo[index] = { field_name => filter_hash }
      else
        params[:f].delete(field_name)
      end
    end
    memo
  }.to_a.sort_by(&:first)

  @ordered_filter_string = @ordered_filters.map do |duplet|
    filter_index = duplet[0]
    filter_for_field = duplet[1]
    filter_name = filter_for_field.keys.first
    filter_hash = filter_for_field.values.first
    field = @filterable_fields.find{ |field| field.name == filter_name.to_sym }
    unless field
      fail "#{filter_name} is not currently filterable; filterable fields are #{@filterable_fields.map(&:name).join(', ')}"
    end
    field_options = case field.type
    when :enum
      options_for_select(field.with(object: @abstract_model.model.new).enum, filter_hash['v'])
    else
      ''
    end
    %{
      $.filters.append(#{field.label.to_json}, #{field.name.to_json}, #{field.type.to_json}, #{filter_hash['v'].to_json}, #{filter_hash['o'].to_json}, #{field_options.to_json}, #{filter_index.to_json});
    }
  end.join.html_safe if @ordered_filters


= content_for :contextual_tabs do
  = bulk_menu
  - if @filterable_fields.present?
    %li.dropdown{style: 'float:right'}
      %a.dropdown-toggle{href: '#', :'data-toggle' => "dropdown"}
        = t('admin.misc.add_filter')
        %b.caret
      %ul.dropdown-menu#filters{style: 'left:auto; right:0;'}
        - @filterable_fields.each do |field|
          - field_options = case field.type
          - when :enum
            - options_for_select(field.with(object: @abstract_model.model.new).enum)
          - else
            - ''
          %li
            %a{href: '#', :"data-field-label" => field.label, :"data-field-name" => field.name, :"data-field-options" => field_options.html_safe, :"data-field-type" => field.type, :"data-field-value" => ""}= capitalize_first_letter(field.label)

#list
  %script
    jQuery(function($) {
    $.filters.options.regional = {
    datePicker: {
    dateFormat: #{raw I18n.t("admin.misc.filter_date_format", default: I18n.t("admin.misc.filter_date_format", locale: :en)).to_json},
    dayNames: #{raw RailsAdmin::Config::Fields::Types::Datetime.day_names.to_json},
    dayNamesShort: #{raw RailsAdmin::Config::Fields::Types::Datetime.abbr_day_names.to_json},
    dayNamesMin: #{raw RailsAdmin::Config::Fields::Types::Datetime.abbr_day_names.to_json},
    firstDay: "1",
    monthNames: #{raw RailsAdmin::Config::Fields::Types::Datetime.month_names.to_json},
    monthNamesShort: #{raw RailsAdmin::Config::Fields::Types::Datetime.abbr_month_names.to_json}
    }
    }

    = @ordered_filter_string

    });
  %style
    - properties.select{ |p| p.column_width.present? }.each do |property|
      = "#list th.#{property.css_class} { width: #{property.column_width}px; min-width: #{property.column_width}px; }"
      = "#list td.#{property.css_class} { max-width: #{property.column_width}px; }"
  = form_tag(index_path(params.except(*%w[page f query])), method: :get, class: "pjax-form form-inline") do
    .well
      %span#filters_box
      %hr.filters_box{style: "display:#{@ordered_filters.empty? ? 'none' : 'block'}"}
      %input.input-small{name: "query", type: "search", value: query, placeholder: t("admin.misc.filter")}
      %button.btn.btn-primary{type: "submit", :'data-disable-with' => "<i class='icon-white icon-refresh'></i> ".html_safe + t("admin.misc.refresh")}
        %i.icon-white.icon-refresh
        = t("admin.misc.refresh")<commit_msg>Fixed css class for filter field<commit_after>:ruby
  require 'rails_admin/config/fields/types/datetime.rb'
  query = params[:query]
  params = request.params.except(:authenticity_token, :action, :controller, :utf8, :bulk_export, :_pjax)
  params.delete(:query) if params[:query].blank?
  params.delete(:sort_reverse) unless params[:sort_reverse] == 'true'
  sort_reverse = params[:sort_reverse]
  sort = params[:sort]
  params.delete(:sort) if params[:sort] == @model_config.list.sort_by.to_s

  export_action = RailsAdmin::Config::Actions.find(:export, { controller: self.controller, abstract_model: @abstract_model })
  export_action = nil unless export_action && authorized?(export_action.authorization_key, @abstract_model)

  description = RailsAdmin.config(@abstract_model.model_name).description
  properties = @model_config.list.with(controller: self.controller, view: self, object: @abstract_model.model.new).visible_fields
  # columns paginate
  @filterable_fields = @model_config.list.fields.select(&:filterable?)
  sets = get_column_sets(properties)
  properties = sets[params[:set].to_i] || []
  other_left = ((params[:set].to_i - 1) >= 0) && sets[params[:set].to_i - 1].present?
  other_right = sets[params[:set].to_i + 1].present?
  @index = 0
  @ordered_filters = (params[:f] || @model_config.list.filters).inject({}) { |memo, filter|
    field_name = filter.is_a?(Array) ? filter.first : filter
  (filter.is_a?(Array) ? filter.last : { (@index += 1) => { "v" => '' } }) .each do |index, filter_hash|
      unless filter_hash['disabled']
        memo[index] = { field_name => filter_hash }
      else
        params[:f].delete(field_name)
      end
    end
    memo
  }.to_a.sort_by(&:first)

  @ordered_filter_string = @ordered_filters.map do |duplet|
    filter_index = duplet[0]
    filter_for_field = duplet[1]
    filter_name = filter_for_field.keys.first
    filter_hash = filter_for_field.values.first
    field = @filterable_fields.find{ |field| field.name == filter_name.to_sym }
    unless field
      fail "#{filter_name} is not currently filterable; filterable fields are #{@filterable_fields.map(&:name).join(', ')}"
    end
    field_options = case field.type
    when :enum
      options_for_select(field.with(object: @abstract_model.model.new).enum, filter_hash['v'])
    else
      ''
    end
    %{
      $.filters.append(#{field.label.to_json}, #{field.name.to_json}, #{field.type.to_json}, #{filter_hash['v'].to_json}, #{filter_hash['o'].to_json}, #{field_options.to_json}, #{filter_index.to_json});
    }
  end.join.html_safe if @ordered_filters


= content_for :contextual_tabs do
  = bulk_menu
  - if @filterable_fields.present?
    %li.dropdown{style: 'float:right'}
      %a.dropdown-toggle{href: '#', :'data-toggle' => "dropdown"}
        = t('admin.misc.add_filter')
        %b.caret
      %ul.dropdown-menu#filters{style: 'left:auto; right:0;'}
        - @filterable_fields.each do |field|
          - field_options = case field.type
          - when :enum
            - options_for_select(field.with(object: @abstract_model.model.new).enum)
          - else
            - ''
          %li
            %a{href: '#', :"data-field-label" => field.label, :"data-field-name" => field.name, :"data-field-options" => field_options.html_safe, :"data-field-type" => field.type, :"data-field-value" => ""}= capitalize_first_letter(field.label)

#list
  %script
    jQuery(function($) {
    $.filters.options.regional = {
    datePicker: {
    dateFormat: #{raw I18n.t("admin.misc.filter_date_format", default: I18n.t("admin.misc.filter_date_format", locale: :en)).to_json},
    dayNames: #{raw RailsAdmin::Config::Fields::Types::Datetime.day_names.to_json},
    dayNamesShort: #{raw RailsAdmin::Config::Fields::Types::Datetime.abbr_day_names.to_json},
    dayNamesMin: #{raw RailsAdmin::Config::Fields::Types::Datetime.abbr_day_names.to_json},
    firstDay: "1",
    monthNames: #{raw RailsAdmin::Config::Fields::Types::Datetime.month_names.to_json},
    monthNamesShort: #{raw RailsAdmin::Config::Fields::Types::Datetime.abbr_month_names.to_json}
    }
    }

    = @ordered_filter_string

    });
  %style
    - properties.select{ |p| p.column_width.present? }.each do |property|
      = "#list th.#{property.css_class} { width: #{property.column_width}px; min-width: #{property.column_width}px; }"
      = "#list td.#{property.css_class} { max-width: #{property.column_width}px; }"
  = form_tag(index_path(params.except(*%w[page f query])), method: :get, class: "pjax-form form-inline") do
    .well
      %span#filters_box
      %hr.filters_box{style: "display:#{@ordered_filters.empty? ? 'none' : 'block'}"}
      %input.form-control.input-small{name: "query", type: "search", value: query, placeholder: t("admin.misc.filter")}
      %button.btn.btn-primary{type: "submit", :'data-disable-with' => "<i class='icon-white icon-refresh'></i> ".html_safe + t("admin.misc.refresh")}
        %i.icon-white.icon-refresh
        = t("admin.misc.refresh")
{'fraction_non_alphanumeric': 0.16616374974854153, 'fraction_numerical': 0.0030175015087507543, 'mean_word_length': 4.14648033126294, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, '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': '4614983', 'n_tokens_mistral': 3384, 'n_tokens_neox': 3335, 'n_words': 534}