- if searchable_model?(model_class) || decorator_class(model_class).list_filters.any? .col-md-8 .search = form_tag records_path, class: 'form-inline', method: :get do |f| - if searchable_model?(model_class) = text_field_tag :search, params[:search], class: 'text form-control' = hidden_field_tag :model, params[:model] = hidden_field_tag :scope, params[:scope] = hidden_field_tag :filter, (params[:filter].is_a?(ActionController::Parameters) ? params[:filter].permit!.to_h.to_json : params[:filter]) - decorator_class(model_class).list_filters.each_slice(3) do |slice| .row-fluid.filters - slice.each do |filter| - case filter[1][:type] - when :select .col-md-4 = label_tag t("admin.filters.#{model_class.to_s.underscore}.#{filter[0]}") = select_tag "list_filters[#{filter[0]}]", build_options_for_select(filter[0], filter[1][:select_collection]), include_blank: true, class: 'form-control' - when :dates .col-md-8.dates_filter .begin_date = label_tag t("admin.filters.#{model_class.to_s.underscore}.#{filter[0]}.begin_date") = text_field_tag "list_filters[#{filter[0]}][begin_date]", '', class: 'form-control', id: 'filter_datepicker_begin_date', value: params.dig(:list_filters, filter[0], :begin_date) %span \ - .end_date = label_tag t("admin.filters.#{model_class.to_s.underscore}.#{filter[0]}.end_date") = text_field_tag "list_filters[#{filter[0]}][end_date]", '', class: 'form-control', id: 'filter_datepicker_end_date', value: params.dig(:list_filters, filter[0], :end_date) :javascript $(function () { $('#filter_datepicker_begin_date').datepicker(); $('#filter_datepicker_end_date').datepicker(); }); .row-fluid.filters .col-md-4.offset-md-8.submit = submit_tag t('helpers.actions.search'), class: 'btn btn-primary'