Sha256: 2d58274b85d36cac72fd1bec2172e8c7c88328c0ff5b6dd0315a1f74e5e6d2ef

Contents?: true

Size: 1.33 KB

Versions: 5

Compression:

Stored size: 1.33 KB

Contents

<div data-controller="toggle-panel">
  <div class="relative w-full flex justify-between z-30">
    <%= a_button class: 'focus:outline-none',
      color: 'blue-gray',
      title: t('avo.click_to_reveal_filters'),
      'data-button': 'resource-filters',
      'data-action': 'click->toggle-panel#togglePanel',
      'data-tippy': 'tooltip' do
    %>

      <%= svg 'filter' %> <%= t 'avo.filters' %>
      <% if params[:filters].present? %>
        <div class="ml-1">(<%=JSON.parse(Base64.decode64(params[:filters])).count%> applied)</div>
      <% end %>
    <% end %>

    <div
      class="absolute block inset-auto right-0 top-full bg-white min-w-300px mt-2 z-20 shadow-context rounded-xl hidden divide-y divide-gray-300"
      data-toggle-panel-target="panel"
    >
      <% @filters.each do |filter| %>
        <%= render partial: filter.class.template, locals: {filter: filter} %>
      <% end %>

      <div class="p-4 border-gray-300 border-t">
        <% if params[:filters].present? %>
          <%= a_link t('avo.reset_filters'), resources_path(resource: @resource, filters: nil, keep_query_params: true), color: 'blue-gray', class: 'w-full justify-center' %>
        <% else %>
          <%= a_button t('avo.reset_filters'), color: 'blue-gray', class: 'w-full justify-center', disabled: true %>
        <% end %>
      </div>
    </div>
  </div>
</div>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
avo-1.19.1.pre.4 app/views/avo/base/_filters.html.erb
avo-1.19.1.pre.3 app/views/avo/base/_filters.html.erb
avo-1.19.1.pre.2 app/views/avo/base/_filters.html.erb
avo-1.19.1.pre.1 app/views/avo/base/_filters.html.erb
avo-1.19.0 app/views/avo/base/_filters.html.erb