From d8f7748dea5d43a16babd15dd02dcbc76220da5a Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 26 Sep 2012 17:00:52 -0400 Subject: [PATCH] Remove app_menu and project_menu partials Now it's consistent across layouts where their main menus are. --- app/views/layouts/_app_menu.html.haml | 19 ------------ app/views/layouts/_project_menu.html.haml | 33 --------------------- app/views/layouts/application.html.haml | 20 +++++++++++-- app/views/layouts/project.html.haml | 36 +++++++++++++++++++++-- 4 files changed, 50 insertions(+), 58 deletions(-) delete mode 100644 app/views/layouts/_app_menu.html.haml delete mode 100644 app/views/layouts/_project_menu.html.haml diff --git a/app/views/layouts/_app_menu.html.haml b/app/views/layouts/_app_menu.html.haml deleted file mode 100644 index 8fac1b39..00000000 --- a/app/views/layouts/_app_menu.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -%ul.main_menu - = nav_link(path: 'dashboard#index', html_options: {class: 'home'}) do - = link_to "Home", root_path, title: "Home" - - = nav_link(path: 'dashboard#issues') do - = link_to dashboard_issues_path do - Issues - %span.count= current_user.assigned_issues.opened.count - - = nav_link(path: 'dashboard#merge_requests') do - = link_to dashboard_merge_requests_path do - Merge Requests - %span.count= current_user.cared_merge_requests.count - - = nav_link(path: 'search#show') do - = link_to "Search", search_path - - = nav_link(path: 'help#index') do - = link_to "Help", help_path diff --git a/app/views/layouts/_project_menu.html.haml b/app/views/layouts/_project_menu.html.haml deleted file mode 100644 index 72c39619..00000000 --- a/app/views/layouts/_project_menu.html.haml +++ /dev/null @@ -1,33 +0,0 @@ -%ul.main_menu - = nav_link(html_options: {class: "home #{project_tab_class}"}) do - = link_to @project.code, project_path(@project), title: "Project" - - - if @project.repo_exists? - - if can? current_user, :download_code, @project - = nav_link(controller: %w(tree blob blame)) do - = link_to 'Files', project_tree_path(@project, @ref || @project.root_ref) - = nav_link(controller: %w(commit commits compare repositories protected_branches)) do - = link_to "Commits", project_commits_path(@project, @ref || @project.root_ref) - = nav_link(path: 'projects#graph') do - = link_to "Network", graph_project_path(@project) - - - if @project.issues_enabled - = nav_link(controller: %w(issues milestones labels)) do - = link_to project_issues_filter_path(@project) do - Issues - %span.count.issue_counter= @project.issues.opened.count - - - if @project.repo_exists? - - if @project.merge_requests_enabled - = nav_link(controller: :merge_requests) do - = link_to project_merge_requests_path(@project) do - Merge Requests - %span.count.merge_counter= @project.merge_requests.opened.count - - - if @project.wall_enabled - = nav_link(path: 'projects#wall') do - = link_to 'Wall', wall_project_path(@project) - - - if @project.wiki_enabled - = nav_link(controller: :wikis) do - = link_to 'Wiki', project_wiki_path(@project, :index) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index dda10d5d..40f4f88c 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -5,6 +5,20 @@ = render "layouts/flash" = render "layouts/head_panel", title: "Dashboard" .container - = render partial: "layouts/app_menu" - .content - = yield + %ul.main_menu + = nav_link(path: 'dashboard#index', html_options: {class: 'home'}) do + = link_to "Home", root_path, title: "Home" + = nav_link(path: 'dashboard#issues') do + = link_to dashboard_issues_path do + Issues + %span.count= current_user.assigned_issues.opened.count + = nav_link(path: 'dashboard#merge_requests') do + = link_to dashboard_merge_requests_path do + Merge Requests + %span.count= current_user.cared_merge_requests.count + = nav_link(path: 'search#show') do + = link_to "Search", search_path + = nav_link(path: 'help#index') do + = link_to "Help", help_path + + .content= yield diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index 56a947d2..b1dbe41c 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -5,7 +5,37 @@ = render "layouts/flash" = render "layouts/head_panel", title: @project.name .container - = render partial: "layouts/project_menu" - .content - = yield + %ul.main_menu + = nav_link(html_options: {class: "home #{project_tab_class}"}) do + = link_to @project.code, project_path(@project), title: "Project" + - if @project.repo_exists? + - if can? current_user, :download_code, @project + = nav_link(controller: %w(tree blob blame)) do + = link_to 'Files', project_tree_path(@project, @ref || @project.root_ref) + = nav_link(controller: %w(commit commits compare repositories protected_branches)) do + = link_to "Commits", project_commits_path(@project, @ref || @project.root_ref) + = nav_link(path: 'projects#graph') do + = link_to "Network", graph_project_path(@project) + + - if @project.issues_enabled + = nav_link(controller: %w(issues milestones labels)) do + = link_to project_issues_filter_path(@project) do + Issues + %span.count.issue_counter= @project.issues.opened.count + + - if @project.repo_exists? && @project.merge_requests_enabled + = nav_link(controller: :merge_requests) do + = link_to project_merge_requests_path(@project) do + Merge Requests + %span.count.merge_counter= @project.merge_requests.opened.count + + - if @project.wall_enabled + = nav_link(path: 'projects#wall') do + = link_to 'Wall', wall_project_path(@project) + + - if @project.wiki_enabled + = nav_link(controller: :wikis) do + = link_to 'Wiki', project_wiki_path(@project, :index) + + .content= yield