Sha256: 4d2d47a4bc7187189db94f72ff7b2e90c9944ecb1ab9f179ac553502998b38c1

Contents?: true

Size: 1.16 KB

Versions: 9

Compression:

Stored size: 1.16 KB

Contents

<% values = [] %>
<% fields.each do |field_name, type, options| %>
  <% value = component.value_for(field_name) %>

  <% if type == :check_box %>

    <% if ['1', true].include?(value) %>
      <% values << value %>
      <div class="d-inline me-3">
        <i class="text-success fa-regular fa-fw fa-circle-check"></i>
        <span><%= options.fetch(:label) %></span>
      </div>
    <% end %>

  <% elsif type == :select %>
      <% value = component.display_value_for_select(field_name, options) %>
      <% if value.present? %>
        <% values << value %>
        <div class="d-inline me-3">
          <span class="text-secondary"><%= options.fetch(:label) %>:</span>
          <span class="ms-1"><%= value %></span>
        </div>
      <% end %>
  <% elsif value.present? %>
    <%# TODO: Handle other field types %>

    <% values << value %>
    <div class="d-inline me-3">
      <span class="text-secondary"><%= options.fetch(:label) %>:</span>
      <span class="ms-1"><%= value %></span>
    </div>

  <% end %>
<% end %>

<% if values.empty? %>
  <div class="d-inline ms-3 me-3">
    <span class="fst-italic text-secondary">(No filters applied)</span>
  </div>
<% end %>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
active_element-0.0.10 app/views/active_element/components/form/_summary.html.erb
active_element-0.0.9 app/views/active_element/components/form/_summary.html.erb
active_element-0.0.8 app/views/active_element/components/form/_summary.html.erb
active_element-0.0.7 app/views/active_element/components/form/_summary.html.erb
active_element-0.0.6 app/views/active_element/components/form/_summary.html.erb
active_element-0.0.5 app/views/active_element/components/form/_summary.html.erb
active_element-0.0.4 app/views/active_element/components/form/_summary.html.erb
active_element-0.0.3 app/views/active_element/components/form/_summary.html.erb
active_element-0.0.2 app/views/active_element/components/form/_summary.html.erb