1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/ Page Header
%header.top_panel_holder
.container
.top_panel_content
%div.app_logo
= link_to root_path, :class => "home", :title => "Home" do
%h1
GITLAB
%span.separator
%h1.project_name= title
.search
= form_tag search_path, :method => :get do |f|
= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input"
.fbtn
- if current_user.is_admin?
= link_to admin_root_path, :class => "btn small", :title => "Admin area" do
%i.icon-cog
Admin
- if current_user.can_create_project?
= link_to new_project_path, :class => "btn small", :title => "Create New Project" do
%i.icon-plus
Project
.account-box
= link_to profile_path, :class => "pic" do
= image_tag gravatar_icon(current_user.email)
.account-links
= link_to profile_path, :class => "username" do
My profile
= link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete
:javascript
$(function(){
$("#search").autocomplete({
source: #{raw search_autocomplete_source},
select: function(event, ui) { location.href = ui.item.url }
});
$(document).keypress(function(e) {
if($(e.target).is(":input")) return;
switch(e.which) {
case 115: focusSearch();
e.preventDefault();
}
});
});