Commit d8f7748dea5d43a16babd15dd02dcbc76220da5a
1 parent
8432c9c1
Exists in
master
and in
4 other branches
Remove app_menu and project_menu partials
Now it's consistent across layouts where their main menus are.
Showing
4 changed files
with
50 additions
and
58 deletions
Show diff stats
app/views/layouts/_app_menu.html.haml
@@ -1,19 +0,0 @@ | @@ -1,19 +0,0 @@ | ||
1 | -%ul.main_menu | ||
2 | - = nav_link(path: 'dashboard#index', html_options: {class: 'home'}) do | ||
3 | - = link_to "Home", root_path, title: "Home" | ||
4 | - | ||
5 | - = nav_link(path: 'dashboard#issues') do | ||
6 | - = link_to dashboard_issues_path do | ||
7 | - Issues | ||
8 | - %span.count= current_user.assigned_issues.opened.count | ||
9 | - | ||
10 | - = nav_link(path: 'dashboard#merge_requests') do | ||
11 | - = link_to dashboard_merge_requests_path do | ||
12 | - Merge Requests | ||
13 | - %span.count= current_user.cared_merge_requests.count | ||
14 | - | ||
15 | - = nav_link(path: 'search#show') do | ||
16 | - = link_to "Search", search_path | ||
17 | - | ||
18 | - = nav_link(path: 'help#index') do | ||
19 | - = link_to "Help", help_path |
app/views/layouts/_project_menu.html.haml
@@ -1,33 +0,0 @@ | @@ -1,33 +0,0 @@ | ||
1 | -%ul.main_menu | ||
2 | - = nav_link(html_options: {class: "home #{project_tab_class}"}) do | ||
3 | - = link_to @project.code, project_path(@project), title: "Project" | ||
4 | - | ||
5 | - - if @project.repo_exists? | ||
6 | - - if can? current_user, :download_code, @project | ||
7 | - = nav_link(controller: %w(tree blob blame)) do | ||
8 | - = link_to 'Files', project_tree_path(@project, @ref || @project.root_ref) | ||
9 | - = nav_link(controller: %w(commit commits compare repositories protected_branches)) do | ||
10 | - = link_to "Commits", project_commits_path(@project, @ref || @project.root_ref) | ||
11 | - = nav_link(path: 'projects#graph') do | ||
12 | - = link_to "Network", graph_project_path(@project) | ||
13 | - | ||
14 | - - if @project.issues_enabled | ||
15 | - = nav_link(controller: %w(issues milestones labels)) do | ||
16 | - = link_to project_issues_filter_path(@project) do | ||
17 | - Issues | ||
18 | - %span.count.issue_counter= @project.issues.opened.count | ||
19 | - | ||
20 | - - if @project.repo_exists? | ||
21 | - - if @project.merge_requests_enabled | ||
22 | - = nav_link(controller: :merge_requests) do | ||
23 | - = link_to project_merge_requests_path(@project) do | ||
24 | - Merge Requests | ||
25 | - %span.count.merge_counter= @project.merge_requests.opened.count | ||
26 | - | ||
27 | - - if @project.wall_enabled | ||
28 | - = nav_link(path: 'projects#wall') do | ||
29 | - = link_to 'Wall', wall_project_path(@project) | ||
30 | - | ||
31 | - - if @project.wiki_enabled | ||
32 | - = nav_link(controller: :wikis) do | ||
33 | - = link_to 'Wiki', project_wiki_path(@project, :index) |
app/views/layouts/application.html.haml
@@ -5,6 +5,20 @@ | @@ -5,6 +5,20 @@ | ||
5 | = render "layouts/flash" | 5 | = render "layouts/flash" |
6 | = render "layouts/head_panel", title: "Dashboard" | 6 | = render "layouts/head_panel", title: "Dashboard" |
7 | .container | 7 | .container |
8 | - = render partial: "layouts/app_menu" | ||
9 | - .content | ||
10 | - = yield | 8 | + %ul.main_menu |
9 | + = nav_link(path: 'dashboard#index', html_options: {class: 'home'}) do | ||
10 | + = link_to "Home", root_path, title: "Home" | ||
11 | + = nav_link(path: 'dashboard#issues') do | ||
12 | + = link_to dashboard_issues_path do | ||
13 | + Issues | ||
14 | + %span.count= current_user.assigned_issues.opened.count | ||
15 | + = nav_link(path: 'dashboard#merge_requests') do | ||
16 | + = link_to dashboard_merge_requests_path do | ||
17 | + Merge Requests | ||
18 | + %span.count= current_user.cared_merge_requests.count | ||
19 | + = nav_link(path: 'search#show') do | ||
20 | + = link_to "Search", search_path | ||
21 | + = nav_link(path: 'help#index') do | ||
22 | + = link_to "Help", help_path | ||
23 | + | ||
24 | + .content= yield |
app/views/layouts/project.html.haml
@@ -5,7 +5,37 @@ | @@ -5,7 +5,37 @@ | ||
5 | = render "layouts/flash" | 5 | = render "layouts/flash" |
6 | = render "layouts/head_panel", title: @project.name | 6 | = render "layouts/head_panel", title: @project.name |
7 | .container | 7 | .container |
8 | - = render partial: "layouts/project_menu" | ||
9 | - .content | ||
10 | - = yield | 8 | + %ul.main_menu |
9 | + = nav_link(html_options: {class: "home #{project_tab_class}"}) do | ||
10 | + = link_to @project.code, project_path(@project), title: "Project" | ||
11 | 11 | ||
12 | + - if @project.repo_exists? | ||
13 | + - if can? current_user, :download_code, @project | ||
14 | + = nav_link(controller: %w(tree blob blame)) do | ||
15 | + = link_to 'Files', project_tree_path(@project, @ref || @project.root_ref) | ||
16 | + = nav_link(controller: %w(commit commits compare repositories protected_branches)) do | ||
17 | + = link_to "Commits", project_commits_path(@project, @ref || @project.root_ref) | ||
18 | + = nav_link(path: 'projects#graph') do | ||
19 | + = link_to "Network", graph_project_path(@project) | ||
20 | + | ||
21 | + - if @project.issues_enabled | ||
22 | + = nav_link(controller: %w(issues milestones labels)) do | ||
23 | + = link_to project_issues_filter_path(@project) do | ||
24 | + Issues | ||
25 | + %span.count.issue_counter= @project.issues.opened.count | ||
26 | + | ||
27 | + - if @project.repo_exists? && @project.merge_requests_enabled | ||
28 | + = nav_link(controller: :merge_requests) do | ||
29 | + = link_to project_merge_requests_path(@project) do | ||
30 | + Merge Requests | ||
31 | + %span.count.merge_counter= @project.merge_requests.opened.count | ||
32 | + | ||
33 | + - if @project.wall_enabled | ||
34 | + = nav_link(path: 'projects#wall') do | ||
35 | + = link_to 'Wall', wall_project_path(@project) | ||
36 | + | ||
37 | + - if @project.wiki_enabled | ||
38 | + = nav_link(controller: :wikis) do | ||
39 | + = link_to 'Wiki', project_wiki_path(@project, :index) | ||
40 | + | ||
41 | + .content= yield |