Sha256: 1fc703ee02cade1cabb2a6e839716754da83488bf65d012c046a67c6dfb631b6

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

<%#
    name: headmin/filters/filter/button
    accepts block: yes
    parameters:
      name: (string) Name of the parameter
      label: (string) Display name
      value: (string) Value of the parameter
%>
<% name = local_assigns.has_key?(:name) ? name : nil %>
<% label = local_assigns.has_key?(:label) ? label : nil %>
<% value = local_assigns.has_key?(:value) ? value : nil %>
<% active = local_assigns.has_key?(:active) ? active : false %>

<div class="h-filter me-1" data-controller="filter" data-filters-target="button" data-filter-name="<%= name %>">
  <button type="button" class="h-filter-button btn h-btn-outline-transparent ms-1" data-filter-target="button" data-action="click->filter#toggle click@window->filter#close" aria-expanded="<%= active ? 'true' : 'false' %>">
    <%= "#{label}: #{value || t('.all')}" %>
    <span class="h-filter-remove" data-action="click->filters#remove"><%= bootstrap_icon('x-lg') %></span>
  </button>
  <div class="h-filter-popup <%= ('closed' unless active) %>" data-filter-target="popup">
    <%= yield if block_given? %>
  </div>
</div>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
headmin-0.1.2 app/views/headmin/filters/filter/_button.html.erb
headmin-0.1.1 app/views/headmin/filters/filter/_button.html.erb