Sha256: 273371ad0d8d3ebe1158d7cfdd0c852f9e95f2b7a7d21a89d1872c8af3c52b96

Contents?: true

Size: 992 Bytes

Versions: 16

Compression:

Stored size: 992 Bytes

Contents

<% params_to_keep = [:tagged_with, :q] %>

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

<script type="text/javascript">
  $(function() {
    $('#resource_filter').on('change', function(e) {
      var $this = $(this);
      var url = '<%= resources_path(resource_handler.namespaced_resources_name, merge_params_only(params_to_keep)).html_safe %>';
      if ($this.data('remote') === true) {
        $.get(url, {filter: $this.val()}, null, 'script');
      } else {
        Alchemy.pleaseWaitOverlay();
        delimiter = url.match(/\?/) ? '&' : '?';
        window.location = url + delimiter + 'filter=' + encodeURIComponent($this.val());
      }
      return false;
    });
  });
</script>

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
alchemy_cms-3.6.7 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.6.6 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.6.5 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.6.4 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.6.3 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.6.2 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.6.1 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-4.0.0.beta app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.6.0 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.5.0 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.4.2 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.5.0.rc2 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.5.0.rc1 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.4.1 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.4.0 app/views/alchemy/admin/resources/_filter_bar.html.erb
alchemy_cms-3.4.0.rc1 app/views/alchemy/admin/resources/_filter_bar.html.erb