diff options
author | Valeriy Sizov <vsv2711@gmail.com> | 2011-12-27 14:33:38 -0800 |
---|---|---|
committer | Valeriy Sizov <vsv2711@gmail.com> | 2011-12-27 14:33:38 -0800 |
commit | 47d5d5f5db1fd6259e041211ea70da93f2173441 (patch) | |
tree | db4238913e2bc69d8c854a771b21c0ac4b0e8533 /app | |
parent | 676fa16cebc6d6773c48a1af88b2316d175c31f2 (diff) | |
parent | 36b7b5f299d3c7744d069b804c4c9edcc88c1536 (diff) | |
download | gitlab-ce-47d5d5f5db1fd6259e041211ea70da93f2173441.tar.gz |
Merge pull request #203 from mlitwiniuk/top_nav_fix
Hide admin menu for non-admins
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/style.scss | 5 | ||||
-rw-r--r-- | app/views/layouts/_head_panel.html.erb | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/app/assets/stylesheets/style.scss b/app/assets/stylesheets/style.scss index 6982440be4c..72c1e201eb5 100644 --- a/app/assets/stylesheets/style.scss +++ b/app/assets/stylesheets/style.scss @@ -359,6 +359,9 @@ header nav{border-radius: 4px; box-shadow: 0 1px 2px black; width: 294px; margin margin-top: 2px; height:30px } +header nav.shorter_nav{ + width: 207px; +} header nav a{padding: 8px 12px 8px 34px; display: inline-block; color: #D6DADF; border-right: 1px solid #31363E; position: relative; box-shadow: 1px 0 0 rgba(255,255,255,.1); margin: 0} header nav a span{width: 20px; height: 20px; display: inline-block; background: red; position: absolute; left: 8px; top: 6px;} header nav a:last-child {border: 0; box-shadow: none} @@ -382,7 +385,7 @@ header nav a.dashboard { border-bottom-left-radius: 4px; } -header nav a.admin{ +header nav a.last_elem{ -webkit-border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-topright: 4px; diff --git a/app/views/layouts/_head_panel.html.erb b/app/views/layouts/_head_panel.html.erb index 70484df5bad..5b3c2a6b99d 100644 --- a/app/views/layouts/_head_panel.html.erb +++ b/app/views/layouts/_head_panel.html.erb @@ -21,16 +21,18 @@ <%= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" %> </div> <!-- .login-top --> - <nav> - <%= link_to dashboard_path, :class => current_page?(root_path) ? "current dashboard" : "dashboard" do %> + <nav class="<%= 'shorter_nav' unless current_user.is_admin? %>"> + <%= link_to dashboard_path, :class => "#{'current' if current_page?(root_path)} dashboard" do %> <span></span>Dashboard <% end %> - <%= link_to projects_path, :class => current_page?(projects_path) ? "current project" : "project" do %> + <%= link_to projects_path, :class =>"#{'current' if current_page?(projects_path)} project #{'last_elem' unless current_user.is_admin?}" do %> <span></span>Projects <% end %> - <%= link_to((current_user.is_admin? ? admin_root_path : "#"), :class => (admin_namespace? ? "current admin" : "admin")) do %> - <span></span>Admin - <% end %> + <% if current_user.is_admin? %> + <%= link_to((current_user.is_admin? ? admin_root_path : "#"), :class => "#{'current' if admin_namespace?} admin last_elem") do %> + <span></span>Admin + <% end %> + <% end %> </nav> </header> |