diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-05-01 10:39:11 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-05-01 10:39:16 +0200 |
commit | 92fd3ccee05acdfd5e498734ed287458a8dd21a3 (patch) | |
tree | a794a8017636ce7f50a7f4ef4201395894a5451e /app/views/layouts | |
parent | ae09c2a6db0d15caedc080c319add147c79fd02a (diff) | |
download | gitlab-ce-92fd3ccee05acdfd5e498734ed287458a8dd21a3.tar.gz |
Add helpers for header title and sidebar, and move setting those from controllers to layouts.
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/admin.html.haml | 5 | ||||
-rw-r--r-- | app/views/layouts/application.html.haml | 11 | ||||
-rw-r--r-- | app/views/layouts/dashboard.html.haml | 5 | ||||
-rw-r--r-- | app/views/layouts/explore.html.haml | 5 | ||||
-rw-r--r-- | app/views/layouts/group.html.haml | 5 | ||||
-rw-r--r-- | app/views/layouts/help.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/profile.html.haml | 5 | ||||
-rw-r--r-- | app/views/layouts/project.html.haml | 20 | ||||
-rw-r--r-- | app/views/layouts/project_settings.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/search.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/snippets.html.haml | 5 |
11 files changed, 52 insertions, 21 deletions
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml new file mode 100644 index 00000000000..1c738719bd8 --- /dev/null +++ b/app/views/layouts/admin.html.haml @@ -0,0 +1,5 @@ +- page_title "Admin area" +- header_title "Admin area", admin_root_path +- sidebar "admin" + += render template: "layouts/application" diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index e0829d40bc4..a97feeb1ecd 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,13 +1,10 @@ -- page_title @title !!! 5 %html{ lang: "en"} = render "layouts/head" - %body{class: "#{app_theme} application", :'data-page' => body_data_page} - - title = defined?(@title_url) ? link_to(@title, @title_url) : @title - + %body{class: "#{app_theme}", :'data-page' => body_data_page} - if current_user - = render "layouts/head_panel", title: title + = render "layouts/head_panel", title: header_title - else - = render "layouts/public_head_panel", title: title + = render "layouts/public_head_panel", title: header_title - = render 'layouts/page', sidebar: @sidebar + = render 'layouts/page', sidebar: sidebar diff --git a/app/views/layouts/dashboard.html.haml b/app/views/layouts/dashboard.html.haml new file mode 100644 index 00000000000..c72eca10bf4 --- /dev/null +++ b/app/views/layouts/dashboard.html.haml @@ -0,0 +1,5 @@ +- page_title "Dashboard" +- header_title "Dashboard", root_path +- sidebar "dashboard" + += render template: "layouts/application" diff --git a/app/views/layouts/explore.html.haml b/app/views/layouts/explore.html.haml new file mode 100644 index 00000000000..56bb92a536e --- /dev/null +++ b/app/views/layouts/explore.html.haml @@ -0,0 +1,5 @@ +- page_title "Explore" +- header_title "Explore GitLab", explore_root_path +- sidebar "explore" + += render template: "layouts/application" diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml new file mode 100644 index 00000000000..5edc03129d2 --- /dev/null +++ b/app/views/layouts/group.html.haml @@ -0,0 +1,5 @@ +- page_title @group.name +- header_title @group.name, group_path(@group) +- sidebar "group" + += render template: "layouts/application" diff --git a/app/views/layouts/help.html.haml b/app/views/layouts/help.html.haml new file mode 100644 index 00000000000..224b24befbe --- /dev/null +++ b/app/views/layouts/help.html.haml @@ -0,0 +1,4 @@ +- page_title "Help" +- header_title "Help", help_path + += render template: "layouts/application" diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml new file mode 100644 index 00000000000..9799b4cc4d7 --- /dev/null +++ b/app/views/layouts/profile.html.haml @@ -0,0 +1,5 @@ +- page_title "Profile" +- header_title "Profile", profile_path +- sidebar "profile" + += render template: "layouts/application" diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index 62a6f5ddf4d..4aeb9d397d2 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -1,14 +1,8 @@ -- page_title @project.name_with_namespace -!!! 5 -%html{ lang: "en"} - = render "layouts/head" - %body{class: "#{app_theme} project", :'data-page' => body_data_page, :'data-project-id' => @project.id } - - title = project_title(@project) +- page_title @project.name_with_namespace +- header_title project_title(@project) +- sidebar "project" unless sidebar - - if current_user - = render "layouts/head_panel", title: project_title(@project) - = render "layouts/init_auto_complete" - - else - = render "layouts/public_head_panel", title: project_title(@project) - - = render 'layouts/page', sidebar: @sidebar || 'project' +- content_for :embedded_scripts do + = render "layouts/init_auto_complete" if current_user + += render template: "layouts/application" diff --git a/app/views/layouts/project_settings.html.haml b/app/views/layouts/project_settings.html.haml index d12d07273f3..43401668334 100644 --- a/app/views/layouts/project_settings.html.haml +++ b/app/views/layouts/project_settings.html.haml @@ -1,2 +1,4 @@ -- @sidebar = "project_settings" +- page_title "Settings" +- sidebar "project_settings" + = render template: "layouts/project" diff --git a/app/views/layouts/search.html.haml b/app/views/layouts/search.html.haml new file mode 100644 index 00000000000..fd4c7ad21a7 --- /dev/null +++ b/app/views/layouts/search.html.haml @@ -0,0 +1,4 @@ +- page_title "Search" +- header_title "Search", search_path + += render template: "layouts/application" diff --git a/app/views/layouts/snippets.html.haml b/app/views/layouts/snippets.html.haml new file mode 100644 index 00000000000..9b0f40073ab --- /dev/null +++ b/app/views/layouts/snippets.html.haml @@ -0,0 +1,5 @@ +- page_title 'Snippets' +- header_title 'Snippets', snippets_path +- sidebar "snippets" + += render template: "layouts/application" |