Sha256: 4087dfaf5d87573ae2ceed34f97db0732cb48cc8fa808351f3b22ce13814940f
Contents?: true
Size: 1.87 KB
Versions: 17
Compression:
Stored size: 1.87 KB
Contents
- for_context ||= context - parent = for_context.child? ? for_context.parent : for_context - if for_context.count == 0 h2: small = t 'admin_it.collection.no_data' - else - params = {} - params[:section] = parent.section if parent.respond_to?(:section) - if for_context.child? - params[:layout] = :dialog - params[:parent] = for_context.parent - 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.admin-tile-actions.fade - actions.each do |context_class| - opts = { class: context_class <= AdminIt::ShowContext ? 'btn-info' : 'btn-default' } - if for_context.child? - opts[:data] = { toggle: :modal, target: '#child_modal' } - 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, **params), \ 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
Version data entries
17 entries across 17 versions & 1 rubygems