Sha256: cbdee6157bac1a6d112544c8669b0a6fd463a52cccb55993639ed1d51591b005

Contents?: true

Size: 984 Bytes

Versions: 9

Compression:

Stored size: 984 Bytes

Contents

<div id="filter_bar">
  <h2><%= Alchemy.t('Filter') %></h2>
  <%= select_tag(
    'picture_filter',
    options_for_select([
      [Alchemy.t(:all_pictures), ''],
      [Alchemy.t(:last_upload_only), 'last_upload'],
      [Alchemy.t(:recently_uploaded_only), 'recent'],
      [Alchemy.t(:without_tag), 'without_tag']
    ], params[:filter]),
    :data => { :remote => !!request.xhr? },
    :class => 'alchemy_selectbox'
  ) %>
</div>

<script type="text/javascript">
  $(function() {
    $('#picture_filter').on('change', function(e) {
      var $this = $(this);
      var url = '<%= alchemy.admin_pictures_path(search_filter_params.except(:filter).to_h) %>';
      if ($this.data('remote') === true) {
        $.get(url, {filter: $this.val()}, null, 'script');
      } else {
        Alchemy.pleaseWaitOverlay();
        delimiter = url.match(/\?/) ? '&' : '?';
        window.location = url + delimiter + 'filter=' + $this.val();
      }
      return false;
    });
  });
</script>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-4.0.6 app/views/alchemy/admin/pictures/_filter_bar.html.erb
alchemy_cms-4.0.5 app/views/alchemy/admin/pictures/_filter_bar.html.erb
alchemy_cms-4.0.4 app/views/alchemy/admin/pictures/_filter_bar.html.erb
alchemy_cms-4.0.3 app/views/alchemy/admin/pictures/_filter_bar.html.erb
alchemy_cms-4.0.2 app/views/alchemy/admin/pictures/_filter_bar.html.erb
alchemy_cms-4.0.1 app/views/alchemy/admin/pictures/_filter_bar.html.erb
alchemy_cms-4.0.0 app/views/alchemy/admin/pictures/_filter_bar.html.erb
alchemy_cms-4.0.0.rc2 app/views/alchemy/admin/pictures/_filter_bar.html.erb
alchemy_cms-4.0.0.rc1 app/views/alchemy/admin/pictures/_filter_bar.html.erb