Sha256: 5d74383f31cb92501d7a43233635f291b3d6e62819e3b442eda91440804cff25

Contents?: true

Size: 1.94 KB

Versions: 17

Compression:

Stored size: 1.94 KB

Contents

<div>
  <% @resource.panels.each do |resource_panel| %>
    <%= form_with model: @resource.model,
      scope: @resource.form_scope,
      url: helpers.resources_path(
        resource: @resource,
        via_relation_class: params[:via_relation_class],
        via_relation: params[:via_relation],
        via_resource_id: params[:via_resource_id]
      ),
      local: true,
      multipart: true do |form| %>
      <%= render Avo::ReferrerParamsComponent.new back_path: back_path %>
      <%= render Avo::PanelComponent.new(title: resource_panel[:name], description: @resource.resource_description, display_breadcrumbs: true) do |c| %>
        <% c.tools do %>
          <div class="flex justify-end space-x-2">
            <%= a_link back_path, icon: 'arrow-left' do %>
              <%= t('avo.cancel').capitalize %>
            <% end %>
            <% if can_see_the_save_button? %>
              <%= a_button color: 'green', loading: true, type: :submit, icon: 'save' do %>
                <%= t('avo.save').capitalize %>
              <% end %>
            <% end %>
          </div>
        <% end %>
        <% if Avo.configuration.buttons_on_form_footers %>
          <% c.footer_tools do %>
            <%= a_link back_path, icon: 'arrow-left' do %>
              <%= t('avo.cancel').capitalize %>
            <% end %>
            <% if can_see_the_save_button? %>
              <%= a_button color: :green, loading: true, type: :submit, icon: 'save' do %>
                <%= t('avo.save').capitalize %>
              <% end %>
            <% end %>
          <% end %>
        <% end %>
        <% c.body do %>
          <div class="divide-y">
            <% @resource.get_fields.each_with_index do |field, index| %>
              <%= render field.component_for_view(:edit).new(field: field, resource: @resource, index: index, form: form) unless field.computed %>
            <% end %>
          </div>
        <% end %>
      <% end %>
    <% end %>
  <% end %>
</div>

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
avo-2.5.2.pre.7 app/components/avo/views/resource_new_component.html.erb
avo-2.5.2.pre.2 app/components/avo/views/resource_new_component.html.erb
avo-2.5.2.pre.1 app/components/avo/views/resource_new_component.html.erb
avo-2.5.1 app/components/avo/views/resource_new_component.html.erb
avo-2.5.0 app/components/avo/views/resource_new_component.html.erb
avo-2.4.1 app/components/avo/views/resource_new_component.html.erb
avo-2.4.0 app/components/avo/views/resource_new_component.html.erb
avo-2.3.1.pre.6 app/components/avo/views/resource_new_component.html.erb
avo-2.3.1.pre.5 app/components/avo/views/resource_new_component.html.erb
avo-2.3.1.pre.4 app/components/avo/views/resource_new_component.html.erb
avo-2.3.1.pre.3 app/components/avo/views/resource_new_component.html.erb
avo-2.3.1.pre.2 app/components/avo/views/resource_new_component.html.erb
avo-2.3.1.pre.1 app/components/avo/views/resource_new_component.html.erb
avo-2.3.0 app/components/avo/views/resource_new_component.html.erb
avo-2.2.2 app/components/avo/views/resource_new_component.html.erb
avo-2.2.1 app/components/avo/views/resource_new_component.html.erb
avo-2.2.0 app/components/avo/views/resource_new_component.html.erb