From 34cc4c598232d2e27dcc99f5534dbe318e89cff9 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 13 Feb 2015 14:31:42 +0100 Subject: [PATCH] Link head panel titles to relevant root page. --- CHANGELOG | 1 + app/controllers/snippets_controller.rb | 1 + app/controllers/users_controller.rb | 1 + app/views/layouts/admin.html.haml | 2 +- app/views/layouts/application.html.haml | 2 +- app/views/layouts/explore.html.haml | 4 ++-- app/views/layouts/group.html.haml | 2 +- app/views/layouts/navless.html.haml | 2 +- app/views/layouts/profile.html.haml | 2 +- app/views/layouts/public_group.html.haml | 2 +- app/views/layouts/public_users.html.haml | 2 +- app/views/layouts/search.html.haml | 2 +- 12 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2e0d86862bf..4fb635ea1e5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -50,6 +50,7 @@ v 7.8.0 (unreleased) - Prevent losing unsaved comments by automatically restoring them when comment page is loaded again. - Don't allow page to be scaled on mobile. - Clean the username acquired from OAuth/LDAP so it doesn't fail username validation and block signing up. + - Link head panel titles to relevant root page. v 7.7.2 - Update GitLab Shell to version 2.4.2 that fixes a bug when developers can push to protected branch diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb index 1ed3bc388fb..6ac048e4b83 100644 --- a/app/controllers/snippets_controller.rb +++ b/app/controllers/snippets_controller.rb @@ -106,6 +106,7 @@ class SnippetsController < ApplicationController def set_title @title = 'Snippets' + @title_url = snippets_path end def snippet_params diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 57d8ef09faf..84a04c5ebe6 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -19,6 +19,7 @@ class UsersController < ApplicationController where(project_id: authorized_projects_ids).limit(30) @title = @user.name + @title_url = user_path(@user) respond_to do |format| format.html diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index dc8652cb145..e8751a6987e 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -2,5 +2,5 @@ %html{ lang: "en"} = render "layouts/head", title: "Admin area" %body{class: "#{app_theme} #{theme_type} admin", :'data-page' => body_data_page} - = render "layouts/head_panel", title: "Admin area" + = render "layouts/head_panel", title: link_to("Admin area", admin_root_path) = render 'layouts/page', sidebar: 'layouts/nav/admin' diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index e5420a13605..49123744ffa 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -2,5 +2,5 @@ %html{ lang: "en"} = render "layouts/head", title: "Dashboard" %body{class: "#{app_theme} #{theme_type} application", :'data-page' => body_data_page } - = render "layouts/head_panel", title: "Dashboard" + = render "layouts/head_panel", title: link_to("Dashboard", root_path) = render 'layouts/page', sidebar: 'layouts/nav/dashboard' diff --git a/app/views/layouts/explore.html.haml b/app/views/layouts/explore.html.haml index 9813d846542..09855b222dc 100644 --- a/app/views/layouts/explore.html.haml +++ b/app/views/layouts/explore.html.haml @@ -5,9 +5,9 @@ %body{class: "#{app_theme} #{theme_type} application", :'data-page' => body_data_page} = render "layouts/broadcast" - if current_user - = render "layouts/head_panel", title: page_title + = render "layouts/head_panel", title: link_to(page_title, explore_root_path) - else - = render "layouts/public_head_panel", title: page_title + = render "layouts/public_head_panel", title: link_to(page_title, explore_root_path) .container.navless-container .content .explore-title diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml index 98edcf3a140..fa0ed317ce1 100644 --- a/app/views/layouts/group.html.haml +++ b/app/views/layouts/group.html.haml @@ -2,5 +2,5 @@ %html{ lang: "en"} = render "layouts/head", title: group_head_title %body{class: "#{app_theme} #{theme_type} application", :'data-page' => body_data_page} - = render "layouts/head_panel", title: @group.name + = render "layouts/head_panel", title: link_to(@group.name, group_path(@group)) = render 'layouts/page', sidebar: 'layouts/nav/group' diff --git a/app/views/layouts/navless.html.haml b/app/views/layouts/navless.html.haml index 730f3d09277..a3b55542bf7 100644 --- a/app/views/layouts/navless.html.haml +++ b/app/views/layouts/navless.html.haml @@ -3,7 +3,7 @@ = render "layouts/head", title: @title %body{class: "#{app_theme} #{theme_type} application", :'data-page' => body_data_page} = render "layouts/broadcast" - = render "layouts/head_panel", title: @title + = render "layouts/head_panel", title: defined?(@title_url) ? link_to(@title, @title_url) : @title .container.navless-container .content = render "layouts/flash" diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml index 89d816061e2..19d6efed78e 100644 --- a/app/views/layouts/profile.html.haml +++ b/app/views/layouts/profile.html.haml @@ -2,5 +2,5 @@ %html{ lang: "en"} = render "layouts/head", title: "Profile" %body{class: "#{app_theme} #{theme_type} profile", :'data-page' => body_data_page} - = render "layouts/head_panel", title: "Profile" + = render "layouts/head_panel", title: link_to("Profile", profile_path) = render 'layouts/page', sidebar: 'layouts/nav/profile' diff --git a/app/views/layouts/public_group.html.haml b/app/views/layouts/public_group.html.haml index ae3d2bd8a89..4b69329b8fe 100644 --- a/app/views/layouts/public_group.html.haml +++ b/app/views/layouts/public_group.html.haml @@ -2,5 +2,5 @@ %html{ lang: "en"} = render "layouts/head", title: group_head_title %body{class: "#{app_theme} #{theme_type} application", :'data-page' => body_data_page} - = render "layouts/public_head_panel", title: "group: #{@group.name}" + = render "layouts/public_head_panel", title: link_to(@group.name, group_path(@group)) = render 'layouts/page', sidebar: 'layouts/nav/group' diff --git a/app/views/layouts/public_users.html.haml b/app/views/layouts/public_users.html.haml index 37767df33d2..3538a8b1699 100644 --- a/app/views/layouts/public_users.html.haml +++ b/app/views/layouts/public_users.html.haml @@ -2,5 +2,5 @@ %html{ lang: "en"} = render "layouts/head", title: @title %body{class: "#{app_theme} #{theme_type} application", :'data-page' => body_data_page} - = render "layouts/public_head_panel", title: @title + = render "layouts/public_head_panel", title: defined?(@title_url) ? link_to(@title, @title_url) : @title = render 'layouts/page' diff --git a/app/views/layouts/search.html.haml b/app/views/layouts/search.html.haml index 6d001e7ee1c..177e2073a0d 100644 --- a/app/views/layouts/search.html.haml +++ b/app/views/layouts/search.html.haml @@ -3,7 +3,7 @@ = render "layouts/head", title: "Search" %body{class: "#{app_theme} #{theme_type} application", :'data-page' => body_data_page} = render "layouts/broadcast" - = render "layouts/head_panel", title: "Search" + = render "layouts/head_panel", title: link_to("Search", search_path) .container.navless-container .content = render "layouts/flash"