gitlabhq/app/views/layouts/_head_panel.html.erb
Valeriy Sizov 47d5d5f5db Merge pull request #203 from mlitwiniuk/top_nav_fix
Hide admin menu for non-admins
2011-12-27 14:33:38 -08:00

57 lines
1.8 KiB
Plaintext

<!-- Page Header -->
<header>
<h1 class="logo">
<%= link_to "GITLAB", root_url %>
</h1>
<div class="account-box">
<%= link_to profile_path, :class => "pic" do %>
<%= image_tag gravatar_icon(current_user.email) %>
<% end %>
<div class="account-links">
<%= link_to profile_path, :class => "username" do %>
<%#= current_user.name %>
My profile
<% end %>
<%= link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete %>
</div>
</div><!-- .account-box -->
<div class="search">
<%= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" %>
</div>
<!-- .login-top -->
<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' if current_page?(projects_path)} project #{'last_elem' unless current_user.is_admin?}" do %>
<span></span>Projects
<% 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>
<!-- eo Page Header -->
<% if current_user %>
<%= javascript_tag do %>
$(function() {
$("#search" ).autocomplete({
source: <%= raw search_autocomplete_source %>,
select: function(event, ui) { location.href = ui.item.url }
});
});
<% end %>
<% end %>
<% if current_user.require_ssh_key? %>
<div id="no_ssh_key_defined" class="big-message error">
<p>No SSH Key is defined. You won't be able to use any Git command!. Click <%=link_to( 'here', keys_path ) %> to add one!
</div>
<% end %>