Commit 64008b9e authored by Riyad Preukschas's avatar Riyad Preukschas

Improve search suggestions

parent baf94bd7
...@@ -76,26 +76,40 @@ module ApplicationHelper ...@@ -76,26 +76,40 @@ module ApplicationHelper
def search_autocomplete_source def search_autocomplete_source
projects = current_user.projects.map{ |p| { label: p.name, url: project_path(p) } } projects = current_user.projects.map{ |p| { label: p.name, url: project_path(p) } }
default_nav = [ default_nav = [
{ label: "Profile", url: profile_path }, { label: "My Profile", url: profile_path },
{ label: "Keys", url: keys_path }, { label: "My SSH Keys", url: keys_path },
{ label: "Dashboard", url: root_path }, { label: "My Dashboard", url: root_path },
{ label: "Admin", url: admin_root_path } { label: "Admin Section", url: admin_root_path },
] ]
project_nav = [] help_nav = [
{ label: "Workflow Help", url: help_workflow_path },
{ label: "Permissions Help", url: help_permissions_path },
{ label: "Web Hooks Help", url: help_web_hooks_path },
{ label: "System Hooks Help", url: help_system_hooks_path },
{ label: "API Help", url: help_api_path },
{ label: "Markdown Help", url: help_markdown_path },
{ label: "SSH Keys Help", url: help_ssh_path },
]
project_nav = []
if @project && !@project.new_record? if @project && !@project.new_record?
project_nav = [ project_nav = [
{ label: "#{@project.name} / Issues", url: project_issues_path(@project) }, { label: "#{@project.name} Issues", url: project_issues_path(@project) },
{ label: "#{@project.name} / Wall", url: wall_project_path(@project) }, { label: "#{@project.name} Commits", url: project_commits_path(@project, @ref || @project.root_ref) },
{ label: "#{@project.name} / Tree", url: project_tree_path(@project, @ref || @project.root_ref) }, { label: "#{@project.name} Merge Requests", url: project_merge_requests_path(@project) },
{ label: "#{@project.name} / Commits", url: project_commits_path(@project, @ref || @project.root_ref) }, { label: "#{@project.name} Milestones", url: project_milestones_path(@project) },
{ label: "#{@project.name} / Team", url: project_team_index_path(@project) } { label: "#{@project.name} Snippets", url: project_snippets_path(@project) },
{ label: "#{@project.name} Team", url: project_team_index_path(@project) },
{ label: "#{@project.name} Tree", url: project_tree_path(@project, @ref || @project.root_ref) },
{ label: "#{@project.name} Wall", url: wall_project_path(@project) },
{ label: "#{@project.name} Wiki", url: project_wikis_path(@project) },
] ]
end end
[projects, default_nav, project_nav].flatten.to_json [projects, default_nav, project_nav, help_nav].flatten.to_json
end end
def emoji_autocomplete_source def emoji_autocomplete_source
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment