Sha256: b587e928642bcdc407ac841f9ed3faf299660d02ab846f2943979dec688e49c8

Contents?: true

Size: 1.76 KB

Versions: 16

Compression:

Stored size: 1.76 KB

Contents

<% filter_name = table_filter["name"].parameterize('_') %>
<% prompt = table_filter.fetch("prompt", "") %>

<div class="table-filter">
  <% if table_filter["type"] == "checkbox" %>
    <div class="dropdown checkbox-filter">
      <div class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <%= prompt %> <span class="z-icon-desc"></span>
      </div>
      <ul class="dropdown-menu" >
        <% table_filter["values"].each do |type| %>
          <li class="checkbox-row">
            <div class="checkbox">
              <input type="checkbox" name='<%= filter_name %>[]' value="<%= type %>">
              <label for="<%= filter_name %>"><%= type %></label>
            </div>
          </li>
        <% end %>
      </ul>
    </div>
  <% elsif ["select", "group-select"].include?(table_filter["type"]) %>
    <% option_tags = table_filter["type"] == "select" ? options_for_select(table_filter["values"]) : grouped_options_for_select(table_filter["values"]) %>
    <%= select_tag(filter_name, option_tags, options = {:prompt => prompt}) %>
    <% content_for :scripts do %>
      $('#<%= table_name %>_content select[name="<%= filter_name %>"]').select2({
        theme: "bootstrap",
        minimumResultsForSearch: <%= table_filter.key?("searchable") && table_filter["searchable"] ? 0 : -1 %>,
        width: '<%= table_filter.fetch('width', '100%') %>',
        dropdownAutoWidth: true,
        placeholder: '<%= table_filter.fetch('placeholder', '') %>',
        allowClear: <%= table_filter.fetch('allow-clear', true) %>
      });
    <% end %>
  <% elsif table_filter["type"] == "boolean" %>
    <input type="checkbox" value="true" name="<%= filter_name %>">
    <label for="<%= filter_name %>"><%= table_filter["name"] %></label>
  <% end %>
</div>

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
zuora_connect_ui-0.3.1f app/views/partials/_filters.html.erb
zuora_connect_ui-0.3.1e app/views/partials/_filters.html.erb
zuora_connect_ui-0.3.1d app/views/partials/_filters.html.erb
zuora_connect_ui-0.3.1 app/views/partials/_filters.html.erb
zuora_connect_ui-0.3.0 app/views/partials/_filters.html.erb
zuora_connect_ui-0.2.13 app/views/partials/_filters.html.erb
zuora_connect_ui-0.2.12 app/views/partials/_filters.html.erb
zuora_connect_ui-0.2.10 app/views/partials/_filters.html.erb
zuora_connect_ui-0.2.9 app/views/partials/_filters.html.erb
zuora_connect_ui-0.2.8 app/views/partials/_filters.html.erb
zuora_connect_ui-0.2.7 app/views/partials/_filters.html.erb
zuora_connect_ui-0.2.6 app/views/partials/_filters.html.erb
zuora_connect_ui-0.2.5 app/views/partials/_filters.html.erb
zuora_connect_ui-0.2.4 app/views/partials/_filters.html.erb
zuora_connect_ui-0.2.3 app/views/partials/_filters.html.erb
zuora_connect_ui-0.2.2 app/views/partials/_filters.html.erb