app/helpers/search_helper.rb
def project_autocomplete
    if @project && @project.repository.exists? && @project.repository.root_ref
      ref    = @ref || @project.repository.root_ref

      [
        { category: "Current Project", label: "Files",          url: namespace_project_tree_path(@project.namespace, @project, ref) },
        { category: "Current Project", label: "Commits",        url: namespace_project_commits_path(@project.namespace, @project, ref) },
        { category: "Current Project", label: "Network",        url: namespace_project_network_path(@project.namespace, @project, ref) },
        { category: "Current Project", label: "Graph",          url: namespace_project_graph_path(@project.namespace, @project, ref) },
        { category: "Current Project", label: "Issues",         url: namespace_project_issues_path(@project.namespace, @project) },
        { category: "Current Project", label: "Merge Requests", url: namespace_project_merge_requests_path(@project.namespace, @project) },
        { category: "Current Project", label: "Milestones",     url: namespace_project_milestones_path(@project.namespace, @project) },
        { category: "Current Project", label: "Snippets",       url: namespace_project_snippets_path(@project.namespace, @project) },
        { category: "Current Project", label: "Members",        url: namespace_project_project_members_path(@project.namespace, @project) },
        { category: "Current Project", label: "Wiki",           url: namespace_project_wikis_path(@project.namespace, @project) },
      ]
    else
      []
    end
  end
# Autocomplete results for the current project, if it's defined
Autocomplete results for the current project, if it's defined
Autocomplete results for the current project if it ' s defined
def project_autocomplete
    if @project && @project.repository.exists? && @project.repository.root_ref
      ref    = @ref || @project.repository.root_ref
      [
        { category: "Current Project", label: "Files",          url: namespace_project_tree_path(@project.namespace, @project, ref) },
        { category: "Current Project", label: "Commits",        url: namespace_project_commits_path(@project.namespace, @project, ref) },
        { category: "Current Project", label: "Network",        url: namespace_project_network_path(@project.namespace, @project, ref) },
        { category: "Current Project", label: "Graph",          url: namespace_project_graph_path(@project.namespace, @project, ref) },
        { category: "Current Project", label: "Issues",         url: namespace_project_issues_path(@project.namespace, @project) },
        { category: "Current Project", label: "Merge Requests", url: namespace_project_merge_requests_path(@project.namespace, @project) },
        { category: "Current Project", label: "Milestones",     url: namespace_project_milestones_path(@project.namespace, @project) },
        { category: "Current Project", label: "Snippets",       url: namespace_project_snippets_path(@project.namespace, @project) },
        { category: "Current Project", label: "Members",        url: namespace_project_project_members_path(@project.namespace, @project) },
        { category: "Current Project", label: "Wiki",           url: namespace_project_wikis_path(@project.namespace, @project) },
      ]
    else
      []
    end
  end
def project_autocomplete if @project && @project . repository . exists? && @project . repository . root_ref ref = @ref || @project . repository . root_ref [ { category : "Current Project" , label : "Files" , url : namespace_project_tree_path ( @project . namespace , @project , ref ) } , { category : "Current Project" , label : "Commits" , url : namespace_project_commits_path ( @project . namespace , @project , ref ) } , { category : "Current Project" , label : "Network" , url : namespace_project_network_path ( @project . namespace , @project , ref ) } , { category : "Current Project" , label : "Graph" , url : namespace_project_graph_path ( @project . namespace , @project , ref ) } , { category : "Current Project" , label : "Issues" , url : namespace_project_issues_path ( @project . namespace , @project ) } , { category : "Current Project" , label : "Merge Requests" , url : namespace_project_merge_requests_path ( @project . namespace , @project ) } , { category : "Current Project" , label : "Milestones" , url : namespace_project_milestones_path ( @project . namespace , @project ) } , { category : "Current Project" , label : "Snippets" , url : namespace_project_snippets_path ( @project . namespace , @project ) } , { category : "Current Project" , label : "Members" , url : namespace_project_project_members_path ( @project . namespace , @project ) } , { category : "Current Project" , label : "Wiki" , url : namespace_project_wikis_path ( @project . namespace , @project ) } , ] else [ ] end end
Autocomplete results for the current project, if it's defined
Autocomplete results for the current project if it ' s defined