Sha256: cb03c5ef28c8d350ca89f6d2aa253000e84b67dd5bf0b77787f62f3dd55d2c4c

Contents?: true

Size: 1.57 KB

Versions: 2

Compression:

Stored size: 1.57 KB

Contents

<%= search_form_for @q do |f| %>
  <fieldset style="display:table;border-spacing:10px;">
    <% index_filter_attributes
            .reject { |filter_attribute| exclude_index_filter_attributes.find { |eifa| (filter_attribute.is_a?(Array) ? filter_attribute[0] : filter_attribute ) =~ /#{eifa}/ } }
            .in_groups_of(5, false).each do |filter_attributes| %>
      <div class="fields" style="display:table-row">

        <% filter_attributes.each do |filter_attribute| %>
          <div class="field" style="display:table-cell">
            <% attribute_name   = filter_attribute.is_a?(Array) ? filter_attribute[0] : filter_attribute %>
            <% attribute_values = filter_attribute.is_a?(Array) ? filter_attribute[1] : [] %>

            <label> <b><%= t(attribute_name) %>:</b></label><br />
            <% if !attribute_values.blank? %>
              <%= f.select attribute_name, attribute_values.map { |k,v| [v,k] }, { include_blank: t(:all_field), selected: params[:q] ? params[:q][attribute_name] : '' } %>
            <% elsif attribute_name =~ /true/ %>
              <%= f.select attribute_name, [[t(:true_field), 1], [t(:false_field), 0]], { include_blank: t(:all_field), selected: params[:q] ? params[:q][attribute_name] : '' } %>
            <% elsif attribute_name =~ /cont|eq/ %>
              <%= f.search_field attribute_name %>
            <% else %>
              <%= render "#{attribute_name}_filter" %>
            <% end %>
            <br /><br />
          </div>
        <% end %>
        <br /><br />
      </div>
    <% end %>

    <%= f.submit %>
  </fieldset>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cruj_cruj_cruj_visagio-1.0.7 app/views/cruj_cruj_cruj/_filters.html.erb
cruj_cruj_cruj_visagio-1.0.6 app/views/cruj_cruj_cruj/_filters.html.erb