Sha256: 55087afa44ee99d1337d1e169af81a67a78ab938499abe91746deb6f9138babe

Contents?: true

Size: 1.59 KB

Versions: 15

Compression:

Stored size: 1.59 KB

Contents

<% if destroy && item.present? %>
  <%= active_element.component.destroy_button(item, destroy, float: 'end') %>
<% end %>

<% if edit && item.present? %>
  <%= active_element.component.edit_button(item, edit, float: 'end') %>
<% end %>

<% if new %>
  <%= active_element.component.new_button(component.model, float: 'end', class: 'mb-3') %>
<% end %>

<% if title.present? %>
  <%= active_element.component.page_section_title(title) %>
<% end %>

<table class="<%= class_name %> table" style="<%= style %>">
  <tbody>
    <% fields.each do |field, class_mapper, label, value_mapper, options| %>
      <tr>
        <th>
          <%= label %>
          <% if options[:description].present? %>
            <button type="button"
                    style="background: none; border: none; outline: 0; position: absolute; margin-top: 0.3rem"
                    data-bs-toggle="popover"
                    data-bs-trigger="focus"
                    data-bs-content="<%= options[:description] %>">
                    <i class="text-secondary fa-solid fa-circle-info"></i>
            </button>
          <% end %>
        </th>
        <td class="<%= class_mapper.call(item) %>">
          <% if component.secret_field?(field) %>
            <%= render partial: 'active_element/components/secret/field',
                       locals: { secret: value_mapper.call(item), label: label } %>
          <% else %>
            <%= render partial: 'active_element/components/table/field',
                       locals: { value: value_mapper.call(item) } %>
          <% end %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
active_element-0.0.31 app/views/active_element/components/table/item.html.erb
active_element-0.0.30 app/views/active_element/components/table/item.html.erb
active_element-0.0.29 app/views/active_element/components/table/item.html.erb
active_element-0.0.28 app/views/active_element/components/table/item.html.erb
active_element-0.0.27 app/views/active_element/components/table/item.html.erb
active_element-0.0.26 app/views/active_element/components/table/item.html.erb
active_element-0.0.24 app/views/active_element/components/table/item.html.erb
active_element-0.0.23 app/views/active_element/components/table/item.html.erb
active_element-0.0.22 app/views/active_element/components/table/item.html.erb
active_element-0.0.21 app/views/active_element/components/table/item.html.erb
active_element-0.0.19 app/views/active_element/components/table/item.html.erb
active_element-0.0.18 app/views/active_element/components/table/item.html.erb
active_element-0.0.17 app/views/active_element/components/table/item.html.erb
active_element-0.0.16 app/views/active_element/components/table/item.html.erb
active_element-0.0.15 app/views/active_element/components/table/item.html.erb