Sha256: cfd967e588e649ac71d1b0713e9391494da1cc8b2831f6c8f971821f8826caaa
Contents?: true
Size: 1.95 KB
Versions: 15
Compression:
Stored size: 1.95 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 type == :datetime_range_field %> <% next unless value.present? %> <% values << value %> <div class="d-inline me-3"> <span class="text-secondary"><%= options.fetch(:label) %>:</span> <span class="ms-1 text-primary"><%= value[:from] %></span> <span class="text-secondary">→</span> <span class="ms-1 text-primary"><%= value[:to] %></span> </div> <% elsif type == :date_range_field %> <% next unless value.present? %> <% values << value %> <div class="d-inline me-3"> <span class="text-secondary"><%= options.fetch(:label) %>:</span> <span class="ms-1 text-primary"><%= value[:from] %></span> <span class="text-secondary">→</span> <span class="ms-1 text-primary"><%= value[:to] %></span> </div> <% elsif value.class && 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
15 entries across 15 versions & 1 rubygems