diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 9c4c5a10..b3ce20ac 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -1,3 +1,2 @@
module SearchHelper
-
end
diff --git a/app/views/search/_show_results_collection.rhtml b/app/views/search/_show_results_collection.rhtml
new file mode 100644
index 00000000..0ea84351
--- /dev/null
+++ b/app/views/search/_show_results_collection.rhtml
@@ -0,0 +1,11 @@
+<%
+collection = show_results_collection
+collection_name ||= 'unknown'
+collection_title ||= 'unknown object'
+unless collection.empty?
+-%>
+
<% if @count == 0 -%>
<%= t('search.no_results') %>
<% else -%>
- <% unless @found_todos.empty? -%>
-
-
<%= @found_todos.size %><%= t('search.todos_matching_query') %>
- <%= render :partial => "todos/todo", :collection => @found_todos, :locals => { :parent_container_type => 'search', :suppress_context => false, :suppress_project => false, :suppress_edit_button => true } %>
-
+
+ <% render :layout => 'show_results_collection', :object => @found_todos, :locals => { :collection_name => "found-todos", :collection_title => t('search.todos_matching_query')} do %>
+ <%= render :partial => "todos/todo", :collection => @found_todos, :locals => { :parent_container_type => 'search', :suppress_context => false, :suppress_project => false, :suppress_edit_button => true } %>
<% end -%>
- <% unless @found_projects.empty? -%>
-
-
<%= @found_projects.size %><%= t('search.projects_matching_query') %>
- <%= render :partial => "projects/project_listing", :collection => @found_projects, :locals => { :suppress_drag_handle => true, :suppress_edit_button => true } %>
-
+ <% render :layout => 'show_results_collection', :object => @found_projects, :locals => { :collection_name => "found-project", :collection_title => t('search.projects_matching_query')} do %>
+ <%= render :partial => "projects/project_listing", :collection => @found_projects, :locals => { :suppress_drag_handle => true, :suppress_edit_button => true } %>
<% end -%>
- <% unless @found_notes.empty? -%>
-
-
<%= @found_notes.size %><%= t('search.notes_matching_query') %>
- <% for notes in @found_notes -%>
-
- <%= render :partial => "notes/notes_summary", :object => notes %>
-
- <% end -%>
-
+ <% render :layout => 'show_results_collection', :object => @found_notes, :locals => { :collection_name => "found-notes", :collection_title => t('search.notes_matching_query')} do %>
+ <%= render :partial => "notes/notes_summary", :collection=> @found_notes %>
<% end -%>
- <% unless @found_contexts.empty? -%>
-
-
<%= @found_contexts.size %><%= t('search.contexts_matching_query') %>
- <%= render :partial => "contexts/context_listing", :collection => @found_contexts, :locals => { :suppress_drag_handle => true, :suppress_edit_button => true } %>
-
+ <% render :layout => 'show_results_collection', :object => @found_contexts, :locals => { :collection_name => "found-contexts", :collection_title => t('search.contexts_matching_query')} do %>
+ <%= render :partial => "contexts/context_listing", :collection => @found_contexts, :locals => { :suppress_drag_handle => true, :suppress_edit_button => true } %>
<% end -%>
- <% unless @found_tags.empty? -%>
-
-
<%= @found_tags.size %><%= t('search.tags_matching_query') %>
+ <% render :layout => 'show_results_collection', :object => @found_tags, :locals => { :collection_name => "found-tags", :collection_title => t('search.tags_matching_query')} do %>
<% @found_tags.each do |tag| -%>
<%= link_to tag.name, {:controller => "todos", :action => "tag", :id => tag.name} -%>
<% end %>
-
-
-
- <% end %>
+
+ <% end -%>
+
<% end -%>
-