- 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.fa< class="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.btn.btn-success.btn-xs.pull-right href=for_context.url_for(filters: "-#{filter_class.filter_name}") i.fa.fa-filter> i.fa.fa-times-circle-o.text-danger - if for_context.sortable.include?(k) || !v_filter.nil? .btn-group.btn-group-xs.pull-right.fade data-toggle="popup-target" - unless for_context.sorting.include?("#{k}:asc") a.btn.btn-default href=for_context.url_for(sorting: "#{k}:asc") i.fa.fa-caret-down - unless for_context.sorting.include?("#{k}:desc") a.btn.btn-default href=for_context.url_for(sorting: "#{k}:desc") i.fa.fa-caret-up - if !filter_class.nil? && (active_filter.nil? || active_filter.values.empty?) a.btn.btn-info href=for_context.url_for(filters: "+#{filter_class.filter_name}", active_filter: filter_class.filter_name) i.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 } .modal.fade#confirm_modal .modal-dialog .modal-content