From 64008b9ec70d299fb9514365b8853182534fc421 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Fri, 12 Oct 2012 01:02:28 +0200 Subject: [PATCH] Improve search suggestions --- app/helpers/application_helper.rb | 36 +++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8c65a0fd678..d27f4de3851 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -76,26 +76,40 @@ module ApplicationHelper def search_autocomplete_source projects = current_user.projects.map{ |p| { label: p.name, url: project_path(p) } } + default_nav = [ - { label: "Profile", url: profile_path }, - { label: "Keys", url: keys_path }, - { label: "Dashboard", url: root_path }, - { label: "Admin", url: admin_root_path } + { label: "My Profile", url: profile_path }, + { label: "My SSH Keys", url: keys_path }, + { label: "My Dashboard", url: root_path }, + { label: "Admin Section", url: admin_root_path }, + ] + + 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? project_nav = [ - { label: "#{@project.name} / Issues", url: project_issues_path(@project) }, - { label: "#{@project.name} / Wall", url: wall_project_path(@project) }, - { label: "#{@project.name} / Tree", url: project_tree_path(@project, @ref || @project.root_ref) }, - { label: "#{@project.name} / Commits", url: project_commits_path(@project, @ref || @project.root_ref) }, - { label: "#{@project.name} / Team", url: project_team_index_path(@project) } + { label: "#{@project.name} Issues", url: project_issues_path(@project) }, + { label: "#{@project.name} Commits", url: project_commits_path(@project, @ref || @project.root_ref) }, + { label: "#{@project.name} Merge Requests", url: project_merge_requests_path(@project) }, + { label: "#{@project.name} Milestones", url: project_milestones_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 - [projects, default_nav, project_nav].flatten.to_json + [projects, default_nav, project_nav, help_nav].flatten.to_json end def emoji_autocomplete_source