Sha256: 0e6cb8466ed40fce3632333a3c797222778d5c6baddff42ec9865c076d9d603b

Contents?: true

Size: 1.29 KB

Versions: 46

Compression:

Stored size: 1.29 KB

Contents

<% if @field.value %>
  <turbo-frame id="<%= @field.turbo_frame %>" src="<%= @field.frame_url %>" target="_top" class="block">
    <%= render(Avo::LoadingComponent.new(title: @field.name)) %>
  </turbo-frame>
<% else %>
  <%= render Avo::PanelComponent.new(name: @field.name) do |c| %>
    <% c.with_tools do %>
      <% if !@field.is_readonly? && !@field.is_disabled? && can_attach? %>
        <%= a_link attach_path,
          icon: 'heroicons/outline/link',
          color: :primary,
          style: :text,
          'data-turbo-frame': 'attach_modal' do %>
          <%= t('avo.attach_item', item: @field.name.humanize(capitalize: false)) %>
        <% end %>
      <% end %>
      <% if !@field.is_readonly? && !@field.is_disabled? && can_see_the_create_button? %>
        <%= a_link create_path,
          icon: 'heroicons/outline/plus',
          'data-target': 'create',
          'data-turbo-frame': '_top',
          style: :primary,
          color: :primary do %>
          <%= t('avo.create_new_item', item: @field.name.humanize(capitalize: false) ) %>
        <% end %>
      <% end %>
    <% end %>

    <% c.with_body do %>
      <div class="py-8 flex justify-center items-center">
        <%= empty_state by_association: params[:related_name].present? %>
      </div>
    <% end %>
  <% end %>
<% end %>

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
avo-3.2.3 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta23 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta20 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta21 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta17 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta22 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta18 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta19 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta24 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta15 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta16 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta14 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta12 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta13 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta10 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta11 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.0.pre19 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta8 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta9 app/components/avo/fields/has_one_field/show_component.html.erb
avo-3.0.1.beta6 app/components/avo/fields/has_one_field/show_component.html.erb