= form_tag filter_projects_path, method: :get, class: 'project-filter-form', id: 'project-filter-form' do |f|
  = search_field_tag :name, params[:name],
    placeholder: 'Filter by name...',
    class: 'project-filter-form-field form-control input-short js-projects-list-filter',
    spellcheck: false,
    id: 'project-filter-form-field',
    tabindex: "2",
    autofocus: local_assigns[:autofocus]

  - if local_assigns[:icon]
    = icon("search", class: "search-icon")

  - if params[:sort].present?
    = hidden_field_tag :sort, params[:sort]

  - if params[:personal].present?
    = hidden_field_tag :personal, params[:personal]

  - if params[:archived].present?
    = hidden_field_tag :archived, params[:archived]

  - if params[:visibility_level].present?
    = hidden_field_tag :visibility_level, params[:visibility_level]

= form_tag filter_projects_path, method: :get, class: 'project-filter-form', id: 'project-filter-form' do |f|
  = search_field_tag :name, params[:name],
    placeholder: 'Filter by name...',
    class: 'project-filter-form-field form-control input-short js-projects-list-filter',
    spellcheck: false,
    id: 'project-filter-form-field',
    tabindex: "2",
    autofocus: local_assigns[:autofocus]

  - if local_assigns[:icon]
    = icon("search", class: "search-icon")

  - if params[:sort].present?
    = hidden_field_tag :sort, params[:sort]

  - if params[:personal].present?
    = hidden_field_tag :personal, params[:personal]

  - if params[:archived].present?
    = hidden_field_tag :archived, params[:archived]

  - if params[:visibility_level].present?
    = hidden_field_tag :visibility_level, params[:visibility_level]

  = render_if_exists 'shared/projects/search_fields'

Add render_if_exists to inject additional search field in EE
Add render_if_exists to inject additional search field in EE

This allows EE code to reuse the search partial and append additional
query parameters to it, and have it preserved when searching.
