Sha256: 6a677e433f4e11a04012f676ebe9912099e2a18850821372c482308a368e92d8

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 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(item, float: 'end', class: 'mb-3') %>
<% 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-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) %>
            <%= controller.helpers.render partial: 'active_element/components/secret/field',
                                          locals: { secret: value_mapper.call(item), label: label } %>
          <% else %>
            <%= value_mapper.call(item) %>
          <% end %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_element-0.0.3 app/views/active_element/components/table/item.html.erb
active_element-0.0.2 app/views/active_element/components/table/item.html.erb