Sha256: 54139eb51c7ee0f22908a62af3d66d43e341bf6d39ff515a99c060a8a1cbb221

Contents?: true

Size: 1013 Bytes

Versions: 32

Compression:

Stored size: 1013 Bytes

Contents

<div id="filter_bar">
  <label>
    <h3><%= local_assigns[:label] || Alchemy.t('Filter') %></h3>
    <%= select_tag(
      'resource_filter',
      options_for_select(
        resource_filter_select, search_filter_params[:filter]
      ),
      include_blank: Alchemy.t(:all, scope: ['resources', resource_name, 'filters']),
      data: { remote: !!request.xhr? },
      class: 'alchemy_selectbox'
    ) %>
  </label>
</div>

<script type="text/javascript">
  $(function() {
    $('#resource_filter').on('change', function(e) {
      var $this = $(this);
      var url = '<%= local_assigns[:url] || resources_path(resource_handler.namespaced_resources_name, search_filter_params.except(:filter).to_h) %>';
      if ($this.data('remote') === true) {
        $.get(url, {filter: $this.val()}, null, 'script');
      } else {
        delimiter = url.match(/\?/) ? '&' : '?';
        Turbolinks.visit(url + delimiter + 'filter=' + encodeURIComponent($this.val()));
      }
      return false;
    });
  });
</script>

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
alchemy_cms-5.3.8 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.3.7 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.3.6 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.3.5 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.3.4 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.3.3 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.3.2 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.3.1 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.3.0 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.2.7 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.2.6 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.1.10 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.2.5 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.1.9 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.2.4 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.1.8 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.1.7 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.2.3 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.1.6 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-5.2.2 app/views/alchemy/admin/resources/_filter_bar.html.erb