Sha256: 7a27fbea782081164a94cf22723eb69c43721e1b8becaf5d8d492ee1767d16cc

Contents?: true

Size: 1.99 KB

Versions: 22

Compression:

Stored size: 1.99 KB

Contents

<%= content_tag :div,
  data: {
    model_name: @resource.model_name.to_s,
    resource_name: @resource.class.to_s,
    record_id: @resource.record.id,
    selected_resources_name: @resource.model_key,
    selected_resources: [@resource.record.to_param],
    **@resource.stimulus_data_attributes
  } do %>
  <%= render Avo::PanelComponent.new(name: title, description: @resource.description, display_breadcrumbs: @reflection.blank?, index: 0, data: { panel_id: "main" }) do |c| %>
    <% c.with_tools do %>
      <% @resource.render_show_controls.each do |control| %>
        <%= render_control control %>
      <% end %>
    <% end %>
    <% if main_panel.present? %>
      <% c.with_body do %>
        <%# the overflow helps with long values %>
        <div class="divide-y overflow-auto">
          <% main_panel.items.each_with_index do |field, index| %>
            <%= render field
              .hydrate(resource: @resource, record: @resource.record, user: @resource.user, view: view)
              .component_for_view(view)
              .new(field: field, resource: @resource, index: index, compact: sidebar.present?)
            %>
          <% end %>
        </div>
      <% end %>
    <% end %>
    <% if sidebar.present? %>
      <% c.with_sidebar do %>
        <%= render sidebar_component %>
      <% end %>
    <% end %>
  <% end %>
  <% if @reflection.blank? %>
    <%= content_tag :div, class: 'space-y-12 mt-12' do %>
      <% @resource.get_items.each_with_index do |item, index| %>
        <% next if item.nil? %>
        <%= render Avo::ItemSwitcherComponent.new resource: @resource, reflection: @reflection, item: item, index: index + 1, view: @view %>
      <% end %>
    <% end %>
  <% end %>
  <% if should_display_invalid_fields_errors? %>
    <turbo-stream action="append" target="alerts">
      <template>
        <% @resource.invalid_fields.each do |error| %>
          <%= render Avo::AlertComponent.new :error, error[:message] %>
        <% end %>
      </template>
    </turbo-stream>
  <% end %>
<% end %>

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
avo-3.0.1.beta23 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta20 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta21 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta17 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta22 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta18 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta19 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta15 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta16 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta14 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta12 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta13 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta10 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta11 app/components/avo/views/resource_show_component.html.erb
avo-3.0.0.pre19 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta8 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta9 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta6 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta7 app/components/avo/views/resource_show_component.html.erb
avo-3.0.1.beta5 app/components/avo/views/resource_show_component.html.erb