<commit_before><form class="search_form" action="<%= url %>" data-remote="true" >
  <div class="field">
    <%= search_field nil, nil,
                name: :search,
                value: params[:search],
                pattern: '.{3,}',
                autofocus: true,
                title: t('search_input_notice', scope: 'refinery.admin.search') %>

    <input type="image" src="<%= asset_url('refinery/icons/zoom.png'); %>">

    <a title="Toggle search options" href="#search-options" class="nojs-hide icon-small toggle-icon toggle-hide">Search options</a>

    <a href="<%= url %>"
      class="<%= 'hide' if params[:search].blank? %> icon-small reset-icon">Cancel search</a>
  </div>
  <div class="field js-hide" id="search-options">
    <% search_in = options_for_select(search_model.searchable_attributes.collect { |a| [t(a, scope: "activerecord.attributes.#{search_model.model_name.i18n_key}"), a]}, params[:search_in]) %>
    <%= select_tag(:search_in, search_in) %>
  </div>
</form>
<commit_msg>show search options only if there is many search attributes<commit_after><form class="search_form" action="<%= url %>" data-remote="true" >
  <div class="field">
    <%= search_field nil, nil,
                name: :search,
                value: params[:search],
                pattern: '.{3,}',
                autofocus: true,
                title: t('search_input_notice', scope: 'refinery.admin.search') %>

    <input type="image" src="<%= asset_url('refinery/icons/zoom.png'); %>">
    <% if search_model.searchable_attributes.many? %>
      <a title="Toggle search options" href="#search-options" class="nojs-hide icon-small toggle-icon toggle-hide">Search options</a>
    <% end %>

    <a href="<%= url %>"
      class="<%= 'hide' if params[:search].blank? %> icon-small reset-icon">Cancel search</a>
  </div>
  <% if search_model.searchable_attributes.many? %>
    <div class="field js-hide" id="search-options">
      <% search_in = options_for_select(search_model.searchable_attributes.collect { |a| [t(a, scope: "activerecord.attributes.#{search_model.model_name.i18n_key}"), a]}, params[:search_in]) %>
      <%= select_tag(:search_in, search_in) %>
    </div>
  <% end %>
</form>

{'fraction_non_alphanumeric': 0.1846989588048891, 'fraction_numerical': 0.002716161158895428, 'mean_word_length': 3.428857715430862, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, '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': '6073844', 'n_tokens_mistral': 749, 'n_tokens_neox': 697, 'n_words': 141}