- if params[:group_id].present?
  = hidden_field_tag :group_id, params[:group_id]
- if params[:project_id].present?
  = hidden_field_tag :project_id, params[:project_id]
.dropdown
  %button.dropdown-menu-toggle.btn.js-search-group-dropdown{ type: "button", data: { toggle: "dropdown", default_label: "Group:" } }
    %span.dropdown-toggle-text
      Group:
      - if @group.present?
        = @group.name
      - else
        Any
    = icon("chevron-down")
  .dropdown-menu.dropdown-select.dropdown-menu-selectable.dropdown-menu-align-right
    = dropdown_title("Filter results by group")
    = dropdown_filter("Search groups")
    = dropdown_content
    = dropdown_loading

.dropdown.project-filter
  %button.dropdown-menu-toggle.btn.js-search-project-dropdown{ type: "button", data: { toggle: "dropdown", default_label: "Project:" } }
    %span.dropdown-toggle-text
      Project:
      - if @project.present?
        = @project.name_with_namespace
      - else
        Any
    = icon("chevron-down")
  .dropdown-menu.dropdown-select.dropdown-menu-selectable.dropdown-menu-align-right
    = dropdown_title("Filter results by project")
    = dropdown_filter("Search projects")
    = dropdown_content
    = dropdown_loading
