Sha256: d84daeacac2ee31b84bafed21b09a75dea595457f75b69f9aa42ee77739d9aa3

Contents?: true

Size: 1.23 KB

Versions: 11

Compression:

Stored size: 1.23 KB

Contents

<%= turbo_frame_tag 'attach_modal' do %>
  <%= form_with scope: 'fields',
    url: "#{Avo.configuration.root_path}/resources/#{params[:resource_name]}/#{params[:id]}/#{params[:related_name]}/",
    data: {
      'turbo-frame': '_top'
    } do |form| %>
    <%= render Avo::ModalComponent.new do |c| %>
      <% c.heading do %>
        <%= t 'avo.choose_item', item: params[:related_name].downcase %>
      <% end %>

      <div class="flex-1 flex items-center justify-center px-8 text-lg mt-8 mb-12">
        <div class="flex-1 flex flex-col items-center justify-center px-24 text-base">
          <%= form.select :related_id, options_for_select(@options.map { |o| [o[:label], o[:value]] }, nil),
            {
              include_blank: t('avo.choose_an_option'),
            },
            {
              class: input_classes('w-full'),
            }
          %>
        </div>
      </div>

      <%#= form.hidden_field :resource_ids, value: params[:resource_ids], 'data-action-target': 'resourceIds' %>

      <% c.controls do %>
        <%= a_button t('avo.cancel'), 'data-action': 'click->modal#close', size: :sm %>
        <%= a_button t('avo.attach'), type: :submit, color: :green, size: :sm %>
      <% end %>
    <% end %>
  <% end %>
<% end %>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
avo-1.7.2 app/views/avo/relations/new.html.erb
avo-1.7.1 app/views/avo/relations/new.html.erb
avo-1.7.0 app/views/avo/relations/new.html.erb
avo-1.6.4.pre.1 app/views/avo/relations/new.html.erb
avo-1.6.3.pre.3 app/views/avo/relations/new.html.erb
avo-1.6.3.pre.2 app/views/avo/relations/new.html.erb
avo-1.6.3.pre.1 app/views/avo/relations/new.html.erb
avo-1.6.2.pre.1 app/views/avo/relations/new.html.erb
avo-1.6.1 app/views/avo/relations/new.html.erb
avo-1.6.0 app/views/avo/relations/new.html.erb
avo-1.5.5 app/views/avo/relations/new.html.erb