Sha256: bb5b1703c54d07e5b9e80f3533d2fcc2ed489360d97057ee56ff62e84b256397

Contents?: true

Size: 1.77 KB

Versions: 3

Compression:

Stored size: 1.77 KB

Contents

<% filter_name = table_filter["name"].parameterize(separator: '_') %>
<% 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

3 entries across 3 versions & 1 rubygems

Version Path
zuora_connect_ui-0.3.1c app/views/partials/_filters.html.erb
zuora_connect_ui-0.3.1b app/views/partials/_filters.html.erb
zuora_connect_ui-0.3.1a app/views/partials/_filters.html.erb