- for_context ||= context = render partial: File.join(%w(admin_it shared pagination)), \ locals: { for_context: for_context } - if for_context.count == 0 h2: small = t 'admin_it.collection.no_data' - else = table for_context, class: 'table-bordered table-condensed' do |_table| = _table.header do |header| - for_context.headers.each do |k, h| - opts = { :'data-toggle' => 'popup' } - active_sorting = for_context.sorting.find { |s| s.index("#{k}:") == 0 } - opts[:class] = 'text-info' unless active_sorting.nil? = header.cell opts do = h - unless active_sorting.nil? = ' ' i class="fa fa-caret-#{active_sorting.split(':').last == 'asc' ? 'down' : 'up'}" - filter_class = for_context.all_filters(scope: :value).find do |f| - f.field.field_name == k - unless filter_class.nil? - active_filter = for_context.filters.find { |f| f.is_a?(filter_class) } - if !active_filter.nil? && !active_filter.values.empty? a class="btn btn-success btn-xs pull-right" href==for_context.url_for(filters: "-#{filter_class.filter_name}") i class="fa fa-filter" = ' ' i class="fa fa-times-circle-o text-danger" - if for_context.sortable.include?(k) || !v_filter.nil? div class="btn-group btn-group-xs pull-right fade" data-toggle="popup-target" - unless for_context.sorting.include?("#{k}:asc") a class="btn btn-default" href==for_context.url_for(sorting: "#{k}:asc") i class="fa fa-caret-down" - unless for_context.sorting.include?("#{k}:desc") a class="btn btn-default" href==for_context.url_for(sorting: "#{k}:desc") i class="fa fa-caret-up" - if !filter_class.nil? && (active_filter.nil? || active_filter.values.empty?) a class="btn btn-info" href==for_context.url_for(filters: "+#{filter_class.filter_name}", active_filter: filter_class.filter_name) i class="fa fa-filter" - if for_context.actions? th style='border: none' - for_context.entities.each do |entity| = _table.row do |row| - for_context.fields.each { |f| row.cell f.show(entity).to_s, column: f.name } - if for_context.actions? = row.actions style: 'width: 80px; border: none', class: 'text-right' = render partial: File.join(%w(admin_it shared pagination)), \ locals: { for_context: for_context } div class="modal fade" id="confirm_modal" div class="modal-dialog" div class="modal-content"