<commit_before><%# this is a partial of search controls to be used by any search view %>
<% 
  if @user
    users ||= @user.contacts
    groups ||= @user.groups
  else
    users ||= nil; groups ||= nil 
  end
  path = filter_path
  parsed = parsed_path

  # we use strings for boolean so that we can correctly set defaults
  show_extras ||= 'false'
  show_page_types ||= 'true'
  url ||= params.allow(:controller, :action, :id)

  group_id = parsed.int_for('group')
  if group_id
    group = Group.find_by_id(group_id)
    groups += [group] if group
  end
%>
<%# [show_extras, show_page_types, url].inspect -%>

<div style='text-align:center; line-height: 2.5em;'>
<% form_tag(url) do -%>

<% if show_page_types == 'true' -%>
<%= select_tag 'search[type]', options_for_select_page_type(parsed.arg_for('type')) %>
<% end -%>

<% if users -%>
<%= select_tag 'search[person]', "<option value=''>#{'all people'.t}</option>"+
options_from_collection_for_select(users, "id", "name", parsed.int_for('person')) %>
<% end -%><commit_msg>fixed bug #142<commit_after><%# this is a partial of search controls to be used by any search view %>
<% 
  if @user
    users ||= @user.contacts
    groups ||= @user.groups
    users.unshift @user unless users.include? @user
  else
    users ||= nil; groups ||= nil 
  end
  path = filter_path
  parsed = parsed_path

  # we use strings for boolean so that we can correctly set defaults
  show_extras ||= 'false'
  show_page_types ||= 'true'
  url ||= params.allow(:controller, :action, :id)

  group_id = parsed.int_for('group')
  if group_id
    group = Group.find_by_id(group_id)
    groups += [group] if group
  end
%>
<%# [show_extras, show_page_types, url].inspect -%>

<div style='text-align:center; line-height: 2.5em;'>
<% form_tag(url) do -%>

<% if show_page_types == 'true' -%>
<%= select_tag 'search[type]', options_for_select_page_type(parsed.arg_for('type')) %>
<% end -%>

<% if users -%>
<%= select_tag 'search[person]', "<option value=''>#{'all people'.t}</option>"+
options_from_collection_for_select(users, "id", "name", parsed.int_for('person')) %>
<% end -%>
{'fraction_non_alphanumeric': 0.17354196301564723, 'fraction_numerical': 0.003319108582266477, 'mean_word_length': 4.301507537688442, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '899405', 'n_tokens_mistral': 786, 'n_tokens_neox': 753, 'n_words': 187}