- for_context ||= context - if for_context.count == 0 h2: small = t 'admin_it.collection.no_data' - else - for_context.entities.each_with_index do |record, index| .col-md-3 .thumbnail.admin-tile / header = field for_context.field(for_context.header), tag: 'h4', context: for_context - images = for_context.fields(scope: {editor: :image}) - if images.size > 0 img src=images.first.read(record) / buttons - actions = for_context.resource.singles.select { |c| !(c <= AdminIt::NewContext) } - if actions.size > 0 .btn-group-vertical.btn-group-sm.pull-right.admin-tile-actions.fade - actions.each do |context_class| - params = {} - opts = { class: context_class <= AdminIt::ShowContext ? 'btn-info' : 'btn-default' } - if for_context.child? - opts[:data] = { toggle: :modal, target: '#child_modal' } - params[:layout] = :dialog - params[:parent] = for_context.parent - opts[:href] = context_class.url(for_context.entity, **params) a.btn *opts i.fa class="fa-#{context_class.icon}" - if resource.destroyable? = link_to for_context.resource[:show].url(for_context.entity), \ method: :delete, class: %w(btn btn-danger) do i.fa.fa-trash-o / fields - for_context.fields.each do |f| - next if f.name == for_context.header - next if f.type == :relation - next if f.editor == :image p strong = f.display_name + ': ' = field f, tag: 'span', context: for_context - if index > 0 && (index + 1) % 4 == 0 .clearfix