Sha256: 28899cbbc1c8f7d8cd5c2552efb92eac47db0028a0a085b47dfd29bc29e5fa2e

Contents?: true

Size: 922 Bytes

Versions: 2

Compression:

Stored size: 922 Bytes

Contents

<%#
    name: headmin/filters/search
    accepts block: no
    parameters:
      name: (string) Name of the parameter
      model: (Object) model to create a placeholder for
      placeholder: (string) placeholder for search field. Defaults to model name
%>
<% name = local_assigns.has_key?(:name) ? name : :search %>
<% label = local_assigns.has_key?(:label) ? label : nil %>
<% placeholder = local_assigns.has_key?(:placeholder) ? placeholder : t('.placeholder', resource: label) %>

<% value = filter_param_exists?(name) ? params[name] : nil %>

<% content_for :filters_search do %>
  <div class="h-filters-search d-flex">
    <input class="form-control me-1" type="search" placeholder="<%= raw placeholder.capitalize %>" aria-label="Search" name="<%= name %>" value="<%= value %>">
    <button class="btn h-btn-outline-light d-none d-md-block" type="submit">
      <%= t('.button') %>
    </button>
  </div>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

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