diff --git a/app/controllers/public/search_controller.rb b/app/controllers/public/search_controller.rb
index 2592d22..af2896f 100644
--- a/app/controllers/public/search_controller.rb
+++ b/app/controllers/public/search_controller.rb
@@ -5,11 +5,16 @@ class SearchController < ApplicationController
before_filter :load_category
before_filter :prepare_filter
before_filter :check_search_whole_site
+ before_filter :load_search_assets
no_design_blocks
protected
+ def load_search_assets
+ @search_in = SEARCH_IN
+ end
+
def search(finder, query)
finder.find_by_contents(query).sort_by do |hit|
-(relevance_for(hit))
@@ -106,7 +111,6 @@ class SearchController < ApplicationController
#######################################################
def popup
- @search_in = SEARCH_IN
render :action => 'popup', :layout => false
end
diff --git a/app/views/search/_display_results.rhtml b/app/views/search/_display_results.rhtml
index 8a994e2..8bc0b71 100644
--- a/app/views/search/_display_results.rhtml
+++ b/app/views/search/_display_results.rhtml
@@ -1,9 +1,6 @@
-
-<% form_tag(:action => 'index') do %>
- <%= text_field_tag 'query', @query %>
- <%= submit_button :search, _('Search') %>
-<% end %>
+<%= render :partial => 'search_form' %>
+
<%= link_to _('Search for "%s" in the whole site') % @query, :controller => 'search', :action => 'index', :category_path => [], :query => @query if @category %>
diff --git a/app/views/search/popup.rhtml b/app/views/search/popup.rhtml
index d61b360..3386919 100644
--- a/app/views/search/popup.rhtml
+++ b/app/views/search/popup.rhtml
@@ -2,50 +2,7 @@
<%= _('Search %s') % @environment.name %>
-<% form_tag({:action => 'index', :category_path => (@category ? @category.explode_path : [])}, :method => 'get') do%>
-
-
-
- <%= text_field_tag 'query', '', :id => 'popup-search-input', :size => 50 %>
- <%= javascript_tag '$("popup-search-input").focus()' %>
-
- <%= submit_button(:search, _('Search')) %>
-
-
- <% if @category %>
-
<%= _('Search in:') %>
-
- -
- <%= radio_button_tag :search_whole_site, 'no', true %>
- <%= _('Only in %{category}') % { :category => @category.full_name } %>
-
- -
- <%= radio_button_tag :search_whole_site, 'yes' %>
- <%= _('Whole site') %>
-
-
- <% end %>
-
-
-
<%= _('Search for:') %>
-
- <% @search_in.map { |t,n| [t,gettext(n)] } .
- sort_by(&:last).each do |thing, name| %>
- -
- <%= check_box_tag 'find_in[]', thing.to_s, true %>
- <%= name %>
-
- <% end %>
-
-
-
-
- <% button_bar do %>
- <%= submit_button(:search, _('Search')) %>
- <%= lightbox_close_button(_('Close')) %>
- <% end %>
-
-<% end %>
+<%= render :partial => 'search_form' %>