<commit_before><div id="filter_bar">
  <label>
    <h3><%= 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><commit_msg>Allow to pass a label into filter bar partial<commit_after><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>
{'fraction_non_alphanumeric': 0.19904076738609114, 'fraction_numerical': 0.0019184652278177458, 'mean_word_length': 3.318840579710145, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7055108', 'n_tokens_mistral': 702, 'n_tokens_neox': 693, 'n_words': 118}