summaryrefslogtreecommitdiff
path: root/app/views/layouts
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-01 22:30:48 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-01 22:30:48 +0300
commit8cadeb67502d9f674dc69c0b05341269c2baeb8f (patch)
tree5e950d9341b3f97d7693d05842585f84505d7a8b /app/views/layouts
parent19ab03f4612a2e622098bc199538380b011754c1 (diff)
downloadgitlab-ce-8cadeb67502d9f674dc69c0b05341269c2baeb8f.tar.gz
nav views refactoring
Diffstat (limited to 'app/views/layouts')
-rw-r--r--app/views/layouts/admin.html.haml22
-rw-r--r--app/views/layouts/application.html.haml23
-rw-r--r--app/views/layouts/group.html.haml23
-rw-r--r--app/views/layouts/nav/_admin.html.haml19
-rw-r--r--app/views/layouts/nav/_dashboard.html.haml20
-rw-r--r--app/views/layouts/nav/_group.html.haml20
-rw-r--r--app/views/layouts/nav/_profile.html.haml17
-rw-r--r--app/views/layouts/nav/_project.html.haml43
-rw-r--r--app/views/layouts/nav/_team.html.haml25
-rw-r--r--app/views/layouts/profile.html.haml20
-rw-r--r--app/views/layouts/project_resource.html.haml47
-rw-r--r--app/views/layouts/user_team.html.haml28
12 files changed, 162 insertions, 145 deletions
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml
index 00a08e6131d..abe3f2ea854 100644
--- a/app/views/layouts/admin.html.haml
+++ b/app/views/layouts/admin.html.haml
@@ -4,24 +4,8 @@
%body{class: "#{app_theme} admin"}
= render "layouts/head_panel", title: "Admin area"
= render "layouts/flash"
- .container
- %ul.main_menu
- = nav_link(controller: :dashboard, html_options: {class: 'home'}) do
- = link_to admin_root_path, title: "Stats" do
- %i.icon-home
- = nav_link(controller: :projects) do
- = link_to "Projects", admin_projects_path
- = nav_link(controller: :teams) do
- = link_to "Teams", admin_teams_path
- = nav_link(controller: :groups) do
- = link_to "Groups", admin_groups_path
- = nav_link(controller: :users) do
- = link_to "Users", admin_users_path
- = nav_link(controller: :logs) do
- = link_to "Logs", admin_logs_path
- = nav_link(controller: :hooks) do
- = link_to "Hooks", admin_hooks_path
- = nav_link(controller: :resque) do
- = link_to "Background Jobs", admin_resque_path
+ %nav.main-nav
+ .container= render 'layouts/nav/admin'
+ .container
.content= yield
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 90c2653438d..4e6831406e3 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -4,25 +4,8 @@
%body{class: "#{app_theme} application"}
= render "layouts/head_panel", title: "Dashboard"
= render "layouts/flash"
- .container
- %ul.main_menu
- = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do
- = link_to root_path, title: "Home" do
- %i.icon-home
- = nav_link(path: 'dashboard#projects') do
- = link_to projects_dashboard_path do
- Projects
- = nav_link(path: 'dashboard#issues') do
- = link_to issues_dashboard_path do
- Issues
- %span.count= current_user.assigned_issues.opened.count
- = nav_link(path: 'dashboard#merge_requests') do
- = link_to merge_requests_dashboard_path do
- Merge Requests
- %span.count= current_user.cared_merge_requests.opened.count
- = nav_link(path: 'search#show') do
- = link_to "Search", search_path
- = nav_link(controller: :help) do
- = link_to "Help", help_path
+ %nav.main-nav
+ .container= render 'layouts/nav/dashboard'
+ .container
.content= yield
diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml
index 45528281ed0..8296b8ae9a8 100644
--- a/app/views/layouts/group.html.haml
+++ b/app/views/layouts/group.html.haml
@@ -4,25 +4,8 @@
%body{class: "#{app_theme} application"}
= render "layouts/head_panel", title: "group: #{@group.name}"
= render "layouts/flash"
- .container
- %ul.main_menu
- = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
- = link_to group_path(@group), title: "Home" do
- %i.icon-home
- = nav_link(path: 'groups#issues') do
- = link_to issues_group_path(@group) do
- Issues
- %span.count= current_user.assigned_issues.opened.of_group(@group).count
- = nav_link(path: 'groups#merge_requests') do
- = link_to merge_requests_group_path(@group) do
- Merge Requests
- %span.count= current_user.cared_merge_requests.opened.of_group(@group).count
- = nav_link(path: 'groups#people') do
- = link_to "People", people_group_path(@group)
-
- - if can?(current_user, :manage_group, @group)
- = nav_link(path: 'groups#edit') do
- = link_to edit_group_path(@group), class: "tab " do
- Settings
+ %nav.main-nav
+ .container= render 'layouts/nav/group'
+ .container
.content= yield
diff --git a/app/views/layouts/nav/_admin.html.haml b/app/views/layouts/nav/_admin.html.haml
new file mode 100644
index 00000000000..ca77c26e23d
--- /dev/null
+++ b/app/views/layouts/nav/_admin.html.haml
@@ -0,0 +1,19 @@
+%ul
+ = nav_link(controller: :dashboard, html_options: {class: 'home'}) do
+ = link_to admin_root_path, title: "Stats" do
+ %i.icon-home
+ = nav_link(controller: :projects) do
+ = link_to "Projects", admin_projects_path
+ = nav_link(controller: :teams) do
+ = link_to "Teams", admin_teams_path
+ = nav_link(controller: :groups) do
+ = link_to "Groups", admin_groups_path
+ = nav_link(controller: :users) do
+ = link_to "Users", admin_users_path
+ = nav_link(controller: :logs) do
+ = link_to "Logs", admin_logs_path
+ = nav_link(controller: :hooks) do
+ = link_to "Hooks", admin_hooks_path
+ = nav_link(controller: :resque) do
+ = link_to "Background Jobs", admin_resque_path
+
diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml
new file mode 100644
index 00000000000..2ac35050b64
--- /dev/null
+++ b/app/views/layouts/nav/_dashboard.html.haml
@@ -0,0 +1,20 @@
+%ul
+ = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do
+ = link_to root_path, title: "Home" do
+ %i.icon-home
+ = nav_link(path: 'dashboard#projects') do
+ = link_to projects_dashboard_path do
+ Projects
+ = nav_link(path: 'dashboard#issues') do
+ = link_to issues_dashboard_path do
+ Issues
+ %span.count= current_user.assigned_issues.opened.count
+ = nav_link(path: 'dashboard#merge_requests') do
+ = link_to merge_requests_dashboard_path do
+ Merge Requests
+ %span.count= current_user.cared_merge_requests.opened.count
+ = nav_link(path: 'search#show') do
+ = link_to "Search", search_path
+ = nav_link(controller: :help) do
+ = link_to "Help", help_path
+
diff --git a/app/views/layouts/nav/_group.html.haml b/app/views/layouts/nav/_group.html.haml
new file mode 100644
index 00000000000..f3cdb5ac457
--- /dev/null
+++ b/app/views/layouts/nav/_group.html.haml
@@ -0,0 +1,20 @@
+%ul
+ = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
+ = link_to group_path(@group), title: "Home" do
+ %i.icon-home
+ = nav_link(path: 'groups#issues') do
+ = link_to issues_group_path(@group) do
+ Issues
+ %span.count= current_user.assigned_issues.opened.of_group(@group).count
+ = nav_link(path: 'groups#merge_requests') do
+ = link_to merge_requests_group_path(@group) do
+ Merge Requests
+ %span.count= current_user.cared_merge_requests.opened.of_group(@group).count
+ = nav_link(path: 'groups#people') do
+ = link_to "People", people_group_path(@group)
+
+ - if can?(current_user, :manage_group, @group)
+ = nav_link(path: 'groups#edit') do
+ = link_to edit_group_path(@group), class: "tab " do
+ Settings
+
diff --git a/app/views/layouts/nav/_profile.html.haml b/app/views/layouts/nav/_profile.html.haml
new file mode 100644
index 00000000000..e5e4b27c665
--- /dev/null
+++ b/app/views/layouts/nav/_profile.html.haml
@@ -0,0 +1,17 @@
+%ul
+ = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
+ = link_to profile_path, title: "Profile" do
+ %i.icon-home
+ = nav_link(path: 'profiles#account') do
+ = link_to "Account", account_profile_path
+ = nav_link(controller: :notifications) do
+ = link_to "Notifications", profile_notifications_path
+ = nav_link(controller: :keys) do
+ = link_to keys_path do
+ SSH Keys
+ %span.count= current_user.keys.count
+ = nav_link(path: 'profiles#design') do
+ = link_to "Design", design_profile_path
+ = nav_link(path: 'profiles#history') do
+ = link_to "History", history_profile_path
+
diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml
new file mode 100644
index 00000000000..ec3da964037
--- /dev/null
+++ b/app/views/layouts/nav/_project.html.haml
@@ -0,0 +1,43 @@
+%ul
+ = nav_link(path: 'projects#show', html_options: {class: "home"}) do
+ = link_to project_path(@project), title: "Project" do
+ %i.icon-home
+
+ - unless @project.empty_repo?
+ - if can? current_user, :download_code, @project
+ = nav_link(controller: %w(tree blob blame)) do
+ = link_to 'Files', project_tree_path(@project, @ref || @repository.root_ref)
+ = nav_link(controller: %w(commit commits compare repositories protected_branches)) do
+ = link_to "Commits", project_commits_path(@project, @ref || @repository.root_ref)
+ = nav_link(controller: %w(graph)) do
+ = link_to "Network", project_graph_path(@project, @ref || @repository.root_ref)
+
+ - if @project.issues_enabled
+ = nav_link(controller: %w(issues milestones labels)) do
+ = link_to url_for_project_issues do
+ Issues
+ - if @project.used_default_issues_tracker?
+ %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.wiki_enabled
+ = nav_link(controller: :wikis) do
+ = link_to 'Wiki', project_wiki_path(@project, :home)
+
+ - if @project.wall_enabled
+ = nav_link(controller: :walls) do
+ = link_to 'Wall', project_wall_path(@project)
+
+ - if @project.snippets_enabled
+ = nav_link(controller: :snippets) do
+ = link_to 'Snippets', project_snippets_path(@project)
+
+ - if can? current_user, :admin_project, @project
+ = nav_link(html_options: {class: "#{project_tab_class}"}) do
+ = link_to edit_project_path(@project), class: "stat-tab tab " do
+ Settings
diff --git a/app/views/layouts/nav/_team.html.haml b/app/views/layouts/nav/_team.html.haml
new file mode 100644
index 00000000000..415e45104df
--- /dev/null
+++ b/app/views/layouts/nav/_team.html.haml
@@ -0,0 +1,25 @@
+%ul
+ = nav_link(path: 'teams#show', html_options: {class: 'home'}) do
+ = link_to team_path(@team), title: "Home" do
+ %i.icon-home
+
+ = nav_link(path: 'teams#issues') do
+ = link_to issues_team_path(@team) do
+ Issues
+ %span.count= Issue.opened.of_user_team(@team).count
+
+ = nav_link(path: 'teams#merge_requests') do
+ = link_to merge_requests_team_path(@team) do
+ Merge Requests
+ %span.count= MergeRequest.opened.of_user_team(@team).count
+
+ = nav_link(controller: [:members]) do
+ = link_to team_members_path(@team), class: "team-tab tab" do
+ Members
+ %span.count= @team.members.count
+
+ - if can? current_user, :admin_user_team, @team
+ = nav_link(path: 'teams#edit') do
+ = link_to edit_team_path(@team), class: "stat-tab tab " do
+ Settings
+
diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml
index a7225baa9e4..535f94c4ef6 100644
--- a/app/views/layouts/profile.html.haml
+++ b/app/views/layouts/profile.html.haml
@@ -4,22 +4,8 @@
%body{class: "#{app_theme} profile"}
= render "layouts/head_panel", title: "Profile"
= render "layouts/flash"
- .container
- %ul.main_menu
- = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
- = link_to profile_path, title: "Profile" do
- %i.icon-home
- = nav_link(path: 'profiles#account') do
- = link_to "Account", account_profile_path
- = nav_link(controller: :notifications) do
- = link_to "Notifications", profile_notifications_path
- = nav_link(controller: :keys) do
- = link_to keys_path do
- SSH Keys
- %span.count= current_user.keys.count
- = nav_link(path: 'profiles#design') do
- = link_to "Design", design_profile_path
- = nav_link(path: 'profiles#history') do
- = link_to "History", history_profile_path
+ %nav.main-nav
+ .container= render 'layouts/nav/profile'
+ .container
.content= yield
diff --git a/app/views/layouts/project_resource.html.haml b/app/views/layouts/project_resource.html.haml
index 0ca06837e95..7b0d4789f8e 100644
--- a/app/views/layouts/project_resource.html.haml
+++ b/app/views/layouts/project_resource.html.haml
@@ -7,49 +7,8 @@
- if can?(current_user, :download_code, @project)
= render 'shared/no_ssh'
- .container
- %ul.main_menu
- = nav_link(path: 'projects#show', html_options: {class: "home"}) do
- = link_to project_path(@project), title: "Project" do
- %i.icon-home
-
- - unless @project.empty_repo?
- - if can? current_user, :download_code, @project
- = nav_link(controller: %w(tree blob blame)) do
- = link_to 'Files', project_tree_path(@project, @ref || @repository.root_ref)
- = nav_link(controller: %w(commit commits compare repositories protected_branches)) do
- = link_to "Commits", project_commits_path(@project, @ref || @repository.root_ref)
- = nav_link(controller: %w(graph)) do
- = link_to "Network", project_graph_path(@project, @ref || @repository.root_ref)
-
- - if @project.issues_enabled
- = nav_link(controller: %w(issues milestones labels)) do
- = link_to url_for_project_issues do
- Issues
- - if @project.used_default_issues_tracker?
- %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.wiki_enabled
- = nav_link(controller: :wikis) do
- = link_to 'Wiki', project_wiki_path(@project, :home)
-
- - if @project.wall_enabled
- = nav_link(controller: :walls) do
- = link_to 'Wall', project_wall_path(@project)
-
- - if @project.snippets_enabled
- = nav_link(controller: :snippets) do
- = link_to 'Snippets', project_snippets_path(@project)
-
- - if can? current_user, :admin_project, @project
- = nav_link(html_options: {class: "#{project_tab_class}"}) do
- = link_to edit_project_path(@project), class: "stat-tab tab " do
- Settings
+ %nav.main-nav
+ .container= render 'layouts/nav/project'
+ .container
.content= yield
diff --git a/app/views/layouts/user_team.html.haml b/app/views/layouts/user_team.html.haml
index 483bfad66ae..f2ead9d242a 100644
--- a/app/views/layouts/user_team.html.haml
+++ b/app/views/layouts/user_team.html.haml
@@ -4,30 +4,8 @@
%body{class: "#{app_theme} application"}
= render "layouts/head_panel", title: "team: #{@team.name}"
= render "layouts/flash"
- .container
- %ul.main_menu
- = nav_link(path: 'teams#show', html_options: {class: 'home'}) do
- = link_to team_path(@team), title: "Home" do
- %i.icon-home
-
- = nav_link(path: 'teams#issues') do
- = link_to issues_team_path(@team) do
- Issues
- %span.count= Issue.opened.of_user_team(@team).count
-
- = nav_link(path: 'teams#merge_requests') do
- = link_to merge_requests_team_path(@team) do
- Merge Requests
- %span.count= MergeRequest.opened.of_user_team(@team).count
-
- = nav_link(controller: [:members]) do
- = link_to team_members_path(@team), class: "team-tab tab" do
- Members
- %span.count= @team.members.count
-
- - if can? current_user, :admin_user_team, @team
- = nav_link(path: 'teams#edit') do
- = link_to edit_team_path(@team), class: "stat-tab tab " do
- Settings
+ %nav.main-nav
+ .container= render 'layouts/nav/team'
+ .container
.content= yield