%= content_tag :div, data: { model_name: @resource.model_name.to_s, resource_name: @resource.class.to_s, model_id: @resource.model.id, selected_resources_name: @resource.model_key, selected_resources: [@resource.model.id], **@resource.stimulus_data_attributes } do %> <%= form_with model: @resource.model, scope: @resource.form_scope, url: form_url, method: form_method, local: true, html: { novalidate: true }, multipart: true do |form| %> <%= render Avo::ReferrerParamsComponent.new back_path: back_path %> <%= content_tag :div, class: 'space-y-12' do %> <%= render Avo::PanelComponent.new(name: title, description: @resource.resource_description, display_breadcrumbs: @reflection.blank?, index: 0, data: { panel_id: "main" }) do |c| %> <% c.tools do %> <%= a_link back_path, style: :text, icon: 'arrow-left' do %> <%= t('avo.cancel').capitalize %> <% end %> <% if can_see_the_destroy_button? %> <%= a_link destroy_path, style: :text, color: :red, icon: 'trash', form_class: 'flex flex-col sm:flex-row sm:inline-flex', data: { turbo_confirm: t('avo.are_you_sure', item: @resource.model.model_name.name.downcase), turbo_method: :delete, control: :destroy, 'resource-id': @resource.model.id, } do %> <%= t('avo.delete').capitalize %> <% end %> <% end %> <% if can_see_the_actions_button? %> <%= render Avo::ActionsComponent.new actions: @actions, resource: @resource, view: @view %> <% end %> <% if can_see_the_save_button? %> <%= a_button color: :primary, style: :primary, loading: true, type: :submit, icon: 'save' do %> <%= t('avo.save').capitalize %> <% end %> <% end %> <% end %> <%# Extract the main panel and display the fields here. %> <%# This way we'll be able to render the footer buttons under the main fields. %> <% if main_panel.present? %> <% c.body do %>