[#760] Extract quick search to a partial.

Contributed by Peer Allan
This commit is contained in:
Eric Davis 2011-12-10 12:28:53 -08:00
parent d32480753b
commit d2ccdc88fa
2 changed files with 6 additions and 5 deletions

View File

@ -35,11 +35,7 @@
<div id="logo"><%= link_to(h(Setting.app_title), home_path) %></div>
<div id="top-menu-items">
<div id="search">
<%= 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', @question, :size => 20, :class => 'search_field', :placeholder => l(:search_input_placeholder), :accesskey => accesskey(:quick_search) %>
<% end %>
<%= render :partial => 'search/quick_search', :locals => {:search_term => @question} %>
</div>
<% if User.current.logged? || !Setting.login_required? %>

View File

@ -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 %>