Sha256: 8ae52236ca65ed3f4dd2a525a1b5b35dbaccda10f131f4f197894996ba72d574

Contents?: true

Size: 987 Bytes

Versions: 16

Compression:

Stored size: 987 Bytes

Contents

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

<div id="filter_bar">
  <h2><%= Alchemy.t('Filter') %></h2>
  <%= select_tag(
    'file_type_filter',
    options_for_select(
      Alchemy::Attachment.file_types_for_select,
      params[:file_type]
    ),
    include_blank: Alchemy.t('Show all files'),
    data: { remote: !!request.xhr? },
    class: 'alchemy_selectbox'
  ) %>
</div>

<script type="text/javascript">
  $(function() {
    $('#file_type_filter').on('change', function(e) {
      var $this = $(this);
      var url = '<%= alchemy.admin_attachments_path(merge_params_only(params_to_keep)).html_safe %>';
      if ($this.data('remote') === true) {
        $.get(url, {file_type: $this.val()}, null, 'script');
      } else {
        Alchemy.pleaseWaitOverlay();
        delimiter = url.match(/\?/) ? '&' : '?';
        window.location = url + delimiter + 'file_type=' + 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/attachments/_filter_bar.html.erb
alchemy_cms-3.6.6 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.6.5 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.6.4 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.6.3 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.6.2 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.6.1 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-4.0.0.beta app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.6.0 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.5.0 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.4.2 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.5.0.rc2 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.5.0.rc1 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.4.1 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.4.0 app/views/alchemy/admin/attachments/_filter_bar.html.erb
alchemy_cms-3.4.0.rc1 app/views/alchemy/admin/attachments/_filter_bar.html.erb