diff --git a/app/views/search/_display_results.rhtml b/app/views/search/_display_results.rhtml
index 84dfc2f..8a994e2 100644
--- a/app/views/search/_display_results.rhtml
+++ b/app/views/search/_display_results.rhtml
@@ -1,3 +1,13 @@
+
+<% form_tag(:action => 'index') do %>
+ <%= text_field_tag 'query', @query %>
+ <%= submit_button :search, _('Search') %>
+<% end %>
+
+<%= link_to _('Search for "%s" in the whole site') % @query, :controller => 'search', :action => 'index', :category_path => [], :query => @query if @category %>
+
+
+
<% pos = :odd %>
<% @results.each do |name,results| %>
diff --git a/app/views/search/category_index.rhtml b/app/views/search/category_index.rhtml
index f028729..f4222b1 100644
--- a/app/views/search/category_index.rhtml
+++ b/app/views/search/category_index.rhtml
@@ -4,7 +4,7 @@
<%= @category.ancestors.reverse.map { |a| link_to_category(a, false) }.join(' → ') %>
- <%= _('Category: %s') % @category.name %>
+ <%= _('Category: %s') % @category.name %>
<%= render :partial => @category.class.name.underscore %>
diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb
index a3ee043..201385c 100644
--- a/test/functional/search_controller_test.rb
+++ b/test/functional/search_controller_test.rb
@@ -472,5 +472,26 @@ class SearchControllerTest < Test::Unit::TestCase
get :index
assert_no_tag :tag => 'div', :attributes => { :id => 'boxes', :class => 'boxes' }
end
+
+ should 'offer text box to enter a new search in general context' do
+ get :index, :query => 'a sample search'
+ assert_tag :tag => 'form', :attributes => { :action => '/search' }, :descendant => {
+ :tag => 'input',
+ :attributes => { :name => 'query', :value => 'a sample search' }
+ }
+ end
+
+ should 'offer text box to enter a new seach in specific context' do
+ get :index, :category_path => [ 'my-category'], :query => 'a sample search'
+ assert_tag :tag => 'form', :attributes => { :action => '/search/index/my-category' }, :descendant => {
+ :tag => 'input',
+ :attributes => { :name => 'query', :value => 'a sample search' }
+ }
+ end
+
+ should 'offer link to do the same search as before in general context' do
+ get :index, :category_path => [ 'my-category' ], :query => 'a sample search'
+ assert_tag :tag => 'a', :attributes => { :href => "/search?query=a+sample+search" }, :content => 'Search for "a sample search" in the whole site'
+ end
end
--
libgit2 0.21.2