summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-01-15 12:27:55 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-01-15 12:27:55 +0200
commitbed882e647fbef00305eb1db792c1e3b49849baf (patch)
tree49c56b89b0ccfcaf0a5453de1cb4e887399db8cf
parent60af43b98197e8338fdca7b23ebbc188908ee1df (diff)
downloadgitlab-ce-bed882e647fbef00305eb1db792c1e3b49849baf.tar.gz
layout fixes
-rw-r--r--app/helpers/application_helper.rb7
-rw-r--r--app/views/layouts/_head_panel.html.haml4
2 files changed, 9 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 99ef30aef51..0e4ad533ad7 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -82,4 +82,11 @@ module ApplicationHelper
[projects, default_nav, project_nav].flatten.to_json
end
+ def project_layout
+ @project && !@project.new_record?
+ end
+
+ def profile_layout
+ controller.controller_name == "dashboard" || current_page?(projects_path) || controller.controller_name == "profile" || controller.controller_name == "keys"
+ end
end
diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml
index 0667ba3247a..751a53c0195 100644
--- a/app/views/layouts/_head_panel.html.haml
+++ b/app/views/layouts/_head_panel.html.haml
@@ -8,7 +8,7 @@
= image_tag "Gear-UI.PNG", :width => 20
- - if @project && !@project.new_record?
+ - if project_layout
.project_name
= truncate @project.name, :length => 28
.git_url_wrapper
@@ -18,7 +18,7 @@
= render :partial => "projects/refs", :locals => { :destination => controller.controller_name == "commits" ? "commits" : "tree" }
= yield :rss_icon
- - if controller.controller_name == "dashboard" || current_page?(projects_path)
+ - elsif profile_layout
= link_to "Activities", dashboard_path, :class => "dash_top_link #{"active" if current_page?(dashboard_path) || current_page?(root_path) }"
= link_to "Projects", projects_path, :class => "dash_top_link #{"active" if current_page?(projects_path)}"
= link_to "Issues", dashboard_issues_path, :class => "dash_top_link #{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide"