Sha256: 9c3b5c6ef1f1379b8feab1cda8ac28466100e1e86277f0d67400387dcb99498b

Contents?: true

Size: 1.16 KB

Versions: 27

Compression:

Stored size: 1.16 KB

Contents

<% if @resources.present? %>
  <turbo-frame id="<%= @resource.model_key %>_list" target="_top" class="relative w-full">
    <%= content_tag :div,
      class:"w-full grid grid-cols-1 xs:grid-cols-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6 gap-6 mt-8",
      data: {
        component_name: self.class.to_s.underscore,
        selected_resources_name: @resource.model_key,
        selected_resources: [],
        **(try(:drag_reorder_data_attributes) || {})
      } do %>
      <% @resources.each_with_index do |resource, index| %>
        <% cache_if Avo.configuration.cache_resources_on_index_view, resource.cache_hash(@parent_record) do %>
          <%= render(resource.resolve_component(Avo::Index::GridItemComponent).new(resource: resource, reflection: @reflection, parent_record: @parent_record, parent_resource: @parent_resource, actions: actions)) %>
        <% end %>
      <% end %>
    <% end %>
  </turbo-frame>
<% else %>
  <div class="bg-white rounded shadow-panel"
    data-component-name="<%= self.class.to_s.underscore %>">
    <%= helpers.empty_state by_association: params[:related_name].present?, view_type: :grid %>
  </div>
<% end %>

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
avo-3.16.1 app/components/avo/index/resource_grid_component.html.erb
avo-3.16.0 app/components/avo/index/resource_grid_component.html.erb
avo-3.15.7 app/components/avo/index/resource_grid_component.html.erb
avo-3.15.6 app/components/avo/index/resource_grid_component.html.erb
avo-3.15.5 app/components/avo/index/resource_grid_component.html.erb
avo-3.15.4 app/components/avo/index/resource_grid_component.html.erb
avo-3.15.3 app/components/avo/index/resource_grid_component.html.erb
avo-3.15.2 app/components/avo/index/resource_grid_component.html.erb
avo-3.15.1 app/components/avo/index/resource_grid_component.html.erb
avo-3.15.0 app/components/avo/index/resource_grid_component.html.erb
avo-3.14.5 app/components/avo/index/resource_grid_component.html.erb
avo-3.14.4 app/components/avo/index/resource_grid_component.html.erb
avo-3.14.3 app/components/avo/index/resource_grid_component.html.erb
avo-3.14.2 app/components/avo/index/resource_grid_component.html.erb
avo-3.14.1 app/components/avo/index/resource_grid_component.html.erb
avo-3.14.0 app/components/avo/index/resource_grid_component.html.erb
avo-3.13.7 app/components/avo/index/resource_grid_component.html.erb
avo-3.13.6 app/components/avo/index/resource_grid_component.html.erb
avo-3.13.5 app/components/avo/index/resource_grid_component.html.erb
avo-3.13.4 app/components/avo/index/resource_grid_component.html.erb