<% query = params[:query] params = request.params.except(:authenticity_token, :action, :controller, :utf8, :bulk_export) 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).fields_for_table checkboxes = @model_config.list.checkboxes? table_table_header_count = begin count = checkboxes ? 1 : 0 count = count + properties.count end %> <% content_for :contextual_tabs do %> <% if filterable_fields.present? %> <% end %> <% if checkboxes %> <%= bulk_menu %> <% end %> <% end %>
<%= form_tag(index_path(params.except(*%w[page f query])), method: :get) do %>

" type="search" value="<%= query %>" />
<% if @model_config.list.search_help.present? %>
<%= @model_config.list.search_help %>
<% end %>
<% if export_action %> <%= link_to wording_for(:link, export_action), export_path(params.except('page')), class: 'btn btn-info' %> <% end %>
<% end %> <% unless @model_config.list.scopes.empty? %> <% end %> <%= form_tag bulk_action_path(model_name: @abstract_model.to_param), method: :post, id: "bulk_form", class: ["form", "mb-3"] do %> <%= hidden_field_tag :bulk_action %> <% if description.present? %>

<%= description %>

<% end %>
<% if checkboxes %> <% end %> <% properties.each do |property| %> <% selected = (sort == property.name.to_s) %> <% if property.sortable %> <% sort_location = index_path params.except('sort_reverse').except('page').merge(sort: property.name).merge(selected && sort_reverse != "true" ? {sort_reverse: "true"} : {}) %> <% sort_direction = (sort_reverse == 'true' ? "headerSortUp" : "headerSortDown" if selected) %> <% end %> <% end %> <% @objects.each do |object| %> <% if checkboxes %> <% end %> <% properties.map{ |property| property.bind(:object, object) }.each do |property| %> <% value = property.pretty_value %> <% end %> <% end %> <% if @objects.empty? %> <% end %>
" data-href="<%= property.sortable && sort_location %>" rel="tooltip" title="<%= property.hint %>"> <%= property.label %>
<%= check_box_tag "bulk_ids[]", object.id.to_s, false %> <%= value %>
<%= I18n.t('admin.actions.index.no_records') %>
<% if @model_config.list.limited_pagination %>
<%= paginate(@objects, theme: 'ra-twitter-bootstrap/without_count', total_pages: Float::INFINITY) %>
<% elsif @objects.respond_to?(:total_count) %> <% total_count = @objects.total_count.to_i %>
<%= paginate(@objects, theme: 'ra-twitter-bootstrap') %>
<%= link_to(t("admin.misc.show_all"), index_path(params.merge(all: true)), class: "show-all btn btn-light clearfix") unless total_count > 100 || total_count <= @objects.to_a.size %>
<%= "#{total_count} #{@model_config.pluralize(total_count).downcase}" %>
<% else %>
<%= "#{@objects.size} #{@model_config.pluralize(@objects.size).downcase}" %>
<% end %> <% end %>