*** app/views/search/index.html.erb.orig 2014-01-19 12:09:44.000000000 +0100 --- app/views/search/index.html.erb 2014-01-19 12:07:02.000000000 +0100 *************** *** 10,15 **** --- 10,16 ---- <%= hidden_field_tag 'titles_only', '', :id => nil %> +

<% @object_types.each do |t| %> *** config/locales/en.yml.orig 2014-01-19 12:13:32.000000000 +0100 --- config/locales/en.yml 2014-01-19 12:14:09.000000000 +0100 *************** *** 696,701 **** --- 696,702 ---- label_search: Search label_result_plural: Results label_all_words: All words + label_search_open_issues_only: Only open issues label_wiki: Wiki label_wiki_edit: Wiki edit label_wiki_edit_plural: Wiki edits *** app/controllers/search_controller.rb.orig 2014-01-19 12:10:04.000000000 +0100 --- app/controllers/search_controller.rb 2014-01-19 12:06:01.000000000 +0100 *************** *** 26,31 **** --- 26,32 ---- @question.strip! @all_words = params[:all_words] ? params[:all_words].present? : true @titles_only = params[:titles_only] ? params[:titles_only].present? : false + @open_issues_only = params[:open_issues_only] ? params[:open_issues_only].present? : false projects_to_search = case params[:scope] *************** *** 84,89 **** --- 85,96 ---- @results_by_type[s] += c end @results = @results.sort {|a,b| b.event_datetime <=> a.event_datetime} + + # Filter out closed issues + if @open_issues_only + @results = @results.find_all{|s| s unless s.is_a?(Issue) && s.status.is_closed} + end + if params[:previous].nil? @pagination_previous_date = @results[0].event_datetime if offset && @results[0] if @results.size > limit