Sha256: a0836a4fb2dfe0752307110feeba6b4fb23d965b3a8920663e75982588f919ba

Contents?: true

Size: 1.17 KB

Versions: 7

Compression:

Stored size: 1.17 KB

Contents

<%
  set_value = filter.default.present? ? filter.default.select { |key, value| value }.keys.map(&:to_sym) : {}

  begin
    decoded_filters_param = JSON.parse(Base64.decode64(params[:filters]))
    if decoded_filters_param[filter.class.to_s].present?
      set_value = decoded_filters_param[filter.class.to_s]
    end
  rescue
  end
%>
<div data-controller="multiple-select-filter" data-filter-name="<%= filter.name %>">
  <%= filter_wrapper name: filter.name do %>
    <%= select_tag filter.id, options_for_select(filter.options.invert, set_value),
      class: input_classes('w-full mb-0'),
      multiple: true,
      id: "avo_filters_#{filter.id.parameterize.underscore}",
      'data-filter-class': filter.class.to_s,
      'data-multiple-select-filter-target': 'selector'
    %>
    <div class="flex justify-end">
      <%= a_button class: 'mt-4', color: :blue, size: :sm, data: { action: "multiple-select-filter#changeFilter" } do %>
        Filter by <%=filter.name %>
      <% end %>
    </div>
    <%= link_to 'url_redirect', request.url, data: { 'multiple-select-filter-target': 'urlRedirect', 'turbo-frame': params[:turbo_frame] }, style: 'hidden', class: 'hidden' %>
  <% end %>
</div>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
avo-2.3.1.pre.6 app/views/avo/base/_multiple_select_filter.html.erb
avo-2.3.1.pre.5 app/views/avo/base/_multiple_select_filter.html.erb
avo-2.3.1.pre.4 app/views/avo/base/_multiple_select_filter.html.erb
avo-2.3.1.pre.3 app/views/avo/base/_multiple_select_filter.html.erb
avo-2.3.1.pre.2 app/views/avo/base/_multiple_select_filter.html.erb
avo-2.3.0 app/views/avo/base/_multiple_select_filter.html.erb
avo-2.2.2 app/views/avo/base/_multiple_select_filter.html.erb