From d2ccdc88fa5cb0649e0ef90ab883b2aeaabdde9c Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Sat, 10 Dec 2011 12:28:53 -0800 Subject: [PATCH] [#760] Extract quick search to a partial. Contributed by Peer Allan --- app/views/layouts/base.rhtml | 6 +----- app/views/search/_quick_search.html.erb | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 app/views/search/_quick_search.html.erb diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index 1fa5ae6c..c0ab2122 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -35,11 +35,7 @@
<% if User.current.logged? || !Setting.login_required? %> diff --git a/app/views/search/_quick_search.html.erb b/app/views/search/_quick_search.html.erb new file mode 100644 index 00000000..4dd8c0d6 --- /dev/null +++ b/app/views/search/_quick_search.html.erb @@ -0,0 +1,5 @@ + <%= label_tag("q", l(:label_search), :class => "hidden-for-sighted") %> + <% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get) do %> + <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %> + <%= text_field_tag 'q', search_term, :size => 20, :class => 'search_field', :placeholder => l(:search_input_placeholder), :accesskey => accesskey(:quick_search) %> + <% end %>