.content_actions.clearfix - if settings[:batch] && settings[:current_index_view] == :table .btn-group a.btn.dropdown-toggle data-toggle="dropdown" href="#" = t 'admin.batch_actions.title' span.caret ul.dropdown-menu - batch_actions.each do |ba| li: a.batch_action_link href='#' data-form=ba.form data-action=ba.name data-confirm=ba.confirm = ba.title - if settings[:button_scopes] && button_scopes.present? .btn-group - button_scopes.each do |s| - next unless option_conditions_met?(s.options) - active = params[s.param_name] - url = url_for(s.param_name => (active ? nil : 1), index_view: params[:index_view]) a.btn href=url title=s.options[:title] class=[s.options[:class], ('active' if active), ('tool tool-bottom' if s.options[:title])] = s.options[:label] || s.options[:title] || t("admin.scopes.#{s.name}", default: s.name.to_s.titleize) - if s.options[:badge] - scope = s.apply(self, resource_class.accessible_by(current_ability)) - scope_count = scope.send(*[s.options[:badge][:value_type] || :count, s.options[:badge][:column]].compact) - unless scope_count.zero? span.badge< class=("badge-#{s.options.dig(:badge, :type) || 'important'} #{'pulse' if s.options.dig(:badge, :pulse)}") = scope_count - if settings[:current_index_view] == :table .btn-group#columns_hider_wrap a.btn.dropdown-toggle data-toggle="dropdown" href="#" = t 'admin.columns_hider.button' span.caret .dropdown-menu .btn-group#view_layout .btn data-css='main_wide' = icon('align-left') .btn data-css='main_reverse' = icon('align-right') - if settings[:index_views].length > 1 .btn-group#index_views - settings[:index_views].each do |index_view| = index_view_link(index_view) - if settings[:export] && can?(:export, resource_class) .btn-group.downloads = icon('download-alt') - %w(csv xlsx).each do |format| - next if format == 'xlsx' && !Mime[:xlsx] = link_to format, params_for_links.merge(per_page: 10_000, format: format), id: "export_#{format}" - if ransack_collection && settings[:sort_buttons] .btn-group - settings[:sort_buttons].each do |opts| = list_sort_link(opts[:title], column: opts[:column], html_options: {class: 'btn'}) - if collection_action? && settings[:aggregations] .aggregations - settings[:aggregations].each do |ag| .label> class=(ag[:css] || 'label-success') => ag[:label] || "#{ag[:column].to_s.humanize}:" - if !ag[:type] || ag[:type] == :sum - res = search_collection.unscope(:includes).distinct(false).sum(ag[:column]) = number_with_delimiter(res.round(2), delimiter: ' ') if res - elsif ag[:type] == :average - res = search_collection.unscope(:includes).average(ag[:column]) = number_with_delimiter(res.round(2), delimiter: ' ') if res - elsif ag[:type] == :pct - sc_count = search_collection.count - if sc_count.zero? | 0% - else = "#{(search_collection.where.not(ag[:column] => nil).count.to_f / search_collection.count * 100).try!(:round, 2)}%"