Sha256: 707b9b7f2b5a5b5ef55d50fbef5cd4e380102d8576bfe0f772ffd78bf46b2b83
Contents?: true
Size: 1.99 KB
Versions: 10
Compression:
Stored size: 1.99 KB
Contents
<%= content_tag :div, data: { model_name: @resource.model_name.to_s, resource_name: @resource.class.to_s, record_id: @resource.record.id, selected_resources_name: @resource.model_key, selected_resources: [@resource.record.id], **@resource.stimulus_data_attributes } do %> <%= render Avo::PanelComponent.new(name: title, description: @resource.description, display_breadcrumbs: @reflection.blank?, index: 0, data: { panel_id: "main" }) do |c| %> <% c.with_tools do %> <% @resource.render_show_controls.each do |control| %> <%= render_control control %> <% end %> <% end %> <% if main_panel.present? %> <% c.with_body do %> <%# the overflow helps with long values %> <div class="divide-y overflow-auto"> <% main_panel.items.each_with_index do |field, index| %> <%= render field .hydrate(resource: @resource, record: @resource.record, user: @resource.user, view: view) .component_for_view(view) .new(field: field, resource: @resource, index: index, compact: sidebar.present?) %> <% end %> </div> <% end %> <% end %> <% if sidebar.present? %> <% c.with_sidebar do %> <%= render sidebar_component %> <% end %> <% end %> <% end %> <% if @reflection.blank? %> <%= content_tag :div, class: 'space-y-12 mt-12' do %> <% @resource.get_items.each_with_index do |item, index| %> <% next if item.nil? %> <%= render Avo::ItemSwitcherComponent.new resource: @resource, reflection: @reflection, item: item, index: index + 1, view: @view %> <% end %> <% end %> <% end %> <% if should_display_invalid_fields_errors? %> <turbo-stream action="append" target="alerts"> <template> <% @resource.invalid_fields.each do |error| %> <%= render Avo::AlertComponent.new :error, error[:message] %> <% end %> </template> </turbo-stream> <% end %> <% end %>
Version data entries
10 entries across 10 versions & 1 rubygems