Sha256: 207af66110c153381c875fa424a8a84d9aa9120db488310a906a4786cac50351

Contents?: true

Size: 1.78 KB

Versions: 4

Compression:

Stored size: 1.78 KB

Contents

<div data-model-id="<%= @resource.model.id %>">
  <% @resource.panels.each do |resource_panel| %>
    <%= form_with model: @resource.model,
        scope: @resource.form_scope,
        url: helpers.resource_path(model: @resource.model, resource: @resource),
        method: :put,
        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 %>
          <%= a_link back_path, icon: 'arrow-left' do %>
            <%= t('avo.cancel').capitalize %>
          <% end %>
          <% if can_see_the_save_button? %>
            <%= a_button color: :green, spinner: true, type: :submit, icon: 'save' do %>
              <%= t('avo.save').capitalize %>
            <% end %>
          <% end %>
        <% 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, spinner: 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

4 entries across 4 versions & 1 rubygems

Version Path
avo-2.1.2.pre2 app/components/avo/views/resource_edit_component.html.erb
avo-2.1.2.pre1 app/components/avo/views/resource_edit_component.html.erb
avo-2.1.1 app/components/avo/views/resource_edit_component.html.erb
avo-2.1.0 app/components/avo/views/resource_edit_component.html.erb