diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 6e15d288c..7a0451910 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -12,6 +12,7 @@ class SearchController < ApplicationController count_search_results search_projects if @search_category == :projects + search_experiments if @search_category == :experiments search_workflows if @search_category == :workflows search_modules if @search_category == :modules search_results if @search_category == :results @@ -63,7 +64,8 @@ class SearchController < ApplicationController @search_page = 1 end end -# Initialize markdown parser + + # Initialize markdown parser def load_markdown if @search_category == :results @markdown = Redcarpet::Markdown.new( @@ -87,6 +89,7 @@ class SearchController < ApplicationController def count_search_results @project_search_count = count_by_name Project + @experiment_search_count = count_by_name Experiment @workflow_search_count = count_by_name MyModuleGroup @module_search_count = count_by_name MyModule @result_search_count = count_by_name Result @@ -101,6 +104,7 @@ class SearchController < ApplicationController @comment_search_count = count_by_name Comment @search_results_count = @project_search_count + @search_results_count += @experiment_search_count @search_results_count += @workflow_search_count @search_results_count += @module_search_count @search_results_count += @result_search_count @@ -123,6 +127,14 @@ class SearchController < ApplicationController @search_count = @project_search_count end + def search_experiments + @experiment_results = [] + if @experiment_search_count > 0 then + @experiment_results = search_by_name Experiment + end + @search_count = @experiment_search_count + end + def search_workflows @workflow_results = [] if @workflow_search_count > 0 then diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb index 4c2c6e2f3..d8bc49ef0 100644 --- a/app/views/search/index.html.erb +++ b/app/views/search/index.html.erb @@ -20,6 +20,17 @@ <%= t'Projects' %> +