diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index 7f89bdf0e9a6435fbab13f0dc0e829891fd57462..4eed58e26383c973619a04aed709cad9aed96b3f 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -8,9 +8,7 @@ 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" + = render "layouts/search" .fbtn - if current_user.is_admin? = link_to admin_root_path, class: "btn small", title: "Admin area" do @@ -29,11 +27,3 @@ = link_to 'Logout', destroy_user_session_path, class: "logout", method: :delete = render "layouts/init_auto_complete" - -:javascript - $(function(){ - $("#search").autocomplete({ - source: #{raw search_autocomplete_source}, - select: function(event, ui) { location.href = ui.item.url } - }); - }); diff --git a/app/views/layouts/_search.html.haml b/app/views/layouts/_search.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..80ecc5304d616de8751b35d616a0febf88279156 --- /dev/null +++ b/app/views/layouts/_search.html.haml @@ -0,0 +1,11 @@ +.search + = form_tag search_path, method: :get do |f| + = text_field_tag "search", nil, placeholder: "Search", class: "search-input" + +:javascript + $(function(){ + $("#search").autocomplete({ + source: #{raw search_autocomplete_source}, + select: function(event, ui) { location.href = ui.item.url } + }); + });