app/helpers/search_helper.rb
# 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
      prefix = search_result_sanitize(@project.name_with_namespace)
      ref    = @ref || @project.repository.root_ref
      [
        { label: "#{prefix} - 文件",          url: project_tree_path(@project, ref) },
        { label: "#{prefix} - 提交",        url: project_commits_path(@project, ref) },
        { label: "#{prefix} - 网络",        url: project_network_path(@project, ref) },
        { label: "#{prefix} - 图表",          url: project_graph_path(@project, ref) },
        { label: "#{prefix} - 问题",         url: project_issues_path(@project) },
        { label: "#{prefix} - 合并请求", url: project_merge_requests_path(@project) },
        { label: "#{prefix} - 里程碑",     url: project_milestones_path(@project) },
        { label: "#{prefix} - 代码段",       url: project_snippets_path(@project) },
        { label: "#{prefix} - 团队",           url: project_team_index_path(@project) },
        { label: "#{prefix} - 维基",           url: project_wikis_path(@project) },
      ]
    else
      []
    end
  end
def project_autocomplete if @project && @project . repository . exists? && @project . repository . root_ref prefix = search_result_sanitize ( @project . name_with_namespace ) ref = @ref || @project . repository . root_ref [ { label : "#{prefix} - 文件",     pr o ect_tree_path(@pr o ject, re f  }, { label : "#{prefix} - 提交",     pr o ect_commits_path(@pr o ject, re f  }, { label : "#{prefix} - 网络",     pr o ect_network_path(@pr o ject, re f  }, { label : "#{prefix} - 图表",     pr o ect_graph_path(@pr o ject, re f  }, { label : "#{prefix} - 问题",     pr o ect_issues_path(@pr o ject) }, { label : "#{prefix} - 合并请求", url: p r jec t merge_requests_path(@projec t ) }, { label : "#{prefix} - 里程碑",      u roj e t_milestones_path(@proj e ct) }, { label : "#{prefix} - 代码段",      roj e t_snippets_path(@proj e ct) }, { label : "#{prefix} - 团队",     pr o ect_team_index_path(@pr o ject) }, { label : "#{prefix} - 维基",     pr o ect_wikis_path(@pr o ject) }, ] else [ ] end end
Autocomplete results for the current project, if it's defined
Autocomplete results for the current project if it ' s defined